Commit Graph

719 Commits

Author SHA1 Message Date
Ariel Frischer e42f281f94 chore(anthropic_message_utils.py): remove unused fix_anthropic_message_content function to clean up codebase
chore(anthropic_token_limiter.py): remove import of fix_anthropic_message_content as it is no longer needed
test: add unit tests for has_tool_use and is_tool_pair functions to ensure correct functionality
test: enhance test coverage for anthropic_trim_messages with tool use scenarios to validate message handling
2025-03-11 23:48:08 -07:00
Ariel Frischer 376d486db8 refactor(anthropic_message_utils.py): clean up whitespace and improve code readability by removing unnecessary blank lines and aligning code formatting
fix(anthropic_message_utils.py): add warning in docstring for anthropic_trim_messages function to indicate incomplete implementation and clarify behavior
fix(anthropic_message_utils.py): ensure consistent formatting in conditional statements and improve readability of logical checks
2025-03-11 23:38:31 -07:00
Ariel Frischer a3284c9d7e feat(anthropic_token_limiter.py): add dataclass import for future use and improve code readability by restructuring import statements 2025-03-11 23:37:20 -07:00
Ariel Frischer ee73c85b02 feat(anthropic_message_utils.py): add utilities for handling Anthropic-specific message formats and trimming to improve message processing
fix(agent_utils.py): remove debug print statement for max_input_tokens to clean up code
refactor(anthropic_token_limiter.py): update state_modifier to use anthropic_trim_messages for better token management and maintain message structure
2025-03-11 23:24:57 -07:00
Ariel Frischer 09ba1ee0b9 refactor(anthropic_token_limiter.py): rename messages_to_dict to message_to_dict for consistency and clarity
feat(anthropic_token_limiter.py): add convert_message_to_litellm_format function to standardize message format for litellm
fix(anthropic_token_limiter.py): update wrapped_token_counter to handle only BaseMessage objects and improve token counting logic
chore(anthropic_token_limiter.py): add debug print statements to track token counts before and after trimming messages
2025-03-11 21:26:57 -07:00
Ariel Frischer 5c9a1e81d2 feat(main.py): refactor imports for better organization and readability
feat(main.py): add DEFAULT_MODEL constant to centralize model configuration
feat(main.py): enhance logging and error handling for better debugging
feat(main.py): implement state_modifier for managing token limits in agent state
feat(anthropic_token_limiter.py): create utilities for handling token limits with Anthropic models
feat(output.py): add print_messages_compact function for debugging message output
test(anthropic_token_limiter.py): add unit tests for token limit utilities and state management
2025-03-11 14:03:18 -07:00
Andrew I. Christianson b4b0fdd686
Merge pull request #120 from ariel-frischer/cost-display
Add Cost Display for Default ReAct Agent
2025-03-10 20:12:01 -04:00
Ariel Frischer 4aa1b0ba93 refactor(agent_utils.py): remove unused run_research_agent and run_web_research_agent functions to clean up code and improve maintainability
refactor(agent_utils.py): import run_research_agent and run_web_research_agent from their respective modules to streamline the code structure and enhance clarity
2025-03-10 17:09:05 -07:00
Ariel Frischer c4b2d2bb51 fix(agent_utils.py): remove merge conflict markers and clean up imports to ensure code integrity
refactor(agent_utils.py): consolidate research agent imports for better organization and readability
2025-03-10 17:07:24 -07:00
Ariel Frischer 89e4556e7b feat: implement trajectory model and repository for tracking agent actions
This commit introduces a new `Trajectory` model to the database, which tracks the sequence of actions taken by agents, including tool executions and their results. The addition of the `TrajectoryRepository` allows for storing and retrieving these trajectories, enabling better analysis of agent behavior and debugging of issues.

