@librechat/agents-types 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/llm.ts +10 -5
 - package/package.json +1 -1
 - package/stream.ts +14 -1
 
    
        package/llm.ts
    CHANGED
    
    | 
         @@ -1,5 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            // src/types/llm.ts
         
     | 
| 
       2 
2 
     | 
    
         
             
            import { ChatOllama } from '@langchain/ollama';
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { ChatDeepSeek } from '@langchain/deepseek';
         
     | 
| 
       3 
4 
     | 
    
         
             
            import { ChatAnthropic } from '@langchain/anthropic';
         
     | 
| 
       4 
5 
     | 
    
         
             
            import { ChatMistralAI } from '@langchain/mistralai';
         
     | 
| 
       5 
6 
     | 
    
         
             
            import { ChatBedrockConverse } from '@langchain/aws';
         
     | 
| 
         @@ -12,6 +13,7 @@ import type { ChatOpenAIFields, OpenAIChatInput, AzureOpenAIInput } from '@langc 
     | 
|
| 
       12 
13 
     | 
    
         
             
            import type { BedrockChatFields } from '@langchain/community/chat_models/bedrock/web';
         
     | 
| 
       13 
14 
     | 
    
         
             
            import type { GoogleGenerativeAIChatInput } from '@langchain/google-genai';
         
     | 
| 
       14 
15 
     | 
    
         
             
            import type { ChatVertexAIInput } from '@langchain/google-vertexai';
         
     | 
| 
      
 16 
     | 
    
         
            +
            import type { ChatDeepSeekCallOptions } from '@langchain/deepseek';
         
     | 
| 
       15 
17 
     | 
    
         
             
            import type { ChatBedrockConverseInput } from '@langchain/aws';
         
     | 
| 
       16 
18 
     | 
    
         
             
            import type { ChatMistralAIInput } from '@langchain/mistralai';
         
     | 
| 
       17 
19 
     | 
    
         
             
            import type { StructuredTool } from '@langchain/core/tools';
         
     | 
| 
         @@ -41,32 +43,35 @@ export type VertexAIClientOptions = ChatVertexAIInput; 
     | 
|
| 
       41 
43 
     | 
    
         
             
            export type BedrockClientOptions = BedrockChatFields;
         
     | 
| 
       42 
44 
     | 
    
         
             
            export type BedrockConverseClientOptions = ChatBedrockConverseInput;
         
     | 
| 
       43 
45 
     | 
    
         
             
            export type GoogleClientOptions = GoogleGenerativeAIChatInput;
         
     | 
| 
      
 46 
     | 
    
         
            +
            export type DeepSeekClientOptions = ChatDeepSeekCallOptions;
         
     | 
| 
       44 
47 
     | 
    
         | 
| 
       45 
     | 
    
         
            -
            export type ClientOptions = OpenAIClientOptions | AzureClientOptions | OllamaClientOptions | AnthropicClientOptions | MistralAIClientOptions | VertexAIClientOptions | BedrockClientOptions | BedrockConverseClientOptions | GoogleClientOptions;
         
     | 
| 
      
 48 
     | 
    
         
            +
            export type ClientOptions = OpenAIClientOptions | AzureClientOptions | OllamaClientOptions | AnthropicClientOptions | MistralAIClientOptions | VertexAIClientOptions | BedrockClientOptions | BedrockConverseClientOptions | GoogleClientOptions | DeepSeekClientOptions;
         
     | 
| 
       46 
49 
     | 
    
         | 
| 
       47 
50 
     | 
    
         
             
            export type LLMConfig = {
         
     | 
| 
       48 
51 
     | 
    
         
             
              provider: Providers;
         
     | 
| 
       49 
52 
     | 
    
         
             
            } & ClientOptions;
         
     | 
| 
       50 
53 
     | 
    
         | 
| 
       51 
54 
     | 
    
         
             
            export type ProviderOptionsMap = {
         
     | 
| 
       52 
     | 
    
         
            -
              [Providers.OPENAI]: OpenAIClientOptions;
         
     | 
| 
       53 
55 
     | 
    
         
             
              [Providers.AZURE]: AzureClientOptions;
         
     | 
| 
      
 56 
     | 
    
         
            +
              [Providers.OPENAI]: OpenAIClientOptions;
         
     | 
| 
       54 
57 
     | 
    
         
             
              [Providers.OLLAMA]: OllamaClientOptions;
         
     | 
| 
      
 58 
     | 
    
         
            +
              [Providers.GOOGLE]: GoogleClientOptions;
         
     | 
| 
      
 59 
     | 
    
         
            +
              [Providers.VERTEXAI]: VertexAIClientOptions;
         
     | 
| 
      
 60 
     | 
    
         
            +
              [Providers.DEEPSEEK]: DeepSeekClientOptions;
         
     | 
| 
       55 
61 
     | 
    
         
             
              [Providers.ANTHROPIC]: AnthropicClientOptions;
         
     | 
| 
       56 
62 
     | 
    
         
             
              [Providers.MISTRALAI]: MistralAIClientOptions;
         
     | 
| 
       57 
     | 
    
         
            -
              [Providers.VERTEXAI]: VertexAIClientOptions;
         
     | 
| 
       58 
63 
     | 
    
         
             
              [Providers.BEDROCK_LEGACY]: BedrockClientOptions;
         
     | 
| 
       59 
64 
     | 
    
         
             
              [Providers.BEDROCK]: BedrockConverseClientOptions;
         
     | 
| 
       60 
     | 
    
         
            -
              [Providers.GOOGLE]: GoogleClientOptions;
         
     | 
| 
       61 
65 
     | 
    
         
             
            };
         
     | 
| 
       62 
66 
     | 
    
         | 
| 
       63 
67 
     | 
    
         
             
            export type ChatModelMap = {
         
     | 
| 
       64 
68 
     | 
    
         
             
              [Providers.OPENAI]: ChatOpenAI;
         
     | 
| 
       65 
69 
     | 
    
         
             
              [Providers.OLLAMA]: ChatOllama;
         
     | 
| 
       66 
70 
     | 
    
         
             
              [Providers.AZURE]: AzureChatOpenAI;
         
     | 
| 
      
 71 
     | 
    
         
            +
              [Providers.DEEPSEEK]: ChatDeepSeek;
         
     | 
| 
      
 72 
     | 
    
         
            +
              [Providers.VERTEXAI]: ChatVertexAI;
         
     | 
| 
       67 
73 
     | 
    
         
             
              [Providers.ANTHROPIC]: ChatAnthropic;
         
     | 
| 
       68 
74 
     | 
    
         
             
              [Providers.MISTRALAI]: ChatMistralAI;
         
     | 
| 
       69 
     | 
    
         
            -
              [Providers.VERTEXAI]: ChatVertexAI;
         
     | 
| 
       70 
75 
     | 
    
         
             
              [Providers.BEDROCK_LEGACY]: BedrockChat;
         
     | 
| 
       71 
76 
     | 
    
         
             
              [Providers.BEDROCK]: ChatBedrockConverse;
         
     | 
| 
       72 
77 
     | 
    
         
             
              [Providers.GOOGLE]: ChatGoogleGenerativeAI;
         
     | 
    
        package/package.json
    CHANGED
    
    
    
        package/stream.ts
    CHANGED
    
    | 
         @@ -3,6 +3,7 @@ import type OpenAITypes from 'openai'; 
     | 
|
| 
       3 
3 
     | 
    
         
             
            import type { MessageContentImageUrl, MessageContentText, ToolMessage, BaseMessage } from '@langchain/core/messages';
         
     | 
| 
       4 
4 
     | 
    
         
             
            import type { ToolCall, ToolCallChunk } from '@langchain/core/messages/tool';
         
     | 
| 
       5 
5 
     | 
    
         
             
            import type { LLMResult, Generation } from '@langchain/core/outputs';
         
     | 
| 
      
 6 
     | 
    
         
            +
            import type { ToolEndEvent } from '@/types/tools';
         
     | 
| 
       6 
7 
     | 
    
         
             
            import { StepTypes, ContentTypes, GraphEvents } from '@/common/enum';
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
       8 
9 
     | 
    
         
             
            export type HandleLLMEnd = (output: LLMResult, runId: string, parentRunId?: string, tags?: string[]) => void;
         
     | 
| 
         @@ -239,4 +240,16 @@ export type SplitStreamHandlers = Partial<{ 
     | 
|
| 
       239 
240 
     | 
    
         
             
              [GraphEvents.ON_RUN_STEP]: ({ event, data}: { event: GraphEvents, data: RunStep }) => void;
         
     | 
| 
       240 
241 
     | 
    
         
             
              [GraphEvents.ON_MESSAGE_DELTA]: ({ event, data}: { event: GraphEvents, data: MessageDeltaEvent }) => void;
         
     | 
| 
       241 
242 
     | 
    
         
             
              [GraphEvents.ON_REASONING_DELTA]: ({ event, data}: { event: GraphEvents, data: ReasoningDeltaEvent }) => void;
         
     | 
| 
       242 
     | 
    
         
            -
            }>
         
     | 
| 
      
 243 
     | 
    
         
            +
            }>
         
     | 
| 
      
 244 
     | 
    
         
            +
             
     | 
| 
      
 245 
     | 
    
         
            +
            export type ContentAggregator = ({ event, data }: {
         
     | 
| 
      
 246 
     | 
    
         
            +
              event: GraphEvents;
         
     | 
| 
      
 247 
     | 
    
         
            +
              data: RunStep | MessageDeltaEvent | RunStepDeltaEvent | {
         
     | 
| 
      
 248 
     | 
    
         
            +
                  result: ToolEndEvent;
         
     | 
| 
      
 249 
     | 
    
         
            +
              };
         
     | 
| 
      
 250 
     | 
    
         
            +
            }) => void;
         
     | 
| 
      
 251 
     | 
    
         
            +
            export type ContentAggregatorResult = {
         
     | 
| 
      
 252 
     | 
    
         
            +
              stepMap: Map<string, RunStep | undefined>;
         
     | 
| 
      
 253 
     | 
    
         
            +
              contentParts: Array<MessageContentComplex | undefined>;
         
     | 
| 
      
 254 
     | 
    
         
            +
              aggregateContent: ContentAggregator;
         
     | 
| 
      
 255 
     | 
    
         
            +
            };
         
     |