2024-11-01 18:36:39 -04:00
|
|
|
const { createContentAggregator, Providers } = require('@librechat/agents');
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
const {
|
|
|
|
EModelEndpoint,
|
|
|
|
getResponseSender,
|
2025-03-10 17:23:46 -04:00
|
|
|
AgentCapabilities,
|
2024-09-30 17:17:57 -04:00
|
|
|
providerEndpointMap,
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
} = require('librechat-data-provider');
|
2024-09-30 17:17:57 -04:00
|
|
|
const {
|
|
|
|
getDefaultHandlers,
|
|
|
|
createToolEndCallback,
|
|
|
|
} = require('~/server/controllers/agents/callbacks');
|
2024-10-19 14:24:07 +02:00
|
|
|
const initAnthropic = require('~/server/services/Endpoints/anthropic/initialize');
|
2024-09-30 17:17:57 -04:00
|
|
|
const getBedrockOptions = require('~/server/services/Endpoints/bedrock/options');
|
2024-11-01 18:36:39 -04:00
|
|
|
const initOpenAI = require('~/server/services/Endpoints/openAI/initialize');
|
|
|
|
const initCustom = require('~/server/services/Endpoints/custom/initialize');
|
2024-12-28 17:15:03 -05:00
|
|
|
const initGoogle = require('~/server/services/Endpoints/google/initialize');
|
2025-02-11 18:00:38 -05:00
|
|
|
const generateArtifactsPrompt = require('~/app/clients/prompts/artifacts');
|
2024-11-04 12:59:04 -05:00
|
|
|
const { getCustomEndpointConfig } = require('~/server/services/Config');
|
2025-03-10 17:23:46 -04:00
|
|
|
const { processFiles } = require('~/server/services/Files/process');
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
const { loadAgentTools } = require('~/server/services/ToolService');
|
|
|
|
const AgentClient = require('~/server/controllers/agents/client');
|
2025-03-10 17:23:46 -04:00
|
|
|
const { getToolFiles } = require('~/models/Conversation');
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
const { getModelMaxTokens } = require('~/utils');
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const { getAgent } = require('~/models/Agent');
|
2025-03-10 17:23:46 -04:00
|
|
|
const { getFiles } = require('~/models/File');
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const { logger } = require('~/config');
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
|
|
|
|
const providerConfigMap = {
|
2025-03-05 12:04:26 -05:00
|
|
|
[Providers.XAI]: initCustom,
|
2025-02-15 18:52:29 -05:00
|
|
|
[Providers.OLLAMA]: initCustom,
|
|
|
|
[Providers.DEEPSEEK]: initCustom,
|
|
|
|
[Providers.OPENROUTER]: initCustom,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
[EModelEndpoint.openAI]: initOpenAI,
|
2025-02-15 18:52:29 -05:00
|
|
|
[EModelEndpoint.google]: initGoogle,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
[EModelEndpoint.azureOpenAI]: initOpenAI,
|
|
|
|
[EModelEndpoint.anthropic]: initAnthropic,
|
2024-09-30 17:17:57 -04:00
|
|
|
[EModelEndpoint.bedrock]: getBedrockOptions,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
};
|
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
/**
|
2025-03-10 17:23:46 -04:00
|
|
|
* @param {ServerRequest} req
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
* @param {Promise<Array<MongoFile | null>> | undefined} _attachments
|
|
|
|
* @param {AgentToolResources | undefined} _tool_resources
|
|
|
|
* @returns {Promise<{ attachments: Array<MongoFile | undefined> | undefined, tool_resources: AgentToolResources | undefined }>}
|
|
|
|
*/
|
2025-03-10 17:23:46 -04:00
|
|
|
const primeResources = async (req, _attachments, _tool_resources) => {
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
try {
|
2025-03-10 17:23:46 -04:00
|
|
|
/** @type {Array<MongoFile | undefined> | undefined} */
|
|
|
|
let attachments;
|
|
|
|
const tool_resources = _tool_resources ?? {};
|
|
|
|
const isOCREnabled = (req.app.locals?.[EModelEndpoint.agents]?.capabilities ?? []).includes(
|
|
|
|
AgentCapabilities.ocr,
|
|
|
|
);
|
|
|
|
if (tool_resources.ocr?.file_ids && isOCREnabled) {
|
|
|
|
const context = await getFiles(
|
|
|
|
{
|
|
|
|
file_id: { $in: tool_resources.ocr.file_ids },
|
|
|
|
},
|
|
|
|
{},
|
|
|
|
{},
|
|
|
|
);
|
|
|
|
attachments = (attachments ?? []).concat(context);
|
|
|
|
}
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
if (!_attachments) {
|
2025-03-10 17:23:46 -04:00
|
|
|
return { attachments, tool_resources };
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
}
|
|
|
|
/** @type {Array<MongoFile | undefined> | undefined} */
|
|
|
|
const files = await _attachments;
|
2025-03-10 17:23:46 -04:00
|
|
|
if (!attachments) {
|
|
|
|
/** @type {Array<MongoFile | undefined>} */
|
|
|
|
attachments = [];
|
|
|
|
}
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
|
|
|
|
for (const file of files) {
|
|
|
|
if (!file) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (file.metadata?.fileIdentifier) {
|
|
|
|
const execute_code = tool_resources.execute_code ?? {};
|
|
|
|
if (!execute_code.files) {
|
|
|
|
tool_resources.execute_code = { ...execute_code, files: [] };
|
|
|
|
}
|
|
|
|
tool_resources.execute_code.files.push(file);
|
|
|
|
} else if (file.embedded === true) {
|
|
|
|
const file_search = tool_resources.file_search ?? {};
|
|
|
|
if (!file_search.files) {
|
|
|
|
tool_resources.file_search = { ...file_search, files: [] };
|
|
|
|
}
|
|
|
|
tool_resources.file_search.files.push(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
attachments.push(file);
|
|
|
|
}
|
|
|
|
return { attachments, tool_resources };
|
|
|
|
} catch (error) {
|
|
|
|
logger.error('Error priming resources', error);
|
|
|
|
return { attachments: _attachments, tool_resources: _tool_resources };
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2025-02-11 18:00:38 -05:00
|
|
|
/**
|
|
|
|
* @param {object} params
|
|
|
|
* @param {ServerRequest} params.req
|
|
|
|
* @param {ServerResponse} params.res
|
|
|
|
* @param {Agent} params.agent
|
|
|
|
* @param {object} [params.endpointOption]
|
|
|
|
* @param {boolean} [params.isInitialAgent]
|
|
|
|
* @returns {Promise<Agent>}
|
|
|
|
*/
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const initializeAgentOptions = async ({
|
|
|
|
req,
|
|
|
|
res,
|
|
|
|
agent,
|
|
|
|
endpointOption,
|
|
|
|
isInitialAgent = false,
|
|
|
|
}) => {
|
2025-03-10 17:23:46 -04:00
|
|
|
let currentFiles;
|
|
|
|
const requestFiles = req.body.files ?? [];
|
|
|
|
if (
|
|
|
|
isInitialAgent &&
|
|
|
|
req.body.conversationId != null &&
|
|
|
|
agent.model_parameters?.resendFiles === true
|
|
|
|
) {
|
|
|
|
const fileIds = (await getToolFiles(req.body.conversationId)).map((f) => f.file_id);
|
|
|
|
if (requestFiles.length || fileIds.length) {
|
|
|
|
currentFiles = await processFiles(requestFiles, fileIds);
|
|
|
|
}
|
|
|
|
} else if (isInitialAgent && requestFiles.length) {
|
|
|
|
currentFiles = await processFiles(requestFiles);
|
|
|
|
}
|
|
|
|
|
|
|
|
const { attachments, tool_resources } = await primeResources(
|
|
|
|
req,
|
|
|
|
currentFiles,
|
|
|
|
agent.tool_resources,
|
|
|
|
);
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const { tools, toolContextMap } = await loadAgentTools({
|
|
|
|
req,
|
2025-02-10 21:56:08 +01:00
|
|
|
res,
|
2024-12-17 13:12:57 -05:00
|
|
|
agent,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
tool_resources,
|
|
|
|
});
|
|
|
|
|
|
|
|
const provider = agent.provider;
|
2025-03-03 19:09:22 -05:00
|
|
|
agent.endpoint = provider;
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
let getOptions = providerConfigMap[provider];
|
2025-02-15 18:52:29 -05:00
|
|
|
if (!getOptions && providerConfigMap[provider.toLowerCase()] != null) {
|
|
|
|
agent.provider = provider.toLowerCase();
|
|
|
|
getOptions = providerConfigMap[agent.provider];
|
|
|
|
} else if (!getOptions) {
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const customEndpointConfig = await getCustomEndpointConfig(provider);
|
|
|
|
if (!customEndpointConfig) {
|
|
|
|
throw new Error(`Provider ${provider} not supported`);
|
|
|
|
}
|
|
|
|
getOptions = initCustom;
|
|
|
|
agent.provider = Providers.OPENAI;
|
|
|
|
}
|
2024-12-18 13:53:59 -05:00
|
|
|
const model_parameters = Object.assign(
|
|
|
|
{},
|
|
|
|
agent.model_parameters ?? { model: agent.model },
|
|
|
|
isInitialAgent === true ? endpointOption?.model_parameters : {},
|
|
|
|
);
|
|
|
|
const _endpointOption =
|
|
|
|
isInitialAgent === true
|
|
|
|
? Object.assign({}, endpointOption, { model_parameters })
|
|
|
|
: { model_parameters };
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
|
|
|
|
const options = await getOptions({
|
|
|
|
req,
|
|
|
|
res,
|
|
|
|
optionsOnly: true,
|
|
|
|
overrideEndpoint: provider,
|
|
|
|
overrideModel: agent.model,
|
|
|
|
endpointOption: _endpointOption,
|
|
|
|
});
|
|
|
|
|
2024-12-28 17:15:03 -05:00
|
|
|
if (options.provider != null) {
|
|
|
|
agent.provider = options.provider;
|
|
|
|
}
|
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
agent.model_parameters = Object.assign(model_parameters, options.llmConfig);
|
|
|
|
if (options.configOptions) {
|
|
|
|
agent.model_parameters.configuration = options.configOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!agent.model_parameters.model) {
|
|
|
|
agent.model_parameters.model = agent.model;
|
|
|
|
}
|
|
|
|
|
2025-02-11 18:00:38 -05:00
|
|
|
if (typeof agent.artifacts === 'string' && agent.artifacts !== '') {
|
|
|
|
agent.additional_instructions = generateArtifactsPrompt({
|
|
|
|
endpoint: agent.provider,
|
|
|
|
artifacts: agent.artifacts,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-12-18 11:11:38 -05:00
|
|
|
const tokensModel =
|
|
|
|
agent.provider === EModelEndpoint.azureOpenAI ? agent.model : agent.model_parameters.model;
|
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
return {
|
|
|
|
...agent,
|
|
|
|
tools,
|
2025-03-10 17:23:46 -04:00
|
|
|
attachments,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
toolContextMap,
|
|
|
|
maxContextTokens:
|
|
|
|
agent.max_context_tokens ??
|
2024-12-18 11:11:38 -05:00
|
|
|
getModelMaxTokens(tokensModel, providerEndpointMap[provider]) ??
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
4000,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
const initializeClient = async ({ req, res, endpointOption }) => {
|
|
|
|
if (!endpointOption) {
|
|
|
|
throw new Error('Endpoint option not provided');
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: use endpointOption to determine options/modelOptions
|
2024-09-30 17:17:57 -04:00
|
|
|
/** @type {Array<UsageMetadata>} */
|
|
|
|
const collectedUsage = [];
|
|
|
|
/** @type {ArtifactPromises} */
|
|
|
|
const artifactPromises = [];
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
const { contentParts, aggregateContent } = createContentAggregator();
|
2024-09-30 17:17:57 -04:00
|
|
|
const toolEndCallback = createToolEndCallback({ req, res, artifactPromises });
|
|
|
|
const eventHandlers = getDefaultHandlers({
|
|
|
|
res,
|
|
|
|
aggregateContent,
|
|
|
|
toolEndCallback,
|
|
|
|
collectedUsage,
|
|
|
|
});
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
|
|
|
|
if (!endpointOption.agent) {
|
|
|
|
throw new Error('No agent promise provided');
|
|
|
|
}
|
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
// Initialize primary agent
|
|
|
|
const primaryAgent = await endpointOption.agent;
|
|
|
|
if (!primaryAgent) {
|
2024-09-30 17:17:57 -04:00
|
|
|
throw new Error('Agent not found');
|
|
|
|
}
|
2024-11-04 12:59:04 -05:00
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const agentConfigs = new Map();
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
// Handle primary agent
|
|
|
|
const primaryConfig = await initializeAgentOptions({
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
req,
|
|
|
|
res,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
agent: primaryAgent,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
endpointOption,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
isInitialAgent: true,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
});
|
2024-11-04 12:59:04 -05:00
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const agent_ids = primaryConfig.agent_ids;
|
|
|
|
if (agent_ids?.length) {
|
|
|
|
for (const agentId of agent_ids) {
|
|
|
|
const agent = await getAgent({ id: agentId });
|
|
|
|
if (!agent) {
|
|
|
|
throw new Error(`Agent ${agentId} not found`);
|
|
|
|
}
|
|
|
|
const config = await initializeAgentOptions({
|
|
|
|
req,
|
|
|
|
res,
|
|
|
|
agent,
|
|
|
|
endpointOption,
|
|
|
|
});
|
|
|
|
agentConfigs.set(agentId, config);
|
|
|
|
}
|
2024-11-04 12:59:04 -05:00
|
|
|
}
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
const sender =
|
|
|
|
primaryAgent.name ??
|
|
|
|
getResponseSender({
|
|
|
|
...endpointOption,
|
|
|
|
model: endpointOption.model_parameters.model,
|
|
|
|
});
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
const client = new AgentClient({
|
|
|
|
req,
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
sender,
|
|
|
|
contentParts,
|
2025-03-10 17:23:46 -04:00
|
|
|
agentConfigs,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
eventHandlers,
|
2024-09-30 17:17:57 -04:00
|
|
|
collectedUsage,
|
|
|
|
artifactPromises,
|
2025-03-10 17:23:46 -04:00
|
|
|
agent: primaryConfig,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
spec: endpointOption.spec,
|
2025-01-07 11:09:18 -05:00
|
|
|
iconURL: endpointOption.iconURL,
|
🪨 feat: AWS Bedrock support (#3935)
* feat: Add BedrockIcon component to SVG library
* feat: EModelEndpoint.bedrock
* feat: first pass, bedrock chat. note: AgentClient is returning `agents` as conversation.endpoint
* fix: declare endpoint in initialization step
* chore: Update @librechat/agents dependency to version 1.4.5
* feat: backend content aggregation for agents/bedrock
* feat: abort agent requests
* feat: AWS Bedrock icons
* WIP: agent provider schema parsing
* chore: Update EditIcon props type
* refactor(useGenerationsByLatest): make agents and bedrock editable
* refactor: non-assistant message content, parts
* fix: Bedrock response `sender`
* fix: use endpointOption.model_parameters not endpointOption.modelOptions
* fix: types for step handler
* refactor: Update Agents.ToolCallDelta type
* refactor: Remove unnecessary assignment of parentMessageId in AskController
* refactor: remove unnecessary assignment of parentMessageId (agent request handler)
* fix(bedrock/agents): message regeneration
* refactor: dynamic form elements using react-hook-form Controllers
* fix: agent icons/labels for messages
* fix: agent actions
* fix: use of new dynamic tags causing application crash
* refactor: dynamic settings touch-ups
* refactor: update Slider component to allow custom track class name
* refactor: update DynamicSlider component styles
* refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
* feat: agent share global methods/controllers
* fix: agents query
* fix: `getResponseModel`
* fix: share prompt a11y issue
* refactor: update SharePrompt dialog theme styles
* refactor: explicit typing for SharePrompt
* feat: add agent roles/permissions
* chore: update @librechat/agents dependency to version 1.4.7 for tool_call_ids edge case
* fix(Anthropic): messages.X.content.Y.tool_use.input: Input should be a valid dictionary
* fix: handle text parts with tool_call_ids and empty text
* fix: role initialization
* refactor: don't make instructions required
* refactor: improve typing of Text part
* fix: setShowStopButton for agents route
* chore: remove params for now
* fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
* refactor: remove console.log statement in ContentRender component
* chore: typing, rename Context to Delete Button
* chore(DeleteButton): logging
* refactor(Action): make accessible
* style(Action): improve a11y again
* refactor: remove use/mention of mongoose sessions
* feat: first pass, sharing agents
* feat: visual indicator for global agent, remove author when serving to non-author
* wip: params
* chore: fix typing issues
* fix(schemas): typing
* refactor: improve accessibility of ListCard component and fix console React warning
* wip: reset templates for non-legacy new convos
* Revert "wip: params"
This reverts commit f8067e91d4adf7be9e0d9e914aaae79ac4689b80.
* Revert "refactor: dynamic form elements using react-hook-form Controllers"
This reverts commit 2150c4815d8c74a978a4b697aa8f54dc11e035d7.
* fix(Parameters): types and parameter effect update to only update local state to parameters
* refactor: optimize useDebouncedInput hook for better performance
* feat: first pass, anthropic bedrock params
* chore: paramEndpoints check for endpointType too
* fix: maxTokens to use coerceNumber.optional(),
* feat: extra chat model params
* chore: reduce code repetition
* refactor: improve preset title handling in SaveAsPresetDialog component
* refactor: improve preset handling in HeaderOptions component
* chore: improve typing, replace legacy dialog for SaveAsPresetDialog
* feat: save as preset from parameters panel
* fix: multi-search in select dropdown when using Option type
* refactor: update default showDefault value to false in Dynamic components
* feat: Bedrock presets settings
* chore: config, fix agents schema, update config version
* refactor: update AWS region variable name in bedrock options endpoint to BEDROCK_AWS_DEFAULT_REGION
* refactor: update baseEndpointSchema in config.ts to include baseURL property
* refactor: update createRun function to include req parameter and set streamRate based on provider
* feat: availableRegions via config
* refactor: remove unused demo agent controller file
* WIP: title
* Update @librechat/agents to version 1.5.0
* chore: addTitle.js to handle empty responseText
* feat: support images and titles
* feat: context token updates
* Refactor BaseClient test to use expect.objectContaining
* refactor: add model select, remove header options params, move side panel params below prompts
* chore: update models list, catch title error
* feat: model service for bedrock models (env)
* chore: Remove verbose debug log in AgentClient class following stream
* feat(bedrock): track token spend; fix: token rates, value key mapping for AWS models
* refactor: handle streamRate in `handleLLMNewToken` callback
* chore: AWS Bedrock example config in `.env.example`
* refactor: Rename bedrockMeta to bedrockGeneral in settings.ts and use for AI21 and Amazon Bedrock providers
* refactor: Update `.env.example` with AWS Bedrock model IDs URL and additional notes
* feat: titleModel support for bedrock
* refactor: Update `.env.example` with additional notes for AWS Bedrock model IDs
2024-09-09 12:06:59 -04:00
|
|
|
endpoint: EModelEndpoint.agents,
|
2025-03-10 17:23:46 -04:00
|
|
|
attachments: primaryConfig.attachments,
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
maxContextTokens: primaryConfig.maxContextTokens,
|
2025-03-10 17:23:46 -04:00
|
|
|
resendFiles: primaryConfig.model_parameters?.resendFiles ?? true,
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
});
|
🎉 feat: Code Interpreter API and Agents Release (#4860)
* feat: Code Interpreter API & File Search Agent Uploads
chore: add back code files
wip: first pass, abstract key dialog
refactor: influence checkbox on key changes
refactor: update localization keys for 'execute code' to 'run code'
wip: run code button
refactor: add throwError parameter to loadAuthValues and getUserPluginAuthValue functions
feat: first pass, API tool calling
fix: handle missing toolId in callTool function and return 404 for non-existent tools
feat: show code outputs
fix: improve error handling in callTool function and log errors
fix: handle potential null value for filepath in attachment destructuring
fix: normalize language before rendering and prevent null return
fix: add loading indicator in RunCode component while executing code
feat: add support for conditional code execution in Markdown components
feat: attachments
refactor: remove bash
fix: pass abort signal to graph/run
refactor: debounce and rate limit tool call
refactor: increase debounce delay for execute function
feat: set code output attachments
feat: image attachments
refactor: apply message context
refactor: pass `partIndex`
feat: toolCall schema/model/methods
feat: block indexing
feat: get tool calls
chore: imports
chore: typing
chore: condense type imports
feat: get tool calls
fix: block indexing
chore: typing
refactor: update tool calls mapping to support multiple results
fix: add unique key to nav link for rendering
wip: first pass, tool call results
refactor: update query cache from successful tool call mutation
style: improve result switcher styling
chore: note on using \`.toObject()\`
feat: add agent_id field to conversation schema
chore: typing
refactor: rename agentMap to agentsMap for consistency
feat: Agent Name as chat input placeholder
chore: bump agents
📦 chore: update @langchain dependencies to latest versions to match agents package
📦 chore: update @librechat/agents dependency to version 1.8.0
fix: Aborting agent stream removes sender; fix(bedrock): completion removes preset name label
refactor: remove direct file parameter to use req.file, add `processAgentFileUpload` for image uploads
feat: upload menu
feat: prime message_file resources
feat: implement conversation access validation in chat route
refactor: remove file parameter from processFileUpload and use req.file instead
feat: add savedMessageIds set to track saved message IDs in BaseClient, to prevent unnecessary double-write to db
feat: prevent duplicate message saves by checking savedMessageIds in AgentController
refactor: skip legacy RAG API handling for agents
feat: add files field to convoSchema
refactor: update request type annotations from Express.Request to ServerRequest in file processing functions
feat: track conversation files
fix: resendFiles, addPreviousAttachments handling
feat: add ID validation for session_id and file_id in download route
feat: entity_id for code file uploads/downloads
fix: code file edge cases
feat: delete related tool calls
feat: add stream rate handling for LLM configuration
feat: enhance system content with attached file information
fix: improve error logging in resource priming function
* WIP: PoC, sequential agents
WIP: PoC Sequential Agents, first pass content data + bump agents package
fix: package-lock
WIP: PoC, o1 support, refactor bufferString
feat: convertJsonSchemaToZod
fix: form issues and schema defining erroneous model
fix: max length issue on agent form instructions, limit conversation messages to sequential agents
feat: add abort signal support to createRun function and AgentClient
feat: PoC, hide prior sequential agent steps
fix: update parameter naming from config to metadata in event handlers for clarity, add model to usage data
refactor: use only last contentData, track model for usage data
chore: bump agents package
fix: content parts issue
refactor: filter contentParts to include tool calls and relevant indices
feat: show function calls
refactor: filter context messages to exclude tool calls when no tools are available to the agent
fix: ensure tool call content is not undefined in formatMessages
feat: add agent_id field to conversationPreset schema
feat: hide sequential agents
feat: increase upload toast duration to 10 seconds
* refactor: tool context handling & update Code API Key Dialog
feat: toolContextMap
chore: skipSpecs -> useSpecs
ci: fix handleTools tests
feat: API Key Dialog
* feat: Agent Permissions Admin Controls
feat: replace label with button for prompt permission toggle
feat: update agent permissions
feat: enable experimental agents and streamline capability configuration
feat: implement access control for agents and enhance endpoint menu items
feat: add welcome message for agent selection in localization
feat: add agents permission to access control and update version to 0.7.57
* fix: update types in useAssistantListMap and useMentions hooks for better null handling
* feat: mention agents
* fix: agent tool resource race conditions when deleting agent tool resource files
* feat: add error handling for code execution with user feedback
* refactor: rename AdminControls to AdminSettings for clarity
* style: add gap to button in AdminSettings for improved layout
* refactor: separate agent query hooks and check access to enable fetching
* fix: remove unused provider from agent initialization options, creates issue with custom endpoints
* refactor: remove redundant/deprecated modelOptions from AgentClient processes
* chore: update @librechat/agents to version 1.8.5 in package.json and package-lock.json
* fix: minor styling issues + agent panel uniformity
* fix: agent edge cases when set endpoint is no longer defined
* refactor: remove unused cleanup function call from AppService
* fix: update link in ApiKeyDialog to point to pricing page
* fix: improve type handling and layout calculations in SidePanel component
* fix: add missing localization string for agent selection in SidePanel
* chore: form styling and localizations for upload filesearch/code interpreter
* fix: model selection placeholder logic in AgentConfig component
* style: agent capabilities
* fix: add localization for provider selection and improve dropdown styling in ModelPanel
* refactor: use gpt-4o-mini > gpt-3.5-turbo
* fix: agents configuration for loadDefaultInterface and update related tests
* feat: DALLE Agents support
2024-12-04 15:48:13 -05:00
|
|
|
|
🚧 chore: merge latest dev build to main repo (#3844)
* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
2024-08-31 16:33:51 -04:00
|
|
|
return { client };
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = { initializeClient };
|