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 William Fu-Hinthorn
parent 8ad6df6a4d
commit 9a2d313e64

View File

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