Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/agora_agent/agentkit/vendors/mllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,12 @@ def to_config(self) -> Dict[str, Any]:

config: Dict[str, Any] = {
"vendor": "vertexai",
"url": self.options.url if self.options.url is not None else "",
"project_id": self.options.project_id,
"location": self.options.location,
"adc_credentials_string": self.options.adc_credentials_string,
"params": params,
}

if self.options.url is not None:
config["url"] = self.options.url
if self.options.greeting_message is not None:
config["greeting_message"] = self.options.greeting_message
if self.options.input_modalities is not None:
Expand Down Expand Up @@ -253,11 +251,9 @@ def to_config(self) -> Dict[str, Any]:
config: Dict[str, Any] = {
"vendor": "gemini",
"api_key": self.options.api_key,
"url": self.options.url if self.options.url is not None else "",
"params": params,
}

if self.options.url is not None:
config["url"] = self.options.url
if self.options.greeting_message is not None:
config["greeting_message"] = self.options.greeting_message
if self.options.input_modalities is not None:
Expand Down
24 changes: 24 additions & 0 deletions tests/custom/test_agentkit_vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ def test_vertex_ai_explicit_fields_override_additional_params():
assert config["params"]["extra_key"] == "kept"


def test_vertex_ai_defaults_url_to_empty_string():
from agora_agent.agentkit.vendors import VertexAI

config = VertexAI(
model="gemini-live-2.5-flash",
project_id="project-id",
location="us-central1",
adc_credentials_string="{}",
).to_config()

assert config["url"] == ""


def test_gemini_live_explicit_fields_override_additional_params():
from agora_agent.agentkit.vendors import GeminiLive

Expand All @@ -135,6 +148,17 @@ def test_gemini_live_explicit_fields_override_additional_params():
assert config["params"]["extra_key"] == "kept"


def test_gemini_live_defaults_url_to_empty_string():
from agora_agent.agentkit.vendors import GeminiLive

config = GeminiLive(
api_key="key",
model="gemini-live-2.5-flash",
).to_config()

assert config["url"] == ""


def test_llm_greeting_configs_interruptable_serializes():
config = OpenAI(
api_key="openai-key",
Expand Down
2 changes: 2 additions & 0 deletions tests/custom/test_request_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,7 @@ def test_byok_gemini_live_mllm_params() -> None:
props = build_properties(agent)
assert props["mllm"]["vendor"] == "gemini"
assert props["mllm"]["api_key"] == "gemini-key"
assert props["mllm"]["url"] == ""
assert props["mllm"]["params"]["model"] == "gemini-live-2.5-flash"


Expand All @@ -1270,6 +1271,7 @@ def test_byok_vertex_ai_mllm_params() -> None:
)
props = build_properties(agent)
assert props["mllm"]["vendor"] == "vertexai"
assert props["mllm"]["url"] == ""
assert props["mllm"]["project_id"] == "my-project"
assert props["mllm"]["location"] == "us-central1"
assert props["mllm"]["adc_credentials_string"] == "{}"
Expand Down
Loading