- Updated chat API to accept an array of content parts (text and images) in addition to plain text.
- Modified content validation to ensure at least one part is provided.
- Enhanced message processing to handle image data and convert it to a suitable format for the chat engine.
- Added utility functions for extracting text from parts and normalizing content input.
- Updated model response to include the type of model used.
- Improved error handling in the chat engine stream response.
- TopNav: '文档' link only shows when loggedIn
- AgentToolbar: document button v-if="loggedIn"
- getAgentToolsForChatByAgentId: filter tools by agentPublicToolSlugs
whitelist for guest users (previously only skipped adminOnly tools,
exposing document and other non-public tools to unauthenticated users)
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
When a tool-call is in 'approval-responded' state with approved=true but
hasResult=false (approval executed but result not yet available in
approvalToolResults), the code was pushing a tool-call part to the
assistant message without a corresponding tool-result in the tool message.
This caused providers (e.g. deepseek) to reject the prompt with
'Tool result is missing for tool call' or
'Invalid prompt: The messages do not match the ModelMessage[] schema'.
Fix: only push tool-approval-request (not tool-call) when hasResult=false.
Also clean up approval-requested branch to only include required fields
(type, approvalId, toolCallId) per AI SDK schema.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- Implemented color tool with operations for conversion, random color generation, color info, mixing, and contrast detection.
- Added dice tool supporting rolling dice, coin flipping, item picking, and rock-paper-scissors.
- Introduced hashing tool for computing and comparing hash values using various algorithms.
- Created magic 8-ball tool for answering yes/no questions and providing daily fortunes.
- Defined configuration schemas and input validation for each tool using Zod.
- Registered new tools in the agent tool registry with appropriate default configurations and input schemas.
- Remove ChatWidget component from app.vue
- Update index.vue to ensure flex layout accommodates new design
- Add systemPrompt field to agentSessions table in the database
- Modify createSession and updateSession services to support systemPrompt
- Enhance API endpoints to accept and update systemPrompt
- Adjust chat engine to prioritize session-level systemPrompt over agent default
- Extend AgentSessionItem interface to include systemPrompt
- Revamp AgentSystemPromptModal to allow editing of systemPrompt
- Integrate editable system prompt functionality in AgentToolbar and chat page
- Add E2E tests for session-level system prompt functionality
- Update design document to reflect new system prompt capabilities
- Added supportsTools field to LLM models in various API endpoints.
- Updated model creation and update functions to handle supportsTools.
- Modified chat and agent APIs to utilize supportsTools for tool management.
- Enhanced error handling and validation for new field in relevant endpoints.
- Updated migration journal to include new model version for supportsTools.
- Added hasPendingApproval prop to AgentChatArea for managing tool approval state.
- Updated AgentInput to show a placeholder when disabled due to pending approvals.
- Modified AgentMessageItem to handle feedback and actions based on approval status.
- Enhanced AgentMessageList to manage scrolling behavior during loading states.
- Introduced cleanup-approvals API to handle stale tool approvals.
- Updated useAgentChat composable to manage tool approval logic and state.
- Enhanced chat API to support tool approval responses and continue conversation after approval.
- Refactored agent tool fetching logic to remove unnecessary approval configurations.
- Improved session message handling to support new message parts structure.
- Updated agent configuration page to include a title generation model for guest users.
- Added a new preferences page for users to set their preferred LLM model.
- Implemented loading and saving functionality for user preferences.
- Introduced new API endpoints for guest users to access models and system prompts.
- Enhanced model loading logic to accommodate guest users and their default models.
- Improved error handling and user feedback for model saving operations.
- Added search tool executor with support for Bing, Baidu, and Google.
- Implemented parsing logic for search results from different engines.
- Updated session management to utilize user-specific model preferences.
- Added adminOnly field to CreateAgentToolInput and UpdateAgentToolInput interfaces.
- Updated API endpoints to handle adminOnly field in agent tools.
- Modified getEnabledToolInfos and getEnabledToolsForLlm functions to filter tools based on user role.
- Enhanced the chat tools API to retrieve enabled tools considering user roles.
- Updated migration journal to include new patch for adminOnly feature.
- Implemented datetime executor with operations for current time retrieval, formatting, parsing, time difference calculation, time addition, and timezone conversion.
- Added json formatter executor supporting formatting, minifying, validating, and extracting fields from JSON strings.
- Introduced regex tester executor for matching, testing, replacing, and extracting matches from input text using regular expressions.
- Created uuid executor for generating UUIDs, random strings, and random integers with configurable options.
- Updated agent tool registration to include new executors and their configurations.
- Enhanced input validation and error handling across all new executors.
- Removed "json-schema-to-zod" from dependencies in package.json.
- Deleted the register.ts file from the agent-tool service as it is no longer needed.
- Updated the db.sqlite binary file in drizzle-pkg.
- Added @ai-sdk/openai dependency to package.json and bun.lock
- Implemented chat index endpoint to handle user messages and stream responses from OpenAI
- Created models endpoint to retrieve active LLM providers and their models for the authenticated user
- Updated drizzle-pkg database with a new SQLite file
- Implemented GET, POST, PUT, and DELETE endpoints for managing LLM models and providers.
- Added user authorization checks to ensure only authorized users can access or modify resources.
- Enhanced provider and model retrieval functions to include user-specific data.
- Updated database service functions to handle user IDs for better data isolation.
- Introduced error handling for invalid inputs and unauthorized actions.