Commit Graph

26 Commits

Author SHA1 Message Date
steve ff5e4ca7b0 Add support for integers and tool configuration in schema handling
This update introduces support for `jsonschema.Integer` types and updates the logic to handle nested items in schemas. Added a new default error log for unknown types using `slog.Error`. Also, integrated tool configuration with a `FunctionCallingConfig` when `dontRequireTool` is false.
2025-04-04 20:13:46 -04:00
steve 82feb7d8b4 Change function result type from string to any
Updated the return type of functions and related code from `string` to `any` to improve flexibility and support more diverse outputs. Adjusted function implementations, signatures, and handling of results accordingly.
2025-03-25 23:53:09 -04:00
steve 5ba42056ad Add toolbox features for function removal and callback execution
Introduced `WithFunctionRemoved` and `ExecuteCallbacks` methods to enhance `ToolBox` functionality. This allows dynamic function removal and execution of custom callbacks during tool call processing. Also cleaned up logging and improved handling for required tools in `openai.go`.
2025-03-21 11:09:32 -04:00
steve 52533238d3 Add getter methods for response and toolcall in Context
Introduce `Response()` and `ToolCall()` methods to access the respective fields from the `Context` struct. This enhances encapsulation and provides a standardized way to retrieve these values.
2025-03-18 03:45:38 -04:00
steve 88fbf89a63 Fix handling of OpenAI messages with content and multi-content.
Previously, OpenAI messages containing both `Content` and `MultiContent` could cause inconsistent behavior. This update ensures `Content` is converted into a `MultiContent` entry to maintain compatibility.
2025-03-18 01:01:46 -04:00
steve e5a046a70b Handle execution errors by appending them to the result.
Previously, execution errors were only returned in the refusal field. This update appends errors to the result field if present, ensuring they are included in the tool's output. This change improves visibility and clarity for error reporting.
2025-03-17 23:41:48 -04:00
steve 2737a5b2be Refactor response handling for clarity and consistency.
Simplified how responses and tool calls are appended to conversations. Adjusted structure in message formatting to better align with tool call requirements, ensuring consistent data representation.
2025-03-17 00:18:32 -04:00
steve 7f5e34e437 Refactor entire system to be more contextual so that conversation flow can be more easily managed 2025-03-16 22:38:58 -04:00
steve 0d909edd44 Refactor Google LLM adapter to support tool schemas.
Enhanced the `requestToChatHistory` method to include OpenAI schema conversion logic and integrate tools with generative AI schemas. This change improves flexibility when working with different schema types and tool definitions. Adjusted response handling to return a modified model alongside chat sessions and parts.
2025-01-22 23:56:20 -05:00
steve 388a44fa79 Refactor Google LLM API to use chat session interface.
Replace message handling with a chat session model, aligning the logic with new API requirements. Adjust functions to properly build chat history and send messages via chat sessions, improving compatibility and extensibility.
2025-01-22 22:07:20 -05:00
steve e7b7aab62e Refactor Toolbox handling in Google LLM integration.
Implemented a nil check for Toolbox to prevent potential nil pointer dereferences. Cleaned up and reorganized code for better readability and maintainability while keeping placeholder functionality intact.
2025-01-22 19:49:37 -05:00
steve 0d70ec46de Fix role setting for assistant-sent images in Anthropic API
Anthropic API does not support assistants sending images directly, so the role is adjusted to "user" for such messages. This ensures compatibility and prevents errors when processing image messages.
2025-01-09 01:18:11 -05:00
steve 6e2b5a33c0 fix anthropic 2024-12-29 19:45:28 -05:00
steve dfb768d966 make toolbox optional 2024-12-28 20:39:57 -05:00
steve 46a526fd5a Merge branch 'main' of ssh://nuc.dudenhoeffer.casa:222/steve/go-llm 2024-12-28 19:49:26 -05:00
Steve Dudenhoeffer 0b06fd965e updated anthropic 2024-12-26 22:51:16 -05:00
steve 0993a8e865 Fix unmarshalling issues and adjust logging for debugging
Modify `FunctionCall` struct to handle arguments as strings. Add debugging logs to facilitate error tracing and improve JSON unmarshalling in various functions.
2024-11-11 00:23:01 -05:00
Steve Dudenhoeffer cd4ad59a38 sync of changes 2024-11-09 19:50:14 -05:00
steve 37939088ed initial commit of untested function stuff 2024-11-08 20:53:12 -05:00
steve f603010dee support o1 models not allowing system prompts 2024-10-31 11:21:03 -04:00
steve c4f4f6abe6 if an openai message has content and multicontent, fix it before passing it off to the api 2024-10-20 21:50:12 -04:00
steve b8dc1d1a96 changed the way images are passed 2024-10-07 16:33:57 -04:00
steve 8e1001b5b7 enforce anthropic's required alternating user/assistant roles 2024-10-07 14:38:23 -04:00
steve 09447b0424 add google gemini support 2024-10-06 22:16:26 -04:00
steve f4214f656b push of current changes 2024-10-06 21:02:26 -04:00
Steve Dudenhoeffer a67ad54bcc initial commit 2024-10-06 20:01:01 -04:00