refac
This commit is contained in:
1 parent
ebc9ccbe1c
commit
7c52382c90
1 file changed
+7
-2
@@ -2370,11 +2370,16 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# Native FC: tool docstring can't be dynamic, so inject
|
# Native FC: tool docstring can't be dynamic, so inject
|
||||||
# filesystem context into messages for pyodide engine
|
# filesystem context into the system message for pyodide
|
||||||
|
# engine. Appending to the system prompt (instead of the
|
||||||
|
# user message) keeps it in the stable cached prefix so
|
||||||
|
# providers with prefix caching don't re-bill the full
|
||||||
|
# conversation on every turn.
|
||||||
if engine != 'jupyter':
|
if engine != 'jupyter':
|
||||||
form_data['messages'] = add_or_update_user_message(
|
form_data['messages'] = add_or_update_system_message(
|
||||||
CODE_INTERPRETER_PYODIDE_PROMPT,
|
CODE_INTERPRETER_PYODIDE_PROMPT,
|
||||||
form_data['messages'],
|
form_data['messages'],
|
||||||
|
append=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
tool_ids = form_data.pop('tool_ids', None)
|
tool_ids = form_data.pop('tool_ids', None)
|
||||||
|
|||||||
Reference in new issue
Block a user