🎨 style: format codes
This commit is contained in:
@@ -292,9 +292,7 @@ class LLMRequestSubStage(Stage):
|
||||
|
||||
# tool calls result
|
||||
if req.tool_calls_result:
|
||||
contexts.extend(
|
||||
req.tool_calls_result.to_openai_messages()
|
||||
)
|
||||
contexts.extend(req.tool_calls_result.to_openai_messages())
|
||||
|
||||
contexts.append(
|
||||
{"role": "assistant", "content": llm_response.completion_text}
|
||||
|
||||
@@ -104,7 +104,7 @@ class ProviderAnthropic(ProviderOpenAIOfficial):
|
||||
func_tool: FuncCall = None,
|
||||
contexts=[],
|
||||
system_prompt=None,
|
||||
tool_calls_result: ToolCallsResult=None,
|
||||
tool_calls_result: ToolCallsResult = None,
|
||||
**kwargs,
|
||||
) -> LLMResponse:
|
||||
if not prompt:
|
||||
|
||||
@@ -162,7 +162,9 @@ class ProviderGoogleGenAI(Provider):
|
||||
{
|
||||
"functionCall": {
|
||||
"name": tool_call["function"]["name"],
|
||||
"args": json.loads(tool_call["function"]["arguments"]),
|
||||
"args": json.loads(
|
||||
tool_call["function"]["arguments"]
|
||||
),
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -204,7 +206,9 @@ class ProviderGoogleGenAI(Provider):
|
||||
llm_response.role = "tool"
|
||||
llm_response.tools_call_args.append(candidate["functionCall"]["args"])
|
||||
llm_response.tools_call_name.append(candidate["functionCall"]["name"])
|
||||
llm_response.tools_call_ids.append(candidate["functionCall"]["name"]) # 没有 tool id
|
||||
llm_response.tools_call_ids.append(
|
||||
candidate["functionCall"]["name"]
|
||||
) # 没有 tool id
|
||||
|
||||
llm_response.completion_text = llm_response.completion_text.strip()
|
||||
return llm_response
|
||||
|
||||
Reference in New Issue
Block a user