@librechat/agents-types 2.1.0 → 2.1.2
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/graph.ts +18 -1
- package/llm.ts +4 -0
- package/package.json +1 -1
- package/run.ts +5 -13
package/graph.ts
CHANGED
@@ -3,6 +3,9 @@ import type { StateGraphArgs, StateGraph, CompiledStateGraph } from '@langchain/
|
|
3
3
|
import type { BaseMessage, AIMessageChunk } from '@langchain/core/messages';
|
4
4
|
import type { ChatGenerationChunk } from '@langchain/core/outputs';
|
5
5
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
6
|
+
import type { ToolMap, GenericTool } from '@/types/tools';
|
7
|
+
import type { ClientOptions } from '@/types/llm';
|
8
|
+
import type { Providers } from '@/common';
|
6
9
|
import type { Graph } from '@/graphs';
|
7
10
|
// import type { RunnableConfig } from '@langchain/core/runnables';
|
8
11
|
|
@@ -135,4 +138,18 @@ export type PartMetadata = {
|
|
135
138
|
output?: string;
|
136
139
|
};
|
137
140
|
|
138
|
-
export type ModelEndData = StreamEventData & { output: AIMessageChunk | undefined } | undefined;
|
141
|
+
export type ModelEndData = StreamEventData & { output: AIMessageChunk | undefined } | undefined;
|
142
|
+
|
143
|
+
export type StandardGraphInput = {
|
144
|
+
runId?: string;
|
145
|
+
toolEnd?: boolean;
|
146
|
+
toolMap?: ToolMap;
|
147
|
+
provider: Providers;
|
148
|
+
signal?: AbortSignal;
|
149
|
+
instructions?: string;
|
150
|
+
streamBuffer?: number;
|
151
|
+
tools?: GenericTool[];
|
152
|
+
clientOptions: ClientOptions;
|
153
|
+
additional_instructions?: string;
|
154
|
+
reasoningKey?: 'reasoning_content' | 'reasoning';
|
155
|
+
};
|
package/llm.ts
CHANGED
@@ -21,6 +21,8 @@ import type { AnthropicInput } from '@langchain/anthropic';
|
|
21
21
|
import type { Runnable } from '@langchain/core/runnables';
|
22
22
|
import type { ChatOllamaInput } from '@langchain/ollama';
|
23
23
|
import type { OpenAI as OpenAIClient } from 'openai';
|
24
|
+
import type { ChatOpenRouterCallOptions } from '@/llm/openrouter/llm';
|
25
|
+
import { ChatOpenRouter } from '@/llm/openrouter/llm';
|
24
26
|
import { Providers } from '@/common';
|
25
27
|
|
26
28
|
export type AzureClientOptions = (Partial<OpenAIChatInput> & Partial<AzureOpenAIInput> & {
|
@@ -60,6 +62,7 @@ export type ProviderOptionsMap = {
|
|
60
62
|
[Providers.DEEPSEEK]: DeepSeekClientOptions;
|
61
63
|
[Providers.ANTHROPIC]: AnthropicClientOptions;
|
62
64
|
[Providers.MISTRALAI]: MistralAIClientOptions;
|
65
|
+
[Providers.OPENROUTER]: ChatOpenRouterCallOptions;
|
63
66
|
[Providers.BEDROCK_LEGACY]: BedrockClientOptions;
|
64
67
|
[Providers.BEDROCK]: BedrockConverseClientOptions;
|
65
68
|
};
|
@@ -72,6 +75,7 @@ export type ChatModelMap = {
|
|
72
75
|
[Providers.VERTEXAI]: ChatVertexAI;
|
73
76
|
[Providers.ANTHROPIC]: ChatAnthropic;
|
74
77
|
[Providers.MISTRALAI]: ChatMistralAI;
|
78
|
+
[Providers.OPENROUTER]: ChatOpenRouter;
|
75
79
|
[Providers.BEDROCK_LEGACY]: BedrockChat;
|
76
80
|
[Providers.BEDROCK]: ChatBedrockConverse;
|
77
81
|
[Providers.GOOGLE]: ChatGoogleGenerativeAI;
|
package/package.json
CHANGED
package/run.ts
CHANGED
@@ -6,26 +6,18 @@ import type { BaseCallbackHandler, CallbackHandlerMethods } from '@langchain/cor
|
|
6
6
|
import type * as graph from '@/graphs/Graph';
|
7
7
|
import type * as e from '@/common/enum';
|
8
8
|
import type * as g from '@/types/graph';
|
9
|
-
import type * as t from '@/types/tools';
|
10
9
|
import type * as l from '@/types/llm';
|
11
10
|
|
12
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
13
12
|
export type ZodObjectAny = z.ZodObject<any, any, any, any>;
|
14
|
-
|
15
|
-
export type StandardGraphConfig = {
|
16
|
-
runId?: string;
|
13
|
+
export type BaseGraphConfig = {
|
17
14
|
type?: 'standard';
|
18
|
-
provider?: e.Providers;
|
19
|
-
instructions?: string;
|
20
15
|
llmConfig: l.LLMConfig;
|
21
|
-
|
22
|
-
|
23
|
-
additional_instructions?: string;
|
24
|
-
streamBuffer?: number;
|
25
|
-
signal?: AbortSignal;
|
26
|
-
clientOptions?: Record<string, unknown>;
|
27
|
-
toolEnd?: boolean;
|
16
|
+
provider?: e.Providers;
|
17
|
+
clientOptions?: l.ClientOptions;
|
28
18
|
};
|
19
|
+
export type StandardGraphConfig = BaseGraphConfig &
|
20
|
+
Omit<g.StandardGraphInput, 'provider' | 'clientOptions'>;
|
29
21
|
|
30
22
|
export interface AgentStateChannels {
|
31
23
|
messages: BaseMessage[];
|