Skip to content

Commit 16d4a1c

Browse files
authored
Add fallback if end_call tool is not properly called in text flow (#19)
2 parents 9f2366b + 93a2c3e commit 16d4a1c

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dependencies = [
5454
"jaconv>=0.3.0",
5555
"regex>=2023.0.0",
5656
"more-itertools>=10.0.0",
57-
"nvidia-riva-client>=2.25.0,<3.0.0"
57+
"nvidia-riva-client>=2.25.0,<2.25.1"
5858
]
5959

6060
[project.optional-dependencies]

scripts/run_text_only.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ async def run_user_turn(
220220
return content, True
221221

222222
content = getattr(response, "content", "") or (response if isinstance(response, str) else "")
223+
224+
# Fallback: detect end_call emitted as text instead of structured tool call.
225+
if "functions.end_call" in content or ("end_call" in content and content.strip().startswith(("{", "[", "<"))):
226+
return "", True
227+
223228
return content, False
224229

225230

@@ -778,9 +783,9 @@ async def main() -> None:
778783
if not tool_module:
779784
sys.exit("Error: tool_module_path not set in agent YAML config.")
780785

781-
llm_model = args.llm_model or os.getenv("LLM_MODEL")
786+
llm_model = args.llm_model or os.getenv("EVA_MODEL__LLM")
782787
if not llm_model:
783-
sys.exit("Error: --llm-model or LLM_MODEL env var is required.")
788+
sys.exit("Error: --llm-model or EVA_MODEL__LLM env var is required.")
784789

785790
# Initialize the LiteLLM Router from EVA_MODEL_LIST
786791
model_list_json = os.getenv("EVA_MODEL_LIST")

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)