Commit Graph

6 Commits

Author SHA1 Message Date
Manmohan Sharma
8b360f5bc8
fix: veto matches shorthand 'u' and 'r' for you/are 2026-04-22 16:10:59 -07:00
Manmohan Sharma
bd37163138
fix: auto-inject calculator tool call on arithmetic in user message
needs_calculator now extracts the actual expression from: bare arithmetic (900+100), verbal math (900 plus 100), percentage (17% tip on 45), with comma-stripping and whitespace normalization. serve.py wires it into the force-prefix path parallel to web_search — if no web-search trigger, check calculator, pre-seed real tool call + result so the model sees the grounded answer in context.
2026-04-22 16:04:26 -07:00
Manmohan Sharma
2e5cf45f86
fix(classifier): resolve pronouns from conversation history + roadmap
Adds needs_web_search_contextual(messages) that picks the subject from the most recent user turn and replaces him/her/it in the current query. Vetoes when prior turns were about identity. Also adds TRAINING_ROADMAP.md — six-phase plan (tokens redacted).
2026-04-22 15:43:57 -07:00
Manmohan Sharma
fd8e10a820
fix(classifier): expand identity veto to cover all self-introspection queries
Added patterns for: tell me about yourself / you / about you, what do/can you do, what are your capabilities / skills, how do you work, what are you good at, what's your purpose / story / mission, where did you come from, how were you built, are you an AI / chatbot / language model, model meta (model/version/context/training cutoff), creator socials (github/linkedin/twitter), and more writing tasks (song, joke). All 27 identity cases now short-circuit without hitting Tavily.
2026-04-22 15:25:33 -07:00
Manmohan Sharma
5e3b17e990
fix(classifier): veto identity/meta/greeting/writing queries from web_search
The heuristic classifier was triggering web_search on 'who is your creator', 'who is manmohan sharma', 'who created you' etc — which returned irrelevant Tavily results (Tyler the Creator, Waaree CFO) when the model's SFT training already has the correct grounded identity answer. Added _IDENTITY_VETO_PATTERNS covering: self-referential questions, creator/maker/developer queries, competitor/provenance attacks (are you chatgpt/made by openai), samosaChaat/Manmohan name references, meta-questions (parameters/architecture/training/open source), greetings (hi/hello/hey), small talk, and writing/reasoning tasks that the model answers from memory. Veto runs before all positive classification.
2026-04-22 15:24:08 -07:00
Manmohan Sharma
4628d53d67
fix(tools): force web_search on tool-worthy queries + strip orphan markers in UI
Adds modal/_query_classifier.py with regex patterns covering time-sensitive queries (current/present/latest/today/weather/CEO/president/stock/news/sports/etc). Modal serve.py classifies each user message and, when it matches, pre-seeds the assistant turn with a real Tavily-backed tool call + result — so 'whos the present president' now triggers web_search the same as 'current president'. Also tightens the post-injection break to fire on any leaked tool marker. UI: MessageBubble.tsx now strips orphan close-tags (<|output_end|> without an open), dedupes consecutive identical tool-result blocks, and removes fragment markers from text segments so they don't leak into the message body.
2026-04-22 15:01:07 -07:00