Skip to content

Fix/nlp conditional parsing 17668343675982894612#233

Merged
GauravKarakoti merged 4 commits intoGauravKarakoti:mainfrom
navin-oss:fix/nlp-conditional-parsing-17668343675982894612
Feb 18, 2026
Merged

Fix/nlp conditional parsing 17668343675982894612#233
GauravKarakoti merged 4 commits intoGauravKarakoti:mainfrom
navin-oss:fix/nlp-conditional-parsing-17668343675982894612

Conversation

@navin-oss
Copy link
Contributor

Improved the NLP parsing logic to correctly identify conditional swaps (e.g., "only if price > 60k") and percentage-based amounts. This includes extending the parser schema, updating the LLM prompt, adding regex fallbacks with unit support (k/m), and implementing a safety guard to prevent accidental execution of these new conditional commands until fully automated. Verified with new test cases.

navin-oss and others added 2 commits February 17, 2026 22:54
…897033629532608424

Deterministic Boot and Health Check for Bot
- Extended `ParsedCommand` schema in `groq-client.ts` to include `conditions` object and updated `amountType`.
- Improved LLM system prompt to extract conditions like "only if" and "above/below".
- Implemented `normalizeNumber` helper in `parseUserCommand.ts` to handle 'k'/'m' suffixes and strip `$` characters.
- Added regex fallback logic in `parseUserCommand.ts` to catch conditions missed by LLM.
- Updated `REGEX_CONDITION` to support 'k'/'m' suffixes in deterministic parsing.
- Added safety check in `bot.ts` to prevent automated execution of conditional swaps for now.
- Added new test file `bot/src/tests/conditional-parsing.test.ts` to verify new parsing logic.

Co-authored-by: navin-oss <181780004+navin-oss@users.noreply.github.com>
@vercel
Copy link
Contributor

vercel bot commented Feb 17, 2026

@google-labs-jules[bot] is attempting to deploy a commit to the Gaurav's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for swapsmithminiapp canceled.

Name Link
🔨 Latest commit aa11cda
🔍 Latest deploy log https://app.netlify.com/projects/swapsmithminiapp/deploys/6995c510a1269100085f1ab1

@GauravKarakoti
Copy link
Owner

Good work @navin-oss

@GauravKarakoti GauravKarakoti merged commit 860fa90 into GauravKarakoti:main Feb 18, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments