@librechat/agents-types 1.9.98 → 2.0.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 +19 -8
- package/package.json +1 -1
package/llm.ts
CHANGED
@@ -1,26 +1,35 @@
|
|
1
1
|
// src/types/llm.ts
|
2
|
-
import { ChatOpenAI } from '@langchain/openai';
|
3
2
|
import { ChatOllama } from '@langchain/ollama';
|
4
3
|
import { ChatAnthropic } from '@langchain/anthropic';
|
5
4
|
import { ChatMistralAI } from '@langchain/mistralai';
|
6
5
|
import { ChatBedrockConverse } from '@langchain/aws';
|
7
6
|
import { ChatVertexAI } from '@langchain/google-vertexai';
|
8
|
-
import { BedrockChat } from '@langchain/community/chat_models/bedrock/web';
|
9
7
|
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import type { BindToolsInput } from '@langchain/core/language_models/chat_models';
|
8
|
+
import { BedrockChat } from '@langchain/community/chat_models/bedrock/web';
|
9
|
+
import { ChatOpenAI, AzureChatOpenAI, ClientOptions as OAIClientOptions } from '@langchain/openai';
|
10
|
+
import type { BindToolsInput, BaseChatModelParams } from '@langchain/core/language_models/chat_models';
|
11
|
+
import type { ChatOpenAIFields, OpenAIChatInput, AzureOpenAIInput } from '@langchain/openai';
|
13
12
|
import type { BedrockChatFields } from '@langchain/community/chat_models/bedrock/web';
|
14
|
-
import type { ChatOpenAIFields } from '@langchain/openai';
|
15
|
-
import type { OpenAI as OpenAIClient } from 'openai';
|
16
13
|
import type { GoogleGenerativeAIChatInput } from '@langchain/google-genai';
|
17
14
|
import type { ChatVertexAIInput } from '@langchain/google-vertexai';
|
18
15
|
import type { ChatBedrockConverseInput } from '@langchain/aws';
|
19
16
|
import type { ChatMistralAIInput } from '@langchain/mistralai';
|
17
|
+
import type { StructuredTool } from '@langchain/core/tools';
|
20
18
|
import type { AnthropicInput } from '@langchain/anthropic';
|
19
|
+
import type { Runnable } from '@langchain/core/runnables';
|
21
20
|
import type { ChatOllamaInput } from '@langchain/ollama';
|
21
|
+
import type { OpenAI as OpenAIClient } from 'openai';
|
22
22
|
import { Providers } from '@/common';
|
23
23
|
|
24
|
+
export type AzureClientOptions = (Partial<OpenAIChatInput> & Partial<AzureOpenAIInput> & {
|
25
|
+
openAIApiKey?: string;
|
26
|
+
openAIApiVersion?: string;
|
27
|
+
openAIBasePath?: string;
|
28
|
+
deploymentName?: string;
|
29
|
+
} & BaseChatModelParams & {
|
30
|
+
configuration?: OAIClientOptions;
|
31
|
+
});
|
32
|
+
|
24
33
|
export type ChatOpenAIToolType = BindToolsInput | OpenAIClient.ChatCompletionTool;
|
25
34
|
export type CommonToolType = StructuredTool | ChatOpenAIToolType;
|
26
35
|
|
@@ -33,7 +42,7 @@ export type BedrockClientOptions = BedrockChatFields;
|
|
33
42
|
export type BedrockConverseClientOptions = ChatBedrockConverseInput;
|
34
43
|
export type GoogleClientOptions = GoogleGenerativeAIChatInput;
|
35
44
|
|
36
|
-
export type ClientOptions = OpenAIClientOptions | OllamaClientOptions | AnthropicClientOptions | MistralAIClientOptions | VertexAIClientOptions | BedrockClientOptions | BedrockConverseClientOptions | GoogleClientOptions;
|
45
|
+
export type ClientOptions = OpenAIClientOptions | AzureClientOptions | OllamaClientOptions | AnthropicClientOptions | MistralAIClientOptions | VertexAIClientOptions | BedrockClientOptions | BedrockConverseClientOptions | GoogleClientOptions;
|
37
46
|
|
38
47
|
export type LLMConfig = {
|
39
48
|
provider: Providers;
|
@@ -41,6 +50,7 @@ export type LLMConfig = {
|
|
41
50
|
|
42
51
|
export type ProviderOptionsMap = {
|
43
52
|
[Providers.OPENAI]: OpenAIClientOptions;
|
53
|
+
[Providers.AZURE]: AzureClientOptions;
|
44
54
|
[Providers.OLLAMA]: OllamaClientOptions;
|
45
55
|
[Providers.ANTHROPIC]: AnthropicClientOptions;
|
46
56
|
[Providers.MISTRALAI]: MistralAIClientOptions;
|
@@ -53,6 +63,7 @@ export type ProviderOptionsMap = {
|
|
53
63
|
export type ChatModelMap = {
|
54
64
|
[Providers.OPENAI]: ChatOpenAI;
|
55
65
|
[Providers.OLLAMA]: ChatOllama;
|
66
|
+
[Providers.AZURE]: AzureChatOpenAI;
|
56
67
|
[Providers.ANTHROPIC]: ChatAnthropic;
|
57
68
|
[Providers.MISTRALAI]: ChatMistralAI;
|
58
69
|
[Providers.VERTEXAI]: ChatVertexAI;
|