Fix default chat model, default to config.qa.model

This commit is contained in:
Yiorgis Gozadinos 2026-02-28 14:00:40 +02:00
parent 9acb04d915
commit 52ef983e75
No known key found for this signature in database
4 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,7 @@
- **Compatibility with haiku.skills 0.5.1**: Replaced removed `SkillToolset.system_prompt` with `build_system_prompt(toolset.skill_catalog)` across chat TUI, backend app, and examples
- **Minimum dependency**: Bumped `haiku.skills` requirement to `>=0.5.1`
- **Chat model default**: Chat TUI and backend app now use the configured QA model instead of hardcoded `openai:gpt-4o`
## [0.32.1] - 2026-02-26

View file

@ -17,6 +17,7 @@ from haiku.rag.client import HaikuRAG
from haiku.rag.config import load_yaml_config
from haiku.rag.config.models import AppConfig
from haiku.rag.skills.rag import AGENT_PREAMBLE, create_skill
from haiku.rag.utils import get_model
from haiku.skills import SkillDeps, SkillToolset
from haiku.skills.prompts import build_system_prompt
@ -68,7 +69,7 @@ skill = create_skill(db_path=db_path, config=Config)
toolset = SkillToolset(skills=[skill])
agent = Agent(
os.getenv("HAIKU_CHAT_MODEL", "openai:gpt-4o"),
get_model(Config.qa.model, Config),
instructions=build_system_prompt(toolset.skill_catalog, preamble=AGENT_PREAMBLE),
toolsets=[toolset],
deps_type=SkillDeps,

View file

@ -25,6 +25,7 @@ def run_chat(
from haiku.rag.config import get_config
from haiku.rag.skills.rag import create_skill
from haiku.rag.utils import get_model
config = get_config()
if db_path is None:
@ -37,6 +38,6 @@ def run_chat(
skill=skill,
read_only=read_only,
before=before,
model=model,
model=model or get_model(config.qa.model, config),
)
app.run()

View file

@ -102,7 +102,7 @@ class ChatApp(App):
self._skill = skill
self.read_only = read_only
self.before = before
self._model = model or "openai:gpt-4o"
self._model = model
self.client: HaikuRAG | None = None
self.config = get_config()
self._toolset: SkillToolset | None = None