mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 08:08:48 +02:00
Use Responses API with Luna by default
This commit is contained in:
@@ -23,4 +23,4 @@ VAPID_PUBLIC_KEY=
|
||||
|
||||
# ── AI agent (optional in dev; Asistente won't work without it) ──────────────
|
||||
OPENAI_API_KEY=
|
||||
AGENT_MODEL=gpt-5.4-mini
|
||||
AGENT_MODEL=gpt-5.6-luna
|
||||
|
||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
VAPID_PRIVATE_KEY=${{ secrets.VAPID_PRIVATE_KEY }}
|
||||
VAPID_PUBLIC_KEY=${{ secrets.VAPID_PUBLIC_KEY }}
|
||||
OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}
|
||||
AGENT_MODEL=gpt-5.4-mini
|
||||
AGENT_MODEL=gpt-5.6-luna
|
||||
ENVEOF
|
||||
sed -i 's/^[[:space:]]*//' .env.prod
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from agent_framework import Agent
|
||||
from agent_framework.openai import OpenAIChatCompletionClient
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
|
||||
from app.config import settings
|
||||
from app.agent.tools import TOOLS
|
||||
@@ -83,7 +83,9 @@ Generative UI — render tools:
|
||||
|
||||
|
||||
def build_agent() -> Agent:
|
||||
client = OpenAIChatCompletionClient(
|
||||
# Use the Responses API for every configured model. It preserves one tool
|
||||
# transport across model changes and supports Luna's tool-result turns.
|
||||
client = OpenAIChatClient(
|
||||
api_key=settings.OPENAI_API_KEY,
|
||||
model=settings.AGENT_MODEL,
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ class Settings(BaseSettings):
|
||||
VAPID_PUBLIC_KEY: str = ""
|
||||
VAPID_CLAIM_EMAIL: str = "mailto:admin@wealth.cescalante.dev"
|
||||
OPENAI_API_KEY: str = ""
|
||||
AGENT_MODEL: str = "gpt-5.4-mini"
|
||||
AGENT_MODEL: str = "gpt-5.6-luna"
|
||||
|
||||
@property
|
||||
def cors_origins_list(self) -> list[str]:
|
||||
|
||||
14
backend/tests/test_agent_config.py
Normal file
14
backend/tests/test_agent_config.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Assistant transport configuration."""
|
||||
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
|
||||
from app.agent import agent as agent_module
|
||||
|
||||
|
||||
def test_agent_uses_responses_client_for_the_configured_model(monkeypatch):
|
||||
monkeypatch.setattr(agent_module.settings, "AGENT_MODEL", "gpt-5.6-luna")
|
||||
|
||||
agent = agent_module.build_agent()
|
||||
|
||||
assert isinstance(agent.client, OpenAIChatClient)
|
||||
assert agent.client.model == "gpt-5.6-luna"
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY}
|
||||
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
||||
AGENT_MODEL: ${AGENT_MODEL:-gpt-5.4-mini}
|
||||
AGENT_MODEL: ${AGENT_MODEL:-gpt-5.6-luna}
|
||||
# MAF 1.6+ enables OTel instrumentation by default; keep it off explicitly.
|
||||
ENABLE_INSTRUMENTATION: "false"
|
||||
expose:
|
||||
|
||||
@@ -30,7 +30,7 @@ services:
|
||||
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
|
||||
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
|
||||
AGENT_MODEL: ${AGENT_MODEL:-gpt-5.4-mini}
|
||||
AGENT_MODEL: ${AGENT_MODEL:-gpt-5.6-luna}
|
||||
# MAF 1.6+ enables OTel instrumentation by default; keep it off explicitly.
|
||||
ENABLE_INSTRUMENTATION: "false"
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user