mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 10:56:52 +08:00
fix(api/model_runtime/azure/llm): Switch to tool_call. (#5541)
This commit is contained in:
@@ -73,17 +73,15 @@ class MockChatClass:
|
||||
return FunctionCall(name=function_name, arguments=dumps(parameters))
|
||||
|
||||
@staticmethod
|
||||
def generate_tool_calls(
|
||||
tools: list[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[list[ChatCompletionMessageToolCall]]:
|
||||
def generate_tool_calls(tools = NOT_GIVEN) -> Optional[list[ChatCompletionMessageToolCall]]:
|
||||
list_tool_calls = []
|
||||
if not tools or len(tools) == 0:
|
||||
return None
|
||||
tool: ChatCompletionToolParam = tools[0]
|
||||
tool = tools[0]
|
||||
|
||||
if tools['type'] != 'function':
|
||||
if 'type' in tools and tools['type'] != 'function':
|
||||
return None
|
||||
|
||||
|
||||
function = tool['function']
|
||||
|
||||
function_call = MockChatClass.generate_function_call(functions=[function])
|
||||
|
||||
Reference in New Issue
Block a user