Update service to interface with AI agents /insight/iteneraries endpoint#49
Closed
Copilot wants to merge 4 commits into
Closed
Update service to interface with AI agents /insight/iteneraries endpoint#49Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Co-authored-by: zlendo1 <115471708+zlendo1@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Change endpoint and schemas for /insight/iteneraries
Add /insight/iteneraries endpoint for batch itinerary insights
Nov 5, 2025
Contributor
|
@copilot The /api/v1/insight/iteneraries endpoint doesn't exist in the backend. Rather, it is provided by the Commute-ai/commute-ai-agents server and only interfaced to by the backend through HTTP. |
…rrectly Co-authored-by: zlendo1 <115471708+zlendo1@users.noreply.github.com>
Contributor
Author
You're absolutely right. I've corrected the implementation in commit 8931feb. The backend now only interfaces with the AI agents server via HTTP - it doesn't expose
The routes endpoint continues to work as before, but now uses the updated service method that calls the AI agents server. |
Copilot
AI
changed the title
Add /insight/iteneraries endpoint for batch itinerary insights
Update service to interface with AI agents /insight/iteneraries endpoint
Nov 5, 2025
Contributor
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.
Updates the backend service layer to interface with the AI agents server's
/api/v1/insight/itenerariesendpoint for getting insights on multiple itineraries at once.Changes
Schema updates (
app/schemas/ai_agents.py):ItineraryInsightRequest:itineraries: List[Itinerary],user_preferences: List[PreferenceBase]ItineraryInsightResponse:itenerary_insights: List[ItineraryInsight]ItineraryInsight:ai_insight: str,leg_insights: List[LegInsight]LegInsight:ai_insight: strService updates (
app/services/ai_agents_service.py):get_itinerary_insight()to wrap the new batch APIget_itineraries_insight()that calls AI agents server at/api/v1/insight/itenerariesHow It Works
The backend acts as an intermediary that interfaces with the AI agents server:
/api/v1/routes/search)get_itinerary_insight()for each itinerary/api/v1/insight/itenerariesAI Agents API Contract
Note: The backend does NOT expose
/api/v1/insight/itenerariesas a user-facing endpoint. It only interfaces with the AI agents server via HTTP. Spelling (iteneraries,itenerary_insights) matches the external AI agents API specification.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.