Feature/mapbox migration - #69
Merged
Merged
Conversation
…ates to prevent json parse errors in smaller LLMs
There was a problem hiding this comment.
Pull request overview
This PR continues the Mapbox migration work by refining backend intent/prompt scaffolding and improving robustness of the LLM + routing pipeline.
Changes:
- Updated intent-classification prompt templates to use valid JSON examples.
- Adjusted
/heyroute/handling for empty transcripts and improved error-return consistency in route generation. - Added vLLM model auto-detection for the self-hosted Qwen-compatible endpoint.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| backend/prompts.py | Updates intent prompt JSON templates used for GPT-based intent classification. |
| backend/model.py | Tweaks /heyroute/ control-flow and routing error returns in the core backend service. |
| backend/llm_gpt.py | Adds model auto-detection logic when using the default Qwen model name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
152
to
+156
| Exactly ONE value must be true. | ||
|
|
||
| { | ||
| "preference_remembering": true/false, | ||
| "no_preference_remembering": true/false | ||
| "preference_remembering": false, | ||
| "no_preference_remembering": false |
Comment on lines
171
to
+175
| Exactly ONE value must be true. | ||
|
|
||
| { | ||
| "request_alternates": true/false, | ||
| "select_route": true/false, | ||
| "cancellation": true/false, | ||
| "start_new_trip": true/false | ||
| "request_alternates": false, | ||
| "select_route": false, |
Comment on lines
+215
to
+216
| # Instead of crashing, just return a polite request to speak again | ||
| return {"heyroute": "I didn't catch that. Could you say it again?", "history": state.conversation_history, "turn_number": current_turn, "intents": {}} |
Comment on lines
+28
to
+29
| models_url = QWEN_API_URL.replace("/chat/completions", "/models") | ||
| response = await client.get(models_url, timeout=5.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current working setup with Mapbox implementation.
No road avoidance functionality yet.