Merge pull request #291 from ggozad/fix/fix-default-chat-model
Fix chat model, default to config.qa.model
This commit is contained in:
commit
c69ce0caa2
4 changed files with 6 additions and 3 deletions
|
|
@ -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
|
- **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`
|
- **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
|
## [0.32.1] - 2026-02-26
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ from haiku.rag.client import HaikuRAG
|
||||||
from haiku.rag.config import load_yaml_config
|
from haiku.rag.config import load_yaml_config
|
||||||
from haiku.rag.config.models import AppConfig
|
from haiku.rag.config.models import AppConfig
|
||||||
from haiku.rag.skills.rag import AGENT_PREAMBLE, create_skill
|
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 import SkillDeps, SkillToolset
|
||||||
from haiku.skills.prompts import build_system_prompt
|
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])
|
toolset = SkillToolset(skills=[skill])
|
||||||
|
|
||||||
agent = Agent(
|
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),
|
instructions=build_system_prompt(toolset.skill_catalog, preamble=AGENT_PREAMBLE),
|
||||||
toolsets=[toolset],
|
toolsets=[toolset],
|
||||||
deps_type=SkillDeps,
|
deps_type=SkillDeps,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ def run_chat(
|
||||||
|
|
||||||
from haiku.rag.config import get_config
|
from haiku.rag.config import get_config
|
||||||
from haiku.rag.skills.rag import create_skill
|
from haiku.rag.skills.rag import create_skill
|
||||||
|
from haiku.rag.utils import get_model
|
||||||
|
|
||||||
config = get_config()
|
config = get_config()
|
||||||
if db_path is None:
|
if db_path is None:
|
||||||
|
|
@ -37,6 +38,6 @@ def run_chat(
|
||||||
skill=skill,
|
skill=skill,
|
||||||
read_only=read_only,
|
read_only=read_only,
|
||||||
before=before,
|
before=before,
|
||||||
model=model,
|
model=model or get_model(config.qa.model, config),
|
||||||
)
|
)
|
||||||
app.run()
|
app.run()
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ class ChatApp(App):
|
||||||
self._skill = skill
|
self._skill = skill
|
||||||
self.read_only = read_only
|
self.read_only = read_only
|
||||||
self.before = before
|
self.before = before
|
||||||
self._model = model or "openai:gpt-4o"
|
self._model = model
|
||||||
self.client: HaikuRAG | None = None
|
self.client: HaikuRAG | None = None
|
||||||
self.config = get_config()
|
self.config = get_config()
|
||||||
self._toolset: SkillToolset | None = None
|
self._toolset: SkillToolset | None = None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue