mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-14 15:16:21 +00:00
community: update how OpenAIAssistantV2Runnable creates threads with tool_resources (#22549)
https://github.com/langchain-ai/langchain/issues/22503
This commit is contained in:
parent
51a0d4574e
commit
af129974a3
@ -507,8 +507,10 @@ class OpenAIAssistantV2Runnable(OpenAIAssistantRunnable):
|
|||||||
params = {
|
params = {
|
||||||
k: v
|
k: v
|
||||||
for k, v in input.items()
|
for k, v in input.items()
|
||||||
if k in ("instructions", "model", "tools", "tool_resources", "run_metadata")
|
if k in ("instructions", "model", "tools", "run_metadata")
|
||||||
}
|
}
|
||||||
|
if tool_resources := input.get("tool_resources"):
|
||||||
|
thread["tool_resources"] = tool_resources
|
||||||
run = self.client.beta.threads.create_and_run(
|
run = self.client.beta.threads.create_and_run(
|
||||||
assistant_id=self.assistant_id,
|
assistant_id=self.assistant_id,
|
||||||
thread=thread,
|
thread=thread,
|
||||||
@ -532,8 +534,10 @@ class OpenAIAssistantV2Runnable(OpenAIAssistantRunnable):
|
|||||||
params = {
|
params = {
|
||||||
k: v
|
k: v
|
||||||
for k, v in input.items()
|
for k, v in input.items()
|
||||||
if k in ("instructions", "model", "tools", "tool_resources", "run_metadata")
|
if k in ("instructions", "model", "tools", "run_metadata")
|
||||||
}
|
}
|
||||||
|
if tool_resources := input.get("tool_resources"):
|
||||||
|
thread["tool_resources"] = tool_resources
|
||||||
run = await self.async_client.beta.threads.create_and_run(
|
run = await self.async_client.beta.threads.create_and_run(
|
||||||
assistant_id=self.assistant_id,
|
assistant_id=self.assistant_id,
|
||||||
thread=thread,
|
thread=thread,
|
||||||
|
Loading…
Reference in New Issue
Block a user