Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

together, standard-tests: specify tool_choice in standard tests #25548

Merged
merged 9 commits into from
Aug 19, 2024

Conversation

ccurme
Copy link
Collaborator

@ccurme ccurme commented Aug 19, 2024

Here we allow standard tests to specify a value for tool_choice via a tool_choice_value property, which defaults to None.

Chat models available in Together have issues passing standard tool calling tests:

Specifying tool_choice also lets us remove an existing xfail and use a smaller model in Groq tests.

@efriis efriis added the partner label Aug 19, 2024
Copy link

vercel bot commented Aug 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 8:04pm

@efriis efriis self-assigned this Aug 19, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. langchain Related to the langchain package 🤖:improvement Medium size change to existing code to handle new use-cases labels Aug 19, 2024
@ccurme ccurme removed the langchain Related to the langchain package label Aug 19, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 19, 2024
@@ -28,11 +28,22 @@ class TestGroqLlama(BaseTestGroq):
@property
def chat_model_params(self) -> dict:
return {
"model": "llama-3.1-70b-versatile",
"model": "llama-3.1-8b-instant",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooc why go smaller instead of bigger

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do 70b (I changed it from 8b to 70b this morning). My thought is if they support the same features we should prefer smaller models for tests in spirit of testing functionality vs. benchmarking.

@@ -170,7 +170,14 @@ def test_stop_sequence(self, model: BaseChatModel) -> None:
def test_tool_calling(self, model: BaseChatModel) -> None:
if not self.has_tool_calling:
pytest.skip("Test requires tool calling.")
model_with_tools = model.bind_tools([magic_function])
if self.tool_choice_value == "dict":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this format is openai-specific (eg anthropic doesn't support i dont think). i actually tihnk more models support just passing in tool name as a string to bind_tools, and think thats what we'd want to standardize on from a devx perspective anyways

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated this to tool name.

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Aug 19, 2024
@ccurme ccurme merged commit c5bf114 into master Aug 19, 2024
105 checks passed
@ccurme ccurme deleted the cc/standard_tests branch August 19, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. partner size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants