services(openai, anthropic): a None result should not run inference
This commit is contained in:
@@ -490,6 +490,7 @@ class AnthropicAssistantContextAggregator(LLMAssistantContextAggregator):
|
||||
if self._function_call_result:
|
||||
frame = self._function_call_result
|
||||
self._function_call_result = None
|
||||
if frame.result:
|
||||
self._context.add_message({
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
|
||||
@@ -399,6 +399,8 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator):
|
||||
try:
|
||||
if self._function_call_result:
|
||||
frame = self._function_call_result
|
||||
self._function_call_result = None
|
||||
if frame.result:
|
||||
self._context.add_message({
|
||||
"role": "assistant",
|
||||
"tool_calls": [
|
||||
@@ -417,7 +419,6 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator):
|
||||
"content": json.dumps(frame.result),
|
||||
"tool_call_id": frame.tool_call_id
|
||||
})
|
||||
self._function_call_result = None
|
||||
run_llm = True
|
||||
else:
|
||||
self._context.add_message({"role": "assistant", "content": aggregation})
|
||||
|
||||
Reference in New Issue
Block a user