Skip to content

Conversation

teetangh
Copy link
Collaborator

@teetangh teetangh commented Sep 15, 2025

refactor: streamline flight search agent by removing unused imports and simplifying tool integration

  • Removed unnecessary imports to clean up the codebase.
  • Simplified the tool integration process by leveraging the base class methods for creating the ReAct agent, enhancing maintainability.
  • Updated the invocation logic to directly use the agent's response, improving clarity and efficiency in handling flight search queries.

…nd simplifying tool integration

- Removed unnecessary imports to clean up the codebase.
- Simplified the tool integration process by leveraging the base class methods for creating the ReAct agent, enhancing maintainability.
- Updated the invocation logic to directly use the agent's response, improving clarity and efficiency in handling flight search queries.
gemini-code-assist[bot]

This comment was marked as outdated.

@teetangh teetangh changed the title (refactor) streamline flight search agent by removing unused imports and simplifying tool integration (fix) agentc tools usage Sep 15, 2025
gemini-code-assist[bot]

This comment was marked as outdated.

@teetangh teetangh self-assigned this Sep 15, 2025
@teetangh teetangh marked this pull request as draft September 15, 2025 20:06
…eters

- Removed the 'span' parameter from the create_llamaindex_agent function, streamlining its signature.
- Updated the agent creation logic to use 'context' for the system prompt, aligning with the latest API requirements.
- Enhanced code clarity by improving comments and maintaining the verbose logging for debugging purposes.
- Introduced `CapellaCompatibleToolNode` and `CapellaCompatibleChatModel` to ensure compatibility with Capella AI by handling tool arguments and disabling function calling.
- Updated the `create_react_agent` method to utilize traditional ReAct format, improving integration with the Agent Catalog.
- Enhanced input cleaning and error handling for tool interactions, ensuring robust performance during flight search queries.
- Added logging for better traceability of tool execution and error reporting.
- Enhanced error logging by providing more descriptive tool names when adding tools from the Agent Catalog.
- Streamlined prompt content handling by directly using Agent Catalog variables, improving clarity and reducing fallbacks.
- Added detailed debug logging for prompt content, including variable replacements and final prompt inspection.
- Saved the final prompt to a temporary file for easier inspection and debugging.
- Removed unnecessary logging statements related to tool calls and prompt inspections to streamline the code.
- Enhanced clarity by focusing on essential functionality without excessive debug output.
- Maintained core functionality while improving overall readability and maintainability of the flight search agent.
…ling

- Removed the `CapellaCompatibleToolNode` and associated methods to simplify the tool integration process.
- Updated the `create_react_agent` method to utilize the Agent Catalog's native approach, enhancing maintainability and clarity.
- Improved logging for agent execution, providing comprehensive insights into the flight search process and responses.
- Cleaned up unused imports and redundant code, resulting in a more efficient and readable codebase.
…and logging

- Updated the `create_react_agent` method to utilize Agent Catalog's built-in tool discovery, simplifying the tool management process.
- Enhanced logging for tool addition and agent execution, providing clearer insights into the agent's operations.
- Replaced the `CouchbaseVectorStore` with `CouchbaseSearchVectorStore` for improved functionality.
- Streamlined response handling to better track tool outputs and final responses, ensuring robust performance during flight searches.
… input sanitization

- Removed the `CapellaCompatibleChatModel` to simplify the chat model integration.
- Updated the `_invoke` method to streamline tool discovery and enhance input handling for flight search queries.
- Implemented robust input sanitization to clean up user inputs and improve tool execution reliability.
- Enhanced logging for tool execution and error handling, providing clearer insights into the agent's operations.
…oved booking handling

- Integrated structured output schema for the flight search assistant, enhancing response clarity and usability.
- Refactored the `save_flight_booking` function to accept detailed parameters, improving input validation and error handling.
- Streamlined booking confirmation process with clearer messaging and robust validation checks for passenger details and flight class.
- Removed redundant code and improved logging for better traceability during booking operations.
…nse handling

- Added detailed logging for agent responses, including full agent responses and final messages, to improve traceability.
- Streamlined the extraction of final messages from agent responses, ensuring clarity in user interactions.
- Removed redundant structured response checks, simplifying the response handling process.
- Updated the prompt handling to ensure consistent and clear communication of agent actions and results.
… improved response handling

- Added a new method `_extract_tool_results` to streamline the extraction of tool results from agent messages for production display.
- Updated the `_invoke` method to utilize extracted tool results instead of conversational responses, improving clarity in user interactions.
- Implemented fallback logic to ensure that if no tool results are found, the last AI message is used, maintaining robustness in response handling.
- Enhanced logging to provide clearer insights into the tool results and agent responses during flight searches.
- Updated logging to display full tool results for better visibility during production.
- Adjusted review result formatting to retain complete content for tutorial displays, enhancing user experience.
- Streamlined the code for clarity and maintainability while ensuring robust response handling.
- Introduced a new method `_get_tool_names` to dynamically retrieve available tool names, enhancing flexibility in tool usage.
- Updated the `_extract_tool_results` method to find the first successful tool message, improving the accuracy of displayed results.
- Enhanced the flight search assistant prompt to clarify its capabilities and provide examples of user interactions.
- Improved date validation in the `save_flight_booking` function to allow bookings for today and future dates, ensuring better user experience.
- Added comprehensive logging for booking parameters and tool results to facilitate debugging and traceability.
- Updated flight booking IDs and departure dates in the queries to reflect accurate information.
- Improved input validation in the `parse_booking_query` function to handle various empty input scenarios more robustly.
- Enhanced date validation in the `save_flight_booking` function to ensure correct date formats and prevent past date bookings.
- Refined passenger and flight class parsing to accommodate more flexible input formats, improving user experience.
- Adjusted review formatting to display full content for comprehensive insights, removing previous character limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant