mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-09 12:08:50 +01:00
feat: add tool_options parameter to loadTools and initializeAgent for enhanced agent configuration
This commit is contained in:
parent
2d4833b49e
commit
1496e11e88
2 changed files with 14 additions and 2 deletions
|
|
@ -49,8 +49,17 @@ function createToolLoader(signal, streamId = null) {
|
|||
* toolRegistry?: import('@librechat/agents').LCToolRegistry
|
||||
* } | undefined>}
|
||||
*/
|
||||
return async function loadTools({ req, res, agentId, tools, provider, model, tool_resources }) {
|
||||
const agent = { id: agentId, tools, provider, model };
|
||||
return async function loadTools({
|
||||
req,
|
||||
res,
|
||||
tools,
|
||||
model,
|
||||
agentId,
|
||||
provider,
|
||||
tool_options,
|
||||
tool_resources,
|
||||
}) {
|
||||
const agent = { id: agentId, tools, provider, model, tool_options };
|
||||
try {
|
||||
return await loadAgentTools({
|
||||
req,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
} from 'librechat-data-provider';
|
||||
import type {
|
||||
AgentToolResources,
|
||||
AgentToolOptions,
|
||||
TEndpointOption,
|
||||
TFile,
|
||||
Agent,
|
||||
|
|
@ -65,6 +66,7 @@ export interface InitializeAgentParams {
|
|||
agentId: string;
|
||||
tools: string[];
|
||||
model: string | null;
|
||||
tool_options: AgentToolOptions | undefined;
|
||||
tool_resources: AgentToolResources | undefined;
|
||||
}) => Promise<{
|
||||
tools: GenericTool[];
|
||||
|
|
@ -214,6 +216,7 @@ export async function initializeAgent(
|
|||
agentId: agent.id,
|
||||
tools: agent.tools ?? [],
|
||||
model: agent.model,
|
||||
tool_options: agent.tool_options,
|
||||
tool_resources,
|
||||
})) ?? { tools: [], toolContextMap: {}, userMCPAuthMap: undefined, toolRegistry: undefined };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue