Commit graph

16 commits

Author SHA1 Message Date
Max
bdbaf011b2 Implement stream lifecycle events in OpenAI provider
- Added support for stream lifecycle events including stream_start, stream_end, group_start, and group_end.
- Introduced new data structures for handling lifecycle event data, enhancing communication of stream boundaries and metadata.
- Updated the OpenAI provider to track and emit these events during streaming operations, improving UI/UX capabilities.
- Added tests to validate the correct emission and order of lifecycle events during streaming.
2025-11-15 15:32:49 +08:00
Max
f2099babd9 Update Go module dependencies and enhance assistant context management
- Upgraded Go version to 1.25 and updated several dependencies, including `testify` to v1.11.1 and added new indirect dependencies for JSON schema validation.
- Refactored the assistant's context management to utilize a new `context.Uses` structure, improving the handling of vision, audio, search, and fetch configurations.
- Enhanced the assistant's request building process to support new response formats, including JSON schema validation, ensuring better integration with various tools and services.
2025-11-15 10:05:57 +08:00
Max
124bd38f7a Implement global uses configuration and enhance assistant capabilities
- Added global uses configuration to the assistant, allowing for centralized management of vision, audio, search, and fetch settings.
- Updated the Assistant struct and related methods to support the new Uses configuration, improving flexibility in assistant operations.
- Refactored the Stream method to utilize the new CompletionResponse type, enhancing response handling.
- Introduced new methods for building requests and managing capabilities, streamlining the assistant's interaction with various connectors.
2025-11-14 19:17:21 +08:00
Max
889fba942a Enhance testing and context management in assistant operations
- Refactored the Makefile to include new benchmark and memory leak detection tests, improving test coverage.
- Introduced context adjustments in the Create method, allowing hooks to modify context fields such as AssistantID, Connector, Locale, Theme, Route, and Metadata.
- Added a new test scenario to validate context field adjustments, ensuring proper updates during assistant operations.
- Updated test preparation to support optional V8 mode configuration for improved performance during benchmarks.
2025-11-14 12:38:03 +08:00
Max
aa69b693e3 Enhance context handling and metadata management in assistant operations
- Introduced a new test context creation function to streamline test setup for assistant operations.
- Refactored context structure to replace the deprecated 'Data' field with 'Metadata', improving clarity and consistency.
- Updated various methods to utilize the new 'Metadata' field, ensuring proper handling of request metadata across the system.
- Adjusted tests to reflect changes in metadata handling, enhancing validation of context fields in JavaScript integration.
2025-11-14 08:41:40 +08:00
Max
e0f69368fb Refactor assistant creation handling and response types
- Updated the Create method in the Script type to return a structured HookCreateResponse instead of the previous ResponseHookCreate.
- Enhanced the getHookCreateResponse method to handle various response scenarios, including nil and undefined results.
- Refactored context types to introduce the new HookCreateResponse structure, which includes fields for messages, audio configuration, generation parameters, and metadata.
- Adjusted related methods in the Assistant to ensure compatibility with the new response structure.
2025-11-13 18:27:15 +08:00
Max
73f6fae626 Refactor object registration in Context for improved lifecycle management
- Updated the objectRegister method to generate a new ID internally, simplifying the API by removing the need for an external ID parameter.
- Adjusted the NewObject method to utilize the new object registration mechanism, ensuring proper ID assignment and resource cleanup during instance creation.
2025-11-13 14:57:52 +08:00
Max
b13c40e88d Add concurrent testing and object registration for JsValue function
- Implemented TestJsValueConcurrent to validate the JsValue function under concurrent requests, ensuring proper handling of multiple goroutines.
- Added TestJsValueRegistrationAndCleanup to verify the registration and cleanup of context objects, enhancing resource management.
- Introduced object registration and release mechanisms in the Context type to manage JavaScript object lifecycles effectively.
- Utilized sync.Mutex for thread-safe access to shared resources, improving the robustness of concurrent operations.
2025-11-13 14:43:40 +08:00
Max
71698b1405 Add Execute method to Script type for enhanced script execution 2025-11-13 11:42:36 +08:00
Max
9c97035cc6 Refactor Assistant methods and context handling for improved functionality
- Updated the Stream method to return a structured response, including create, done, and completion hooks.
- Introduced new methods for managing message history and building LLM requests, enhancing modularity.
- Refactored the Script type to utilize a new hook structure, improving code organization.
- Removed the obsolete hooks file to streamline the codebase.
- Enhanced context types with additional fields for better integration with LLM models.
2025-11-13 09:26:45 +08:00
Max
27d4cd9555 Refactor context and assistant methods for improved stack management and resource cleanup
- Updated Stream and Run methods in the Assistant to use pointer receivers for context, enhancing performance and clarity.
- Introduced stack management in context handling, including initialization and cleanup of stack references.
- Enhanced the Release method in Context to ensure proper cleanup of resources, including stacks and writer references.
- Added new stack status constants and validation to improve traceability and error handling in agent operations.
- Removed the obsolete JavaScript API file to streamline the codebase.
2025-11-12 11:24:25 +08:00
Max
67ec5516e4 Refactor assistant and context types for clarity and compatibility
- Removed commented-out methods from the API interface in assistant types to enhance code cleanliness.
- Introduced a new Response type in context types, ensuring compatibility with the OpenAI API.
2025-11-11 17:46:45 +08:00
Max
8b690d37bc Refactor completion request handling in context tests
- Renamed and restructured the TestNewOpenAPI function to TestGetCompletionRequest for clarity.
- Updated test cases to validate completion requests using a structured request body instead of query parameters.
- Enhanced error handling and assertions to ensure comprehensive coverage of various scenarios, including metadata handling and expected outputs.
- Removed the obsolete openapi_chat_test.go file to streamline the test suite.
2025-11-11 16:23:22 +08:00
Max
8dca4719c0 Remove deprecated agent API files and refactor agent loading logic
- Deleted obsolete agent API files (agent.go, api.go, api_test.go, types.go) to streamline the codebase.
- Refactored the agent loading logic to initialize the API instance correctly, ensuring proper integration with the new structure.
- Updated context handling to improve clarity and maintainability across the agent's functionality.
- Enhanced error handling and cache management in the agent's initialization process.
2025-11-11 11:23:20 +08:00
Max
1c502bfea8 Refactor context handling in agent API and assistant methods
- Updated context creation in handleChat, handleGenerateTitle, and handleGeneratePrompts to use the request context, improving context management.
- Commented out unused context settings for assistant ID, silent mode, history visibility, and client type to streamline the code.
- Refactored context handling in assistant methods to enhance clarity and maintainability.
- Removed deprecated functions and cleaned up the context structure for better performance and readability.
2025-11-10 17:30:53 +08:00
Max
c54ef71d6a ⚠️ BREAKING: Removed the Studio package and renamed Neo to Agent. Configuration file path changed from neo/neo.yml to agent/agent.yml.
Remove deprecated studio package and refactor agent integration

- Deleted the studio package, which is no longer in use, to streamline the codebase.
- Updated references in the agent and chat modules to utilize the new agent package instead of the deprecated neo package.
- Ensured that all related middleware and routing functionalities are now aligned with the agent architecture, enhancing overall system coherence.
2025-11-06 18:13:54 +08:00