Fix tool calls when using Gemini Live + Vertex AI
This commit is contained in:
@@ -16,6 +16,7 @@ import io
|
|||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
import uuid
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Dict, List, Optional, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
@@ -1345,7 +1346,11 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
function_calls_llm = [
|
function_calls_llm = [
|
||||||
FunctionCallFromLLM(
|
FunctionCallFromLLM(
|
||||||
context=self._context,
|
context=self._context,
|
||||||
tool_call_id=f.id,
|
tool_call_id=(
|
||||||
|
# NOTE: when using Vertex AI we don't get server-provided
|
||||||
|
# tool call IDs here
|
||||||
|
f.id or str(uuid.uuid4())
|
||||||
|
),
|
||||||
function_name=f.name,
|
function_name=f.name,
|
||||||
arguments=f.args,
|
arguments=f.args,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user