fix: extraction model + prompt tuning + seed format#169
fix: extraction model + prompt tuning + seed format#169sfreeman422 merged 3 commits intodev-chat:masterfrom
Conversation
…k memories Extraction was using gpt-5.2 via generateText() instead of gpt-4.1-nano. The smart model was extracting memories from casual one-off questions (e.g. "what happened to chuck norris"). Now uses GATE_MODEL directly like selection does. Also strengthened the extraction prompt — NONE is the default, asking a question is not energy, added concrete NONE examples. Seed SQL reformatted to match runtime extraction style. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93d678f to
bf50e99
Compare
Steve will run it separately — doesn't belong in the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| const prompt = MEMORY_EXTRACTION_PROMPT.replace('{existing_memories}', existingMemoriesText); | ||
|
|
||
| const result = await this.openAiService.generateText(extractionInput, 'extraction', prompt); | ||
| const response = await this.openAiService.openai.responses.create({ |
There was a problem hiding this comment.
Don't do this, instead expose a param here on this.openAiService.generateText that optionally lets you control what model to use.
With the pattern you have here, you are accessing what realistically should be a private attribute of the openAiService since itself is another class (the OpenAI lib) which openAIService depends on.
…ng openai client directly Per Steve's review — extraction and selection now use generateText() with an optional model override instead of reaching into openAiService.openai. Web search tools are skipped when using a custom model (gate model doesn't need them). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| model: GPT_MODEL, | ||
| tools: [{ type: 'web_search_preview' }], | ||
| model: model || GPT_MODEL, | ||
| ...(model ? {} : { tools: [{ type: 'web_search_preview' }] }), |
There was a problem hiding this comment.
This might break the tool calling.. Why did Claude do this? Nano doesn't have tool calling or something?
There was a problem hiding this comment.
Right — gpt-4.1-nano doesn't support web_search_preview. It throws an error if you pass tools to it. The conditional skips tools when a custom model is passed (extraction/selection via nano), but keeps them for the default path (GPT-5.2 responses). Extraction and selection don't need web search anyway — they're analyzing conversation text that's already in the prompt.
| .create({ | ||
| model: GPT_MODEL, | ||
| tools: [{ type: 'web_search_preview' }], | ||
| model: model || GPT_MODEL, |
There was a problem hiding this comment.
Instead of this just make the model have a default param. IE: model = GPT_MODEL in the function params
There was a problem hiding this comment.
Then we can always pass model here and it'll either be the default when the caller doesn't pass one in, or it'll be whatever they passed in. Slightly more clean (this is kinda becoming a nit though because we might get rid of this class entirely in the near future if @bajman EVER GETS IT TOGETHER COUGH COUGH AHEM)
Summary
generateText()which hardcodes the response model. Now callsGATE_MODELdirectly like selection already does. This was causing memories to be created from casual one-off questions.Test plan
🤖 Generated with Claude Code