Skip to content

Refactoring subroutine#41

Draft
hmirin wants to merge 6 commits intomainfrom
refactoring_subroutine
Draft

Refactoring subroutine#41
hmirin wants to merge 6 commits intomainfrom
refactoring_subroutine

Conversation

@hmirin
Copy link
Copy Markdown
Contributor

@hmirin hmirin commented Feb 19, 2025

No description provided.

This commit refactors the codebase to:
1. Remove subroutine tool in favor of simpler template-based approach
2. Update tool execution to require session context
3. Improve OpenAI and Anthropic tool handling
4. Clean up template and runner APIs
5. Add new benchmark example for LLM bias testing

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 80.52632% with 37 lines in your changes missing coverage. Please review.

Project coverage is 81.22%. Comparing base (91d2bed) to head (d908fe5).

Files with missing lines Patch % Lines
src/prompttrail/agent/subroutine/_base.py 64.70% 6 Missing ⚠️
...mpttrail/agent/subroutine/session_init_strategy.py 50.00% 6 Missing ⚠️
src/prompttrail/agent/templates/_tool.py 81.25% 6 Missing ⚠️
src/prompttrail/core/mocks.py 42.85% 4 Missing ⚠️
src/prompttrail/models/anthropic.py 75.00% 4 Missing ⚠️
src/prompttrail/agent/runners.py 81.25% 3 Missing ⚠️
src/prompttrail/core/_core.py 83.33% 3 Missing ⚠️
src/prompttrail/models/google.py 77.77% 2 Missing ⚠️
src/prompttrail/models/openai.py 94.11% 2 Missing ⚠️
...rc/prompttrail/agent/subroutine/squash_strategy.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   82.88%   81.22%   -1.67%     
==========================================
  Files          30       29       -1     
  Lines        2150     2146       -4     
==========================================
- Hits         1782     1743      -39     
- Misses        368      403      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Remove configuration property from Model class and use constructor-based initialization for cleaner code organization.

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
@hmirin hmirin force-pushed the refactoring_subroutine branch from 3a93ff5 to 2593257 Compare February 19, 2025 15:15
Remove redundant `session=` keyword argument when calling `model.send()`
since it's the only positional argument in the method signature. This
change simplifies the API usage while maintaining functionality.

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
Refactor UserInteractionEvent to include message role and update the CommandLineRunner to display message info consistently. This improves code organization and user feedback during interactions.

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
- Make tool calls more robust with type coercion
- Add optional tool_id for Anthropic compatibility
- Properly restore session.available_tools after execution
- Add logging setup in coding_agent example

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
Update documentation and examples to use simplified model constructor syntax, following the API changes in the previous commit.

(This commit message is auto-generated with examples/dogfooding/commit_with_auto_generated_comment.py)
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant