Add settings loading and chat completions logic

Load settings and determine chat completions tool usage based on API type.
This commit is contained in:
RAJVARDHAN 2026-09-15 18:27:15 +05:30 • committed by GitHub
parent 84f4108195
commit f993d9809b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -671,6 +671,12 @@ def build_strix_agent(
instructions_override: Use this verbatim as the system prompt instead
of rendering the built-in scan prompt.
"""
settings = load_settings()
if settings.llm.api_type == "chat_completions":
chat_completions_tools = True
elif settings.llm.api_type == "responses":
chat_completions_tools = False
if instructions_override is not None:
instructions = instructions_override
else:
@ -686,7 +692,6 @@ def build_strix_agent(
agent_tools = [*_EXTRA_TOOLS, *(extra_tools or [])]
if interactive:
# Yielding to the user is only meaningful when one is attached.
agent_tools.append(respond_to_user)
if is_root:
tools: list[Tool] = [*_BASE_TOOLS, *agent_tools, finish_scan]