Additionally, the commit refactors existing code to utilize the new repository and model, improving the overall architecture and maintainability of the codebase. This change is essential for enhancing the capabilities of the agent system and providing a more robust framework for future development.
2025-03-10 17:05:34 -07:00
Ariel Frischer 4d4eb6cadb fix(tests): add cost_cb parameter to fake_print_agent_output function to enhance flexibility in testing
style(tests): add newline at the end of test_handle_api_error_resource_exhausted function for consistency with PEP 8 guidelines
2025-03-10 17:03:42 -07:00
Ariel Frischer 8f2adc7f61 fix(output.py): update subtitle text from "Total Cost" to "Cost" for clarity in cost information display 2025-03-10 17:01:00 -07:00
Ariel Frischer f43c5e72b6 feat(output.py): add get_cost_subtitle function to generate cost subtitles for agent output
refactor(output.py): simplify subtitle generation in print_agent_output function by using get_cost_subtitle
2025-03-10 16:58:39 -07:00
Ariel Frischer 416689b030 feat(agent_utils.py): pass callback to print_agent_output to track costs and tokens
feat(output.py): enhance print_agent_output to display cost and token information in the output panel
2025-03-10 16:51:42 -07:00
AI Christianson 909825bf1b refactor: extract get_most_recent_id 2025-03-10 19:37:39 -04:00
AI Christianson b3010bb649 add error info to trajectory records 2025-03-10 19:12:14 -04:00
AI Christianson 78983ec20b add trajectory table 2025-03-10 18:59:42 -04:00
AI Christianson a18998be0d add project info to reasoning assist prompts 2025-03-10 18:01:56 -04:00
AI Christianson 3db7cc2ca9 improve prompt 2025-03-10 17:47:31 -04:00
AI Christianson b5e4c64042 improve prompts; make list_directory more resilient 2025-03-10 16:41:09 -04:00
AI Christianson 7d579f5557 improve prompts 2025-03-10 15:37:38 -04:00
AI Christianson e81421a95a improve prompts 2025-03-10 15:30:22 -04:00
AI Christianson c98c107ce3 use expert model for reasoning assisted mode 2025-03-10 14:58:47 -04:00
AI Christianson 51fa86b5c4 refactor: extract run_task_implementation_agent 2025-03-10 14:44:34 -04:00
AI Christianson d8dcc8ca86 refactor: extract run_planning_agent 2025-03-10 14:19:06 -04:00
AI Christianson a437a1e8c3 prompt improvements 2025-03-10 13:46:08 -04:00
AI Christianson 4f2c36b958 refactor: extract research agent 2025-03-10 13:33:00 -04:00
Ariel Frischer 2899b5f848
feat(agent_utils.py): add AnthropicCallbackHandler to track token usage and costs for Anthropic models (#118)
style(agent_utils.py): format imports and code for better readability
refactor(agent_utils.py): standardize model name and cost calculation logic for clarity and maintainability
chore(anthropic_callback_handler.py): create a new file for the AnthropicCallbackHandler implementation and related functions
2025-03-10 07:08:12 -04:00
Ariel Frischer ddd0e2ae2d feat(agent_utils.py): add AnthropicCallbackHandler to track token usage and costs for Anthropic models
style(agent_utils.py): format imports and code for better readability
refactor(agent_utils.py): standardize model name and cost calculation logic for clarity and maintainability
chore(anthropic_callback_handler.py): create a new file for the AnthropicCallbackHandler implementation and related functions
2025-03-10 01:18:44 -07:00
AI Christianson d194868cff fix binary detection 2025-03-08 22:36:06 -05:00
Ariel Frischer 053908448f
fix(env_inv.py): handle None values in sorting of installations to prevent errors (#117) 2025-03-08 21:03:06 -05:00
AI Christianson d0bf78c5f0 support reasoning assistance in research phase. 2025-03-08 19:32:05 -05:00
AI Christianson 0a143e8fff improve prompts 2025-03-08 17:08:10 -05:00
AI Christianson eaf79fbee5 fix tests; improve prompts 2025-03-08 16:29:17 -05:00
AI Christianson fd772ee369 disable reasoning assistance by default 2025-03-08 15:36:21 -05:00
AI Christianson 35f91aa128 add flags to force enable/disable reasoning assistance 2025-03-08 15:36:00 -05:00
AI Christianson ff653c7208 reasoning assistance for implementation tasks 2025-03-08 15:12:13 -05:00
AI Christianson cfb0ec148f extract thinking processing 2025-03-08 14:48:46 -05:00
AI Christianson 8f1e072e20 improve reasoning assistance 2025-03-08 14:23:35 -05:00
AI Christianson 2130334837 improve reasoning assistance prompt 2025-03-08 13:50:10 -05:00
AI Christianson d7fb269f4d improve reasoning assistance prompt 2025-03-08 13:37:38 -05:00
AI Christianson e64c4066a6 implement reasoning-guided workflows 2025-03-08 13:35:06 -05:00
AI Christianson c323098aec include environment information in prompts 2025-03-08 12:01:40 -05:00
AI Christianson f1a33fc1c0 add environment inventory 2025-03-08 10:58:23 -05:00
AI Christianson b9241780d0 fix test 2025-03-08 09:30:52 -05:00
AI Christianson b262305592 thinking model docs 2025-03-08 09:05:59 -05:00
AI Christianson eff01b62aa improve prompts 2025-03-08 09:05:54 -05:00
AI Christianson c1b84cd645 tokens for qwq 2025-03-08 08:56:16 -05:00
AI Christianson b4d7cd30ce changelog 2025-03-08 08:32:17 -05:00
AI Christianson 96dbd1c4e7 add --show-thoughts flag 2025-03-08 08:31:45 -05:00