- 24 Dec, 2024 8 commits
-
-
Yan committed
-
Yan committed
-
- Updated the GetPricing function in the backend to include user group information, allowing for dynamic adjustment of group ratios based on the user's group. - Implemented logic to filter group ratios based on the user's usable groups, improving the accuracy of pricing data returned. - Modified the ModelPricing component to utilize the new usable group data, ensuring only relevant groups are displayed in the UI. - Enhanced state management in the frontend to accommodate the new usable group information, improving user experience and data consistency.
CalciumIon committed -
- Added new translation keys for English localization in `en.json`, including "Token group, default is the your's group" and "IP whitelist (do not overly trust this function)". - Refactored `EditToken.js` to utilize the `useTranslation` hook for improved internationalization, ensuring all user-facing strings are translatable. - Updated error and success messages to use translation functions, enhancing user experience for non-English speakers. - Improved UI elements to support localization, including labels, placeholders, and button texts, ensuring consistency across the token editing interface.
CalciumIon committed -
- Introduced a new `FetchModels` endpoint to retrieve model IDs from a specified base URL and API key, enhancing flexibility for different channel types. - Refactored `FetchUpstreamModels` to simplify base URL handling and improve error messages during response parsing. - Updated API routes to include the new endpoint and adjusted the frontend to utilize the new fetch mechanism for model lists. - Removed outdated checks for channel type in the frontend, streamlining the model fetching process.
CalciumIon committed -
- Added mobile-specific date pickers for start and end timestamps in the LogsTable component, improving user experience on mobile devices. - Updated the input handling for date values to ensure valid date formats are maintained. - Introduced a new translation key for "时间范围" (Time range) in the English locale file to support localization efforts.
CalciumIon committed -
CalciumIon committed
-
- Added a new 'group' parameter to various logging functions, including RecordConsumeLog, GetAllLogs, and GetUserLogs, to allow for more granular log tracking. - Updated the logs table component to display group information, improving the visibility of log data. - Refactored related functions to accommodate the new group parameter, ensuring consistent handling across the application. - Improved the initialization of the group column for PostgreSQL compatibility.
CalciumIon committed
-
- 23 Dec, 2024 3 commits
-
-
fix: mutil func call in gemini
Calcium-Ion committed -
CalciumIon committed
-
- Introduced a new constant `ContextKeyRequestStartTime` to store the request start time in the context, enhancing request tracking. - Updated the `Distribute` middleware to set the request start time in the context using the new constant. - Modified the `GenRelayInfo` function to retrieve the request start time from the context, ensuring accurate timing information is used in relay operations.
CalciumIon committed
-
- 22 Dec, 2024 13 commits
-
-
Yan committed
-
fix-gemini-json-schema
Calcium-Ion committed -
- Updated the GeminiChatHandler function to accept an additional parameter, RelayInfo, allowing for better context handling during chat operations. - Modified the DoResponse method in the Adaptor to pass RelayInfo to GeminiChatHandler, ensuring consistent usage of upstream model information. - Enhanced the GeminiChatStreamHandler to utilize the upstream model name from RelayInfo, improving response accuracy and data representation in Gemini requests.
CalciumIon committed -
- Eliminated the unused `context` import and the logging of `geminiRequest` in the `CovertGemini2OpenAI` function, improving code cleanliness and reducing unnecessary overhead. - This change enhances the maintainability of the code by removing redundant elements that do not contribute to functionality.
CalciumIon committed -
- Introduced a new `FunctionResponse` type to encapsulate function call responses, improving the clarity of data handling. - Updated the `GeminiPart` struct to include the new `FunctionResponse` field, allowing for better representation of function call results in Gemini requests. - Modified the `CovertGemini2OpenAI` function to handle tool calls more effectively by setting the message role and appending function responses to the Gemini parts, enhancing the integration with OpenAI and Gemini systems.
CalciumIon committed -
tenacious committed
-
- Added a new `setting` package to replace the `constant` package for configuration management, improving code organization and clarity. - Moved various configuration variables such as `ServerAddress`, `PayAddress`, and `SensitiveWords` to the new `setting` package. - Updated references throughout the codebase to use the new `setting` package, ensuring consistent access to configuration values. - Introduced new files for managing chat settings and midjourney settings, enhancing modularity and maintainability of the code.
CalciumIon committed -
- Refactored ParseToolCalls, SetToolCalls, IsStringContent, and ParseContent methods in the Message struct to use pointer receivers, improving efficiency and consistency in handling mutable state. - Enhanced code readability and maintainability by ensuring all relevant methods operate on the pointer receiver, aligning with Go best practices.
CalciumIon committed -
- Changed the SetToolCalls method to use a pointer receiver for the Message struct, allowing for modifications to the original instance. - This change improves the method's efficiency and aligns with Go best practices for mutating struct methods.
CalciumIon committed -
- Changed the type of ToolCalls in the Message struct from `any` to `json.RawMessage` for better type safety and clarity. - Introduced ParseToolCalls and SetToolCalls methods to handle ToolCalls more effectively, improving code readability and maintainability. - Updated the ParseContent method to work with the new MediaContent type instead of MediaMessage, enhancing the structure of content parsing. - Refactored Gemini relay functions to utilize the new ToolCalls handling methods, streamlining the integration with OpenAI and Gemini systems.
CalciumIon committed -
解决 #534 用户管理-管理用户-查询报错 (SQLSTATE 42601)-postgresql
Calcium-Ion committed -
- Removed redundant checks for non-empty properties in function parameters. - Set function parameters to nil when no properties are needed, streamlining the logic for handling Gemini requests. - Improved code clarity and maintainability by eliminating unnecessary complexity.
CalciumIon committed -
- Added logic to ensure that function parameters have non-empty properties. - Implemented checks to add a default empty property if no parameters are needed. - Updated the required field to match existing properties, improving the robustness of the Gemini function integration.
CalciumIon committed
-
- 21 Dec, 2024 7 commits
-
-
borland committed
-
borland committed
-
- Added `renderGroup` function to improve the display of log data by rendering the 'group' information in the LogsTable component. - Updated the rendering logic to utilize the new function, enhancing the UI's clarity and usability for grouped logs.
CalciumIon committed -
- Introduced `log_info_generate.go` to implement functions for generating various log information, including text, WebSocket, and audio details. - Enhanced `LogsTable` component to display the 'group' information from the log data, improving the visibility of grouped logs in the UI.
CalciumIon committed -
# Conflicts: # dto/openai_request.go
CalciumIon committed -
支持gemini结构化输出
Calcium-Ion committed -
MartialBE committed
-
- 20 Dec, 2024 9 commits
-
-
HynoR committed
-
HynoR committed
-
TAKO committed
-
HynoR committed
-
HynoR committed
-
- Updated `CovertGemini2OpenAI` function to return an error alongside the GeminiChatRequest, improving error reporting for image processing. - Modified `ConvertRequest` methods in both `adaptor.go` files to handle potential errors from the Gemini conversion, ensuring robust request handling. - Improved clarity and maintainability of the code by explicitly managing error cases during request conversion.
CalciumIon committed -
- Introduced `GEMINI_VISION_MAX_IMAGE_NUM` to README files for better user guidance. - Updated `env.go` to retrieve the maximum image number from environment variables, defaulting to 16. - Modified image handling logic in `relay-gemini.go` to respect the new configuration, allowing disabling of the limit by setting it to -1. - Removed hardcoded constant for maximum image number in `constant.go` to streamline configuration management.
CalciumIon committed -
fix: 修复添加模型切换模式时,初始化空值导致的判断问题
Calcium-Ion committed -
chore: 更新遗漏的gemini模型
Calcium-Ion committed
-