langchain: creating assistants with file_ids (#19199)

Changing OpenAIAssistantRunnable.create_assistant to send the `file_ids`
parameter to openai.beta.assistants.create

Co-authored-by: Frederico Wu <fred.diaswu@coxautoinc.com>
This commit is contained in:
Frederico Wu 2024-03-19 00:34:03 -04:00 committed by GitHub
parent 9b2f9ee952
commit f36418a5b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -212,6 +212,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
instructions=instructions, instructions=instructions,
tools=[convert_to_openai_tool(tool) for tool in tools], # type: ignore tools=[convert_to_openai_tool(tool) for tool in tools], # type: ignore
model=model, model=model,
file_ids=kwargs.get("file_ids"),
) )
return cls(assistant_id=assistant.id, client=client, **kwargs) return cls(assistant_id=assistant.id, client=client, **kwargs)
@ -333,6 +334,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]):
instructions=instructions, instructions=instructions,
tools=openai_tools, # type: ignore tools=openai_tools, # type: ignore
model=model, model=model,
file_ids=kwargs.get("file_ids"),
) )
return cls(assistant_id=assistant.id, async_client=async_client, **kwargs) return cls(assistant_id=assistant.id, async_client=async_client, **kwargs)