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

Add additional_instructions on openai assistan runs create. #29164

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions libs/langchain/langchain/agents/openai_assistant/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ async def ainvoke(
message_metadata: Metadata to associate with a new message.
thread_metadata: Metadata to associate with new thread. Only relevant
when a new thread is created.
instructions: Additional run instructions.
instructions: Overrides the instructions of the assistant.
additional_instructions: Appends additional instructions.
model: Override Assistant model for this run.
tools: Override Assistant tools for this run.
run_metadata: Metadata to associate with new run.
Expand Down Expand Up @@ -507,7 +508,14 @@ def _create_run(self, input: dict) -> Any:
params = {
k: v
for k, v in input.items()
if k in ("instructions", "model", "tools", "run_metadata")
if k
in (
"instructions",
"model",
"tools",
"additional_instructions",
"run_metadata",
)
}
return self.client.beta.threads.runs.create(
input["thread_id"],
Expand Down Expand Up @@ -637,7 +645,14 @@ async def _acreate_run(self, input: dict) -> Any:
params = {
k: v
for k, v in input.items()
if k in ("instructions", "model", "tools", "run_metadata")
if k
in (
"instructions",
"model",
"tools",
"additional_instructions",
"run_metadata",
)
}
return await self.async_client.beta.threads.runs.create(
input["thread_id"],
Expand Down
Loading