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

community: Additional parameters for OpenAIAssistantV2Runnable #29207

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

pm390
Copy link
Contributor

@pm390 pm390 commented Jan 14, 2025

Description: Added Additional parameters that could be useful for usage of OpenAIAssistantV2Runnable.

This change is thought to allow langchain users to set parameters that cannot be set using assistants UI (max_completion_tokens,max_prompt_tokens,parallel_tool_calls) and parameters that could be useful for experimenting like top_p and temperature.

This PR originated from the need of using parallel_tool_calls in langchain, this parameter is very important in openAI assistants because without this parameter set to False strict mode is not respected by OpenAI Assistants (https://platform.openai.com/docs/guides/function-calling#parallel-function-calling).

Note: Currently, if the model calls multiple functions in one turn then strict mode will be disabled for those calls.

Issue: None
Dependencies: openai

Copy link

vercel bot commented Jan 14, 2025

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 Jan 14, 2025 5:33pm

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. community Related to langchain-community labels Jan 14, 2025
@pm390
Copy link
Contributor Author

pm390 commented Jan 14, 2025

Actually...
I was just testing around the change, I noticed that the run_metadata parameter does not exist (and openAI doesn't have kwargs on their side) so invoking the assistant with the parameter set results in (if using async version):
TypeError: AsyncThreads.create_and_run() got an unexpected keyword argument 'run_metadata'

The correct parameter should be metadata.
I'll try get a minimal reproducer and open an Issue later this week.

@ccurme
Copy link
Collaborator

ccurme commented Jan 14, 2025

Actually... I was just testing around the change, I noticed that the run_metadata parameter does not exist (and openAI doesn't have kwargs on their side) so invoking the assistant with the parameter set results in (if using async version): TypeError: AsyncThreads.create_and_run() got an unexpected keyword argument 'run_metadata'

The correct parameter should be metadata. I'll try get a minimal reproducer and open an Issue later this week.

Thanks @pm390. From your perspective, is this PR good to go? i.e., the issue with run_metadata is separate? Or should we hold off?

@pm390
Copy link
Contributor Author

pm390 commented Jan 14, 2025

@ccurme from my perspective we should treat the issue as a separate topic (adding a new functionality support should be separated from fixing an issue), so this PR is good to go.

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jan 14, 2025
@ccurme ccurme merged commit 7617251 into langchain-ai:master Jan 14, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants