|
@@ -46,6 +46,8 @@ class RunService:
|
|
|
body.temperature = db_asst.temperature
|
|
|
if not body.top_p and db_asst.top_p:
|
|
|
body.top_p = db_asst.top_p
|
|
|
+ if body.additional_instructions:
|
|
|
+ body.instructions = body.additional_instructions
|
|
|
|
|
|
file_ids = []
|
|
|
asst_file_ids = db_asst.file_ids
|
|
@@ -77,6 +79,11 @@ class RunService:
|
|
|
# 去除重复的file_ids,这里要处理
|
|
|
file_ids = list(set(file_ids))
|
|
|
|
|
|
+ if len(file_ids) > 0:
|
|
|
+ file_search_tool = {"type": "file_search"}
|
|
|
+ if file_search_tool not in body.tools:
|
|
|
+ body.tools.append(file_search_tool)
|
|
|
+
|
|
|
# create run
|
|
|
db_run = Run.model_validate(
|
|
|
body.model_dump(by_alias=True),
|