Commit Graph

6 Commits

  • Add FixCLIToolResponse for enhanced function call-response mapping
    - Introduced `FixCLIToolResponse` in `translator` to group function calls with corresponding responses.
    - Updated Gemini handlers to integrate new function for improved response handling.
    - Enhanced error handling in case response mapping fails.
  • Enhance response and request handling in translators
    - Refactored response handling to process multiple content parts effectively.
    - Improved `tool_calls` structure with unique ID generation and enhanced mapping logic.
    - Simplified `SystemInstruction` and tool message parsing in requests for better accuracy.
    - Enhanced handling of function calls and tool responses with improved data integration.
  • Add system instruction support and enhance internal API handlers
    - Introduced `SystemInstruction` field in `PrepareRequest` and `GenerateContentRequest` for better message parsing.
    - Updated `SendMessage` and `SendMessageStream` to handle system instructions in client API calls.
    - Enhanced error handling and manual flushing logic in response flows.
    - Added new internal API endpoints `/v1internal:generateContent` and `/v1internal:streamGenerateContent`.
    - Improved proxy handling and transport logic in HTTP client initialization.
  • Add support for Generative Language API Key and improve client initialization
    - Added `GlAPIKey` support in configuration to enable Generative Language API.
    - Integrated `GenerativeLanguageAPIKey` handling in client and API handlers.
    - Updated response translators to manage generative language responses properly.
    - Enhanced HTTP client initialization logic with proxy support for API requests.
    - Refactored streaming and non-streaming flows to account for generative language-specific logic.
  • Refactor API request flow and streamline response handling
    - Replaced `SendMessageStream` with synchronous `SendMessage` in API handlers for better manageability.
    - Simplified `ConvertCliToOpenAINonStream` to reduce complexity and improve efficiency.
    - Adjusted `client.go` functions to handle both streaming and non-streaming API requests more effectively.
    - Improved error handling and channel communication in API handlers.
    - Removed redundant and unused code for cleaner implementation.