beeai-framework 0.1.7 → 0.1.8
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/README.md +35 -29
- package/dist/adapters/amazon-bedrock/backend/chat.d.cts +1 -1
- package/dist/adapters/amazon-bedrock/backend/chat.d.ts +1 -1
- package/dist/adapters/amazon-bedrock/backend/embedding.d.cts +1 -1
- package/dist/adapters/amazon-bedrock/backend/embedding.d.ts +1 -1
- package/dist/adapters/anthropic/backend/chat.d.cts +1 -1
- package/dist/adapters/anthropic/backend/chat.d.ts +1 -1
- package/dist/adapters/anthropic/backend/embedding.d.cts +1 -1
- package/dist/adapters/anthropic/backend/embedding.d.ts +1 -1
- package/dist/adapters/azure-openai/backend/chat.d.cts +1 -1
- package/dist/adapters/azure-openai/backend/chat.d.ts +1 -1
- package/dist/adapters/azure-openai/backend/embedding.d.cts +1 -1
- package/dist/adapters/azure-openai/backend/embedding.d.ts +1 -1
- package/dist/adapters/dummy/backend/chat.d.cts +1 -1
- package/dist/adapters/dummy/backend/chat.d.ts +1 -1
- package/dist/adapters/dummy/backend/embedding.d.cts +1 -1
- package/dist/adapters/dummy/backend/embedding.d.ts +1 -1
- package/dist/adapters/google-vertex/backend/chat.d.cts +1 -1
- package/dist/adapters/google-vertex/backend/chat.d.ts +1 -1
- package/dist/adapters/google-vertex/backend/embedding.d.cts +1 -1
- package/dist/adapters/google-vertex/backend/embedding.d.ts +1 -1
- package/dist/adapters/groq/backend/chat.d.cts +1 -1
- package/dist/adapters/groq/backend/chat.d.ts +1 -1
- package/dist/adapters/groq/backend/embedding.d.cts +1 -1
- package/dist/adapters/groq/backend/embedding.d.ts +1 -1
- package/dist/adapters/langchain/backend/chat.d.cts +1 -1
- package/dist/adapters/langchain/backend/chat.d.ts +1 -1
- package/dist/adapters/langchain/backend/embedding.d.cts +1 -1
- package/dist/adapters/langchain/backend/embedding.d.ts +1 -1
- package/dist/adapters/langchain/tools.d.cts +1 -1
- package/dist/adapters/langchain/tools.d.ts +1 -1
- package/dist/adapters/ollama/backend/chat.d.cts +1 -1
- package/dist/adapters/ollama/backend/chat.d.ts +1 -1
- package/dist/adapters/ollama/backend/embedding.d.cts +1 -1
- package/dist/adapters/ollama/backend/embedding.d.ts +1 -1
- package/dist/adapters/openai/backend/chat.d.cts +1 -1
- package/dist/adapters/openai/backend/chat.d.ts +1 -1
- package/dist/adapters/openai/backend/client.cjs +9 -2
- package/dist/adapters/openai/backend/client.cjs.map +1 -1
- package/dist/adapters/openai/backend/client.js +9 -2
- package/dist/adapters/openai/backend/client.js.map +1 -1
- package/dist/adapters/openai/backend/embedding.d.cts +1 -1
- package/dist/adapters/openai/backend/embedding.d.ts +1 -1
- package/dist/adapters/vercel/backend/chat.d.cts +1 -1
- package/dist/adapters/vercel/backend/chat.d.ts +1 -1
- package/dist/adapters/vercel/backend/embedding.d.cts +1 -1
- package/dist/adapters/vercel/backend/embedding.d.ts +1 -1
- package/dist/adapters/watsonx/backend/chat.d.cts +1 -1
- package/dist/adapters/watsonx/backend/chat.d.ts +1 -1
- package/dist/adapters/watsonx/backend/embedding.d.cts +1 -1
- package/dist/adapters/watsonx/backend/embedding.d.ts +1 -1
- package/dist/{agent-Bpt7IFa_.d.cts → agent-COg8SPbf.d.cts} +2 -2
- package/dist/{agent-Bf2FaCKy.d.ts → agent-Dv5YSk8H.d.ts} +2 -2
- package/dist/agents/base.d.cts +2 -2
- package/dist/agents/base.d.ts +2 -2
- package/dist/agents/experimental/remote/agent.d.cts +2 -2
- package/dist/agents/experimental/remote/agent.d.ts +2 -2
- package/dist/agents/experimental/replan/agent.d.cts +2 -2
- package/dist/agents/experimental/replan/agent.d.ts +2 -2
- package/dist/agents/experimental/replan/prompts.d.cts +1 -1
- package/dist/agents/experimental/replan/prompts.d.ts +1 -1
- package/dist/agents/experimental/streamlit/agent.d.cts +2 -2
- package/dist/agents/experimental/streamlit/agent.d.ts +2 -2
- package/dist/agents/react/agent.d.cts +3 -3
- package/dist/agents/react/agent.d.ts +3 -3
- package/dist/agents/react/runners/base.d.cts +3 -3
- package/dist/agents/react/runners/base.d.ts +3 -3
- package/dist/agents/react/runners/deep-think/runner.d.cts +3 -3
- package/dist/agents/react/runners/deep-think/runner.d.ts +3 -3
- package/dist/agents/react/runners/default/runner.d.cts +3 -3
- package/dist/agents/react/runners/default/runner.d.ts +3 -3
- package/dist/agents/react/runners/granite/runner.d.cts +3 -3
- package/dist/agents/react/runners/granite/runner.d.ts +3 -3
- package/dist/agents/react/types.d.cts +1 -1
- package/dist/agents/react/types.d.ts +1 -1
- package/dist/agents/toolCalling/agent.d.cts +2 -2
- package/dist/agents/toolCalling/agent.d.ts +2 -2
- package/dist/agents/toolCalling/prompts.cjs +3 -4
- package/dist/agents/toolCalling/prompts.cjs.map +1 -1
- package/dist/agents/toolCalling/prompts.js +3 -4
- package/dist/agents/toolCalling/prompts.js.map +1 -1
- package/dist/agents/toolCalling/types.d.cts +1 -1
- package/dist/agents/toolCalling/types.d.ts +1 -1
- package/dist/agents/types.d.cts +2 -2
- package/dist/agents/types.d.ts +2 -2
- package/dist/backend/backend.d.cts +1 -1
- package/dist/backend/backend.d.ts +1 -1
- package/dist/backend/chat.d.cts +2 -2
- package/dist/backend/chat.d.ts +2 -2
- package/dist/backend/core.d.cts +1 -1
- package/dist/backend/core.d.ts +1 -1
- package/dist/backend/embedding.d.cts +1 -1
- package/dist/backend/embedding.d.ts +1 -1
- package/dist/{base-daM6fHUP.d.cts → base-Csr9guq2.d.cts} +1 -1
- package/dist/{base-mmG-8Pk9.d.ts → base-DHhpWHQm.d.ts} +1 -1
- package/dist/context.d.cts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/emitter/emitter.d.cts +1 -1
- package/dist/emitter/emitter.d.ts +1 -1
- package/dist/emitter/types.d.cts +1 -1
- package/dist/emitter/types.d.ts +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +3 -0
- package/dist/instrumentation/create-telemetry-middleware.d.cts +1 -1
- package/dist/instrumentation/create-telemetry-middleware.d.ts +1 -1
- package/dist/instrumentation/helpers/utils.d.cts +1 -1
- package/dist/instrumentation/helpers/utils.d.ts +1 -1
- package/dist/internals/fetcher.d.cts +1 -1
- package/dist/internals/fetcher.d.ts +1 -1
- package/dist/memory/summarizeMemory.d.cts +1 -1
- package/dist/memory/summarizeMemory.d.ts +1 -1
- package/dist/parsers/linePrefix.d.cts +1 -1
- package/dist/parsers/linePrefix.d.ts +1 -1
- package/dist/tools/arxiv.d.cts +1 -1
- package/dist/tools/arxiv.d.ts +1 -1
- package/dist/tools/base.d.cts +1 -1
- package/dist/tools/base.d.ts +1 -1
- package/dist/tools/calculator.d.cts +1 -1
- package/dist/tools/calculator.d.ts +1 -1
- package/dist/tools/custom.d.cts +1 -1
- package/dist/tools/custom.d.ts +1 -1
- package/dist/tools/database/elasticsearch.d.cts +1 -1
- package/dist/tools/database/elasticsearch.d.ts +1 -1
- package/dist/tools/database/milvus.d.cts +3 -3
- package/dist/tools/database/milvus.d.ts +3 -3
- package/dist/tools/database/sql.d.cts +1 -1
- package/dist/tools/database/sql.d.ts +1 -1
- package/dist/tools/llm.d.cts +1 -1
- package/dist/tools/llm.d.ts +1 -1
- package/dist/tools/mcp.d.cts +1 -1
- package/dist/tools/mcp.d.ts +1 -1
- package/dist/tools/openapi.d.cts +1 -1
- package/dist/tools/openapi.d.ts +1 -1
- package/dist/tools/python/output.d.cts +1 -1
- package/dist/tools/python/output.d.ts +1 -1
- package/dist/tools/python/python.d.cts +1 -1
- package/dist/tools/python/python.d.ts +1 -1
- package/dist/tools/search/base.d.cts +1 -1
- package/dist/tools/search/base.d.ts +1 -1
- package/dist/tools/search/duckDuckGoSearch.d.cts +1 -1
- package/dist/tools/search/duckDuckGoSearch.d.ts +1 -1
- package/dist/tools/search/googleSearch.d.cts +1 -1
- package/dist/tools/search/googleSearch.d.ts +1 -1
- package/dist/tools/search/searXNGSearch.d.cts +1 -1
- package/dist/tools/search/searXNGSearch.d.ts +1 -1
- package/dist/tools/search/wikipedia.d.cts +1 -1
- package/dist/tools/search/wikipedia.d.ts +1 -1
- package/dist/tools/similarity.d.cts +1 -1
- package/dist/tools/similarity.d.ts +1 -1
- package/dist/tools/weather/openMeteo.d.cts +1 -1
- package/dist/tools/weather/openMeteo.d.ts +1 -1
- package/dist/tools/web/webCrawler.d.cts +1 -1
- package/dist/tools/web/webCrawler.d.ts +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/workflows/agent.cjs +28 -20
- package/dist/workflows/agent.cjs.map +1 -1
- package/dist/workflows/agent.d.cts +223 -43
- package/dist/workflows/agent.d.ts +223 -43
- package/dist/workflows/agent.js +29 -21
- package/dist/workflows/agent.js.map +1 -1
- package/dist/workflows/workflow.d.cts +1 -1
- package/dist/workflows/workflow.d.ts +1 -1
- package/package.json +5 -5
- package/dist/{emitter-C9EN5B0j.d.cts → emitter-BWtGHYn0.d.cts} +1 -1
- package/dist/{emitter-BxVxGBbJ.d.ts → emitter-l0W9gC1A.d.ts} +1 -1
package/README.md
CHANGED
|
@@ -46,54 +46,60 @@ The following example demonstrates how to build a multi-agent workflow using the
|
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
import "dotenv/config";
|
|
49
|
-
import { UnconstrainedMemory } from "beeai-framework/memory/unconstrainedMemory";
|
|
50
49
|
import { OpenMeteoTool } from "beeai-framework/tools/weather/openMeteo";
|
|
51
50
|
import { WikipediaTool } from "beeai-framework/tools/search/wikipedia";
|
|
52
|
-
import { AgentWorkflow } from "beeai-framework/
|
|
53
|
-
import {
|
|
54
|
-
import { GroqChatLLM } from "beeai-framework/adapters/groq/chat";
|
|
51
|
+
import { AgentWorkflow } from "beeai-framework/workflows/agent";
|
|
52
|
+
import { OllamaChatModel } from "beeai-framework/adapters/ollama/backend/chat";
|
|
55
53
|
|
|
56
54
|
const workflow = new AgentWorkflow();
|
|
57
55
|
|
|
58
56
|
workflow.addAgent({
|
|
59
57
|
name: "Researcher",
|
|
60
|
-
|
|
58
|
+
role: "A diligent researcher",
|
|
59
|
+
instructions: "You look up and provide information about a specific topic.",
|
|
61
60
|
tools: [new WikipediaTool()],
|
|
62
|
-
llm: new
|
|
61
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
63
62
|
});
|
|
64
63
|
|
|
65
64
|
workflow.addAgent({
|
|
66
65
|
name: "WeatherForecaster",
|
|
67
|
-
|
|
66
|
+
role: "A weather reporter",
|
|
67
|
+
instructions: "You provide detailed weather reports.",
|
|
68
68
|
tools: [new OpenMeteoTool()],
|
|
69
|
-
llm: new
|
|
70
|
-
execution: { maxIterations: 3 },
|
|
69
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
71
70
|
});
|
|
72
71
|
|
|
73
72
|
workflow.addAgent({
|
|
74
|
-
name: "
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
llm: new
|
|
73
|
+
name: "DataSynthesizer",
|
|
74
|
+
role: "A meticulous and creative data synthesizer",
|
|
75
|
+
instructions: "You can combine disparate information into a final coherent summary.",
|
|
76
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
78
77
|
});
|
|
79
78
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
const location = "Saint-Tropez";
|
|
80
|
+
await workflow
|
|
81
|
+
.run([
|
|
82
|
+
{
|
|
83
|
+
prompt: `Provide a short history of ${location}.`,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
prompt: `Provide a comprehensive weather summary for ${location} today.`,
|
|
87
|
+
expectedOutput:
|
|
88
|
+
"Essential weather details such as chance of rain, temperature and wind. Only report information that is available.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
prompt: `Summarize the historical and weather data for ${location}.`,
|
|
92
|
+
expectedOutput: `A paragraph that describes the history of ${location}, followed by the current weather conditions.`,
|
|
93
|
+
},
|
|
94
|
+
])
|
|
95
|
+
.observe((emitter) => {
|
|
96
|
+
emitter.on("success", (data) => {
|
|
97
|
+
console.log(
|
|
98
|
+
`-> ${data.step} has been completed with the following outcome\n`,
|
|
99
|
+
data?.state.finalAnswer ?? "-",
|
|
100
|
+
);
|
|
101
|
+
});
|
|
93
102
|
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
console.log(`Agent 🤖`, result.finalAnswer);
|
|
97
103
|
```
|
|
98
104
|
|
|
99
105
|
### Running the example
|
|
@@ -9,7 +9,7 @@ import '../../../backend/chat.cjs';
|
|
|
9
9
|
import '../../../backend/message.cjs';
|
|
10
10
|
import 'ai';
|
|
11
11
|
import '../../../context.cjs';
|
|
12
|
-
import '../../../emitter-
|
|
12
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
13
13
|
import '../../../internals/helpers/promise.cjs';
|
|
14
14
|
import '../../../errors.cjs';
|
|
15
15
|
import 'promise-based-task';
|
|
@@ -9,7 +9,7 @@ import '../../../backend/chat.js';
|
|
|
9
9
|
import '../../../backend/message.js';
|
|
10
10
|
import 'ai';
|
|
11
11
|
import '../../../context.js';
|
|
12
|
-
import '../../../emitter-
|
|
12
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
13
13
|
import '../../../internals/helpers/promise.js';
|
|
14
14
|
import '../../../errors.js';
|
|
15
15
|
import 'promise-based-task';
|
|
@@ -3,7 +3,7 @@ import { AmazonBedrockProvider } from '@ai-sdk/amazon-bedrock';
|
|
|
3
3
|
import { AmazonBedrockClient, AmazonBedrockClientSettings } from './client.cjs';
|
|
4
4
|
import '../../../backend/embedding.cjs';
|
|
5
5
|
import '../../../context.cjs';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
7
7
|
import '../../../internals/types.cjs';
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import '../../../internals/serializable.cjs';
|
|
@@ -3,7 +3,7 @@ import { AmazonBedrockProvider } from '@ai-sdk/amazon-bedrock';
|
|
|
3
3
|
import { AmazonBedrockClient, AmazonBedrockClientSettings } from './client.js';
|
|
4
4
|
import '../../../backend/embedding.js';
|
|
5
5
|
import '../../../context.js';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
7
7
|
import '../../../internals/types.js';
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import '../../../internals/serializable.js';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.cjs';
|
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.cjs';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
12
12
|
import '../../../internals/helpers/promise.cjs';
|
|
13
13
|
import '../../../errors.cjs';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.js';
|
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.js';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
12
12
|
import '../../../internals/helpers/promise.js';
|
|
13
13
|
import '../../../errors.js';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -3,7 +3,7 @@ import { AnthropicClientSettings, AnthropicClient } from './client.cjs';
|
|
|
3
3
|
import { AnthropicProvider } from '@ai-sdk/anthropic';
|
|
4
4
|
import '../../../backend/embedding.cjs';
|
|
5
5
|
import '../../../context.cjs';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
7
7
|
import '../../../internals/types.cjs';
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import '../../../internals/serializable.cjs';
|
|
@@ -3,7 +3,7 @@ import { AnthropicClientSettings, AnthropicClient } from './client.js';
|
|
|
3
3
|
import { AnthropicProvider } from '@ai-sdk/anthropic';
|
|
4
4
|
import '../../../backend/embedding.js';
|
|
5
5
|
import '../../../context.js';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
7
7
|
import '../../../internals/types.js';
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import '../../../internals/serializable.js';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.cjs';
|
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.cjs';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
12
12
|
import '../../../internals/helpers/promise.cjs';
|
|
13
13
|
import '../../../errors.cjs';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.js';
|
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.js';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
12
12
|
import '../../../internals/helpers/promise.js';
|
|
13
13
|
import '../../../errors.js';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -3,7 +3,7 @@ import { AzureOpenAIClient, AzureOpenAIClientSettings } from './client.cjs';
|
|
|
3
3
|
import { AzureOpenAIProvider } from '@ai-sdk/azure';
|
|
4
4
|
import '../../../backend/embedding.cjs';
|
|
5
5
|
import '../../../context.cjs';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
7
7
|
import '../../../internals/types.cjs';
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import '../../../internals/serializable.cjs';
|
|
@@ -3,7 +3,7 @@ import { AzureOpenAIClient, AzureOpenAIClientSettings } from './client.js';
|
|
|
3
3
|
import { AzureOpenAIProvider } from '@ai-sdk/azure';
|
|
4
4
|
import '../../../backend/embedding.js';
|
|
5
5
|
import '../../../context.js';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
7
7
|
import '../../../internals/types.js';
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import '../../../internals/serializable.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatModel, ChatModelParameters, ChatModelEvents, ChatModelInput, ChatModelOutput, ChatModelCache } from '../../../backend/chat.cjs';
|
|
2
2
|
import { GetRunContext } from '../../../context.cjs';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-BWtGHYn0.cjs';
|
|
4
4
|
import '../../../backend/message.cjs';
|
|
5
5
|
import '../../../internals/serializable.cjs';
|
|
6
6
|
import '../../../internals/types.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatModel, ChatModelParameters, ChatModelEvents, ChatModelInput, ChatModelOutput, ChatModelCache } from '../../../backend/chat.js';
|
|
2
2
|
import { GetRunContext } from '../../../context.js';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-l0W9gC1A.js';
|
|
4
4
|
import '../../../backend/message.js';
|
|
5
5
|
import '../../../internals/serializable.js';
|
|
6
6
|
import '../../../internals/types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetRunContext } from '../../../context.cjs';
|
|
2
|
-
import { E as Emitter } from '../../../emitter-
|
|
2
|
+
import { E as Emitter } from '../../../emitter-BWtGHYn0.cjs';
|
|
3
3
|
import { EmbeddingModel, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.cjs';
|
|
4
4
|
import '../../../internals/serializable.cjs';
|
|
5
5
|
import '../../../internals/types.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetRunContext } from '../../../context.js';
|
|
2
|
-
import { E as Emitter } from '../../../emitter-
|
|
2
|
+
import { E as Emitter } from '../../../emitter-l0W9gC1A.js';
|
|
3
3
|
import { EmbeddingModel, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.js';
|
|
4
4
|
import '../../../internals/serializable.js';
|
|
5
5
|
import '../../../internals/types.js';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.cjs';
|
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.cjs';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
12
12
|
import '../../../internals/helpers/promise.cjs';
|
|
13
13
|
import '../../../errors.cjs';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.js';
|
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.js';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
12
12
|
import '../../../internals/helpers/promise.js';
|
|
13
13
|
import '../../../errors.js';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.cjs';
|
|
|
7
7
|
import '../../../internals/helpers/guards.cjs';
|
|
8
8
|
import '../../../backend/embedding.cjs';
|
|
9
9
|
import '../../../context.cjs';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
11
11
|
import '../../../internals/helpers/promise.cjs';
|
|
12
12
|
import '../../../errors.cjs';
|
|
13
13
|
import '../../../backend/utils.cjs';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.js';
|
|
|
7
7
|
import '../../../internals/helpers/guards.js';
|
|
8
8
|
import '../../../backend/embedding.js';
|
|
9
9
|
import '../../../context.js';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
11
11
|
import '../../../internals/helpers/promise.js';
|
|
12
12
|
import '../../../errors.js';
|
|
13
13
|
import '../../../backend/utils.js';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.cjs';
|
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.cjs';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
12
12
|
import '../../../internals/helpers/promise.cjs';
|
|
13
13
|
import '../../../errors.cjs';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.js';
|
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.js';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
12
12
|
import '../../../internals/helpers/promise.js';
|
|
13
13
|
import '../../../errors.js';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -3,7 +3,7 @@ import { GroqClientSettings, GroqClient } from './client.cjs';
|
|
|
3
3
|
import { GroqProvider } from '@ai-sdk/groq';
|
|
4
4
|
import '../../../backend/embedding.cjs';
|
|
5
5
|
import '../../../context.cjs';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
7
7
|
import '../../../internals/types.cjs';
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import '../../../internals/serializable.cjs';
|
|
@@ -3,7 +3,7 @@ import { GroqClientSettings, GroqClient } from './client.js';
|
|
|
3
3
|
import { GroqProvider } from '@ai-sdk/groq';
|
|
4
4
|
import '../../../backend/embedding.js';
|
|
5
5
|
import '../../../context.js';
|
|
6
|
-
import '../../../emitter-
|
|
6
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
7
7
|
import '../../../internals/types.js';
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import '../../../internals/serializable.js';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/serializable.cjs';
|
|
|
7
7
|
import '../../../internals/types.cjs';
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
11
11
|
import '../../../errors.cjs';
|
|
12
12
|
import 'promise-based-task';
|
|
13
13
|
import '../../../cache/base.cjs';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/serializable.js';
|
|
|
7
7
|
import '../../../internals/types.js';
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
11
11
|
import '../../../errors.js';
|
|
12
12
|
import 'promise-based-task';
|
|
13
13
|
import '../../../cache/base.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbeddingModel, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.cjs';
|
|
2
2
|
import { RunContext } from '../../../context.cjs';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-BWtGHYn0.cjs';
|
|
4
4
|
import { Embeddings } from '@langchain/core/embeddings';
|
|
5
5
|
import '../../../internals/serializable.cjs';
|
|
6
6
|
import '../../../internals/types.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbeddingModel, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.js';
|
|
2
2
|
import { RunContext } from '../../../context.js';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-l0W9gC1A.js';
|
|
4
4
|
import { Embeddings } from '@langchain/core/embeddings';
|
|
5
5
|
import '../../../internals/serializable.js';
|
|
6
6
|
import '../../../internals/types.js';
|
|
@@ -4,7 +4,7 @@ import { BaseToolRunOptions, BaseToolOptions, JSONToolOutput, Tool, ToolEmitter,
|
|
|
4
4
|
import { GetRunContext } from '../../context.cjs';
|
|
5
5
|
import { RunnableConfig } from '@langchain/core/runnables';
|
|
6
6
|
import * as LCTools from '@langchain/core/tools';
|
|
7
|
-
import { E as Emitter } from '../../emitter-
|
|
7
|
+
import { E as Emitter } from '../../emitter-BWtGHYn0.cjs';
|
|
8
8
|
import '../../internals/serializable.cjs';
|
|
9
9
|
import '../../internals/types.cjs';
|
|
10
10
|
import '../../internals/helpers/guards.cjs';
|
|
@@ -4,7 +4,7 @@ import { BaseToolRunOptions, BaseToolOptions, JSONToolOutput, Tool, ToolEmitter,
|
|
|
4
4
|
import { GetRunContext } from '../../context.js';
|
|
5
5
|
import { RunnableConfig } from '@langchain/core/runnables';
|
|
6
6
|
import * as LCTools from '@langchain/core/tools';
|
|
7
|
-
import { E as Emitter } from '../../emitter-
|
|
7
|
+
import { E as Emitter } from '../../emitter-l0W9gC1A.js';
|
|
8
8
|
import '../../internals/serializable.js';
|
|
9
9
|
import '../../internals/types.js';
|
|
10
10
|
import '../../internals/helpers/guards.js';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.cjs';
|
|
|
8
8
|
import '../../../internals/helpers/guards.cjs';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.cjs';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
12
12
|
import '../../../internals/helpers/promise.cjs';
|
|
13
13
|
import '../../../errors.cjs';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -8,7 +8,7 @@ import '../../../internals/types.js';
|
|
|
8
8
|
import '../../../internals/helpers/guards.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import '../../../context.js';
|
|
11
|
-
import '../../../emitter-
|
|
11
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
12
12
|
import '../../../internals/helpers/promise.js';
|
|
13
13
|
import '../../../errors.js';
|
|
14
14
|
import 'promise-based-task';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.cjs';
|
|
|
7
7
|
import '../../../internals/helpers/guards.cjs';
|
|
8
8
|
import '../../../backend/embedding.cjs';
|
|
9
9
|
import '../../../context.cjs';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
11
11
|
import '../../../internals/helpers/promise.cjs';
|
|
12
12
|
import '../../../errors.cjs';
|
|
13
13
|
import '../../../backend/utils.cjs';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.js';
|
|
|
7
7
|
import '../../../internals/helpers/guards.js';
|
|
8
8
|
import '../../../backend/embedding.js';
|
|
9
9
|
import '../../../context.js';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
11
11
|
import '../../../internals/helpers/promise.js';
|
|
12
12
|
import '../../../errors.js';
|
|
13
13
|
import '../../../backend/utils.js';
|
|
@@ -9,7 +9,7 @@ import '../../../backend/chat.cjs';
|
|
|
9
9
|
import '../../../backend/message.cjs';
|
|
10
10
|
import 'ai';
|
|
11
11
|
import '../../../context.cjs';
|
|
12
|
-
import '../../../emitter-
|
|
12
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
13
13
|
import '../../../internals/helpers/promise.cjs';
|
|
14
14
|
import '../../../errors.cjs';
|
|
15
15
|
import 'promise-based-task';
|
|
@@ -9,7 +9,7 @@ import '../../../backend/chat.js';
|
|
|
9
9
|
import '../../../backend/message.js';
|
|
10
10
|
import 'ai';
|
|
11
11
|
import '../../../context.js';
|
|
12
|
-
import '../../../emitter-
|
|
12
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
13
13
|
import '../../../internals/helpers/promise.js';
|
|
14
14
|
import '../../../errors.js';
|
|
15
15
|
import 'promise-based-task';
|
|
@@ -15,11 +15,18 @@ class OpenAIClient extends client_cjs.BackendClient {
|
|
|
15
15
|
const extraHeaders = env_cjs.parseEnv("OPENAI_API_HEADERS", zod.z.preprocess((value) => {
|
|
16
16
|
return Object.fromEntries(String(value || "").split(",").filter((pair) => pair.includes("=")).map((pair) => pair.split("=")));
|
|
17
17
|
}, zod.z.record(zod.z.string())));
|
|
18
|
+
const baseURL = this.settings?.baseURL || env_cjs.getEnv("OPENAI_API_ENDPOINT");
|
|
19
|
+
let compatibility = this.settings?.compatibility || env_cjs.getEnv("OPENAI_COMPATIBILITY_MODE");
|
|
20
|
+
if (baseURL && !compatibility) {
|
|
21
|
+
compatibility = "compatible";
|
|
22
|
+
} else if (!baseURL && !compatibility) {
|
|
23
|
+
compatibility = "strict";
|
|
24
|
+
}
|
|
18
25
|
return openai.createOpenAI({
|
|
19
26
|
...this.settings,
|
|
20
|
-
compatibility
|
|
27
|
+
compatibility,
|
|
21
28
|
apiKey: this.settings?.apiKey || env_cjs.getEnv("OPENAI_API_KEY"),
|
|
22
|
-
baseURL
|
|
29
|
+
baseURL,
|
|
23
30
|
headers: {
|
|
24
31
|
...extraHeaders,
|
|
25
32
|
...this.settings?.headers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["client.ts"],"names":["OpenAIClient","BackendClient","create","extraHeaders","parseEnv","z","preprocess","value","Object","fromEntries","String","split","filter","pair","includes","map","record","string","
|
|
1
|
+
{"version":3,"sources":["client.ts"],"names":["OpenAIClient","BackendClient","create","extraHeaders","parseEnv","z","preprocess","value","Object","fromEntries","String","split","filter","pair","includes","map","record","string","baseURL","settings","getEnv","compatibility","createOpenAI","apiKey","headers"],"mappings":";;;;;;;;;AAuBO,MAAMA,qBAAqBC,wBAAAA,CAAAA;EAvBlC;;;EAwBYC,MAAyB,GAAA;AACjC,IAAA,MAAMC,eAAeC,gBACnB,CAAA,oBAAA,EACAC,KAAEC,CAAAA,UAAAA,CAAW,CAACC,KAAAA,KAAAA;AACZ,MAAOC,OAAAA,MAAAA,CAAOC,WACZC,CAAAA,MAAAA,CAAOH,KAAS,IAAA,EAAA,EACbI,KAAM,CAAA,GAAA,CACNC,CAAAA,MAAAA,CAAO,CAACC,IAAAA,KAASA,KAAKC,QAAS,CAAA,GAAA,CAAA,CAAA,CAC/BC,GAAI,CAAA,CAACF,SAASA,IAAKF,CAAAA,KAAAA,CAAM,GAAA,CAAA,CAAA,CAAA;AAEhC,KAAA,EAAGN,MAAEW,MAAOX,CAAAA,KAAAA,CAAEY,MAAM,EAAA,CAAA,CAAA,CAAA;AAGtB,IAAA,MAAMC,OAAU,GAAA,IAAA,CAAKC,QAAUD,EAAAA,OAAAA,IAAWE,eAAO,qBAAA,CAAA;AACjD,IAAA,IAAIC,aACF,GAAA,IAAA,CAAKF,QAAUE,EAAAA,aAAAA,IAAiBD,eAAO,2BAAA,CAAA;AACzC,IAAIF,IAAAA,OAAAA,IAAW,CAACG,aAAe,EAAA;AAC7BA,MAAgB,aAAA,GAAA,YAAA;KACP,MAAA,IAAA,CAACH,OAAW,IAAA,CAACG,aAAe,EAAA;AACrCA,MAAgB,aAAA,GAAA,QAAA;AAClB;AAEA,IAAA,OAAOC,mBAAa,CAAA;AAClB,MAAA,GAAG,IAAKH,CAAAA,QAAAA;AACRE,MAAAA,aAAAA;AACAE,MAAAA,MAAAA,EAAQ,IAAKJ,CAAAA,QAAAA,EAAUI,MAAUH,IAAAA,cAAAA,CAAO,gBAAA,CAAA;AACxCF,MAAAA,OAAAA;MACAM,OAAS,EAAA;QACP,GAAGrB,YAAAA;AACH,QAAA,GAAG,KAAKgB,QAAUK,EAAAA;AACpB;KACF,CAAA;AACF;AACF","file":"client.cjs","sourcesContent":["/**\n * Copyright 2025 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createOpenAI, OpenAIProvider, OpenAIProviderSettings } from \"@ai-sdk/openai\";\nimport { getEnv, parseEnv } from \"@/internals/env.js\";\nimport { z } from \"zod\";\nimport { BackendClient } from \"@/backend/client.js\";\n\nexport type OpenAIClientSettings = OpenAIProviderSettings;\n\nexport class OpenAIClient extends BackendClient<OpenAIClientSettings, OpenAIProvider> {\n protected create(): OpenAIProvider {\n const extraHeaders = parseEnv(\n \"OPENAI_API_HEADERS\",\n z.preprocess((value) => {\n return Object.fromEntries(\n String(value || \"\")\n .split(\",\")\n .filter((pair) => pair.includes(\"=\"))\n .map((pair) => pair.split(\"=\")),\n );\n }, z.record(z.string())),\n );\n\n const baseURL = this.settings?.baseURL || getEnv(\"OPENAI_API_ENDPOINT\");\n let compatibility: string | undefined =\n this.settings?.compatibility || getEnv(\"OPENAI_COMPATIBILITY_MODE\");\n if (baseURL && !compatibility) {\n compatibility = \"compatible\";\n } else if (!baseURL && !compatibility) {\n compatibility = \"strict\";\n }\n\n return createOpenAI({\n ...this.settings,\n compatibility: compatibility as \"strict\" | \"compatible\" | undefined,\n apiKey: this.settings?.apiKey || getEnv(\"OPENAI_API_KEY\"),\n baseURL,\n headers: {\n ...extraHeaders,\n ...this.settings?.headers,\n },\n });\n }\n}\n"]}
|
|
@@ -13,11 +13,18 @@ class OpenAIClient extends BackendClient {
|
|
|
13
13
|
const extraHeaders = parseEnv("OPENAI_API_HEADERS", z.preprocess((value) => {
|
|
14
14
|
return Object.fromEntries(String(value || "").split(",").filter((pair) => pair.includes("=")).map((pair) => pair.split("=")));
|
|
15
15
|
}, z.record(z.string())));
|
|
16
|
+
const baseURL = this.settings?.baseURL || getEnv("OPENAI_API_ENDPOINT");
|
|
17
|
+
let compatibility = this.settings?.compatibility || getEnv("OPENAI_COMPATIBILITY_MODE");
|
|
18
|
+
if (baseURL && !compatibility) {
|
|
19
|
+
compatibility = "compatible";
|
|
20
|
+
} else if (!baseURL && !compatibility) {
|
|
21
|
+
compatibility = "strict";
|
|
22
|
+
}
|
|
16
23
|
return createOpenAI({
|
|
17
24
|
...this.settings,
|
|
18
|
-
compatibility
|
|
25
|
+
compatibility,
|
|
19
26
|
apiKey: this.settings?.apiKey || getEnv("OPENAI_API_KEY"),
|
|
20
|
-
baseURL
|
|
27
|
+
baseURL,
|
|
21
28
|
headers: {
|
|
22
29
|
...extraHeaders,
|
|
23
30
|
...this.settings?.headers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["client.ts"],"names":["OpenAIClient","BackendClient","create","extraHeaders","parseEnv","z","preprocess","value","Object","fromEntries","String","split","filter","pair","includes","map","record","string","
|
|
1
|
+
{"version":3,"sources":["client.ts"],"names":["OpenAIClient","BackendClient","create","extraHeaders","parseEnv","z","preprocess","value","Object","fromEntries","String","split","filter","pair","includes","map","record","string","baseURL","settings","getEnv","compatibility","createOpenAI","apiKey","headers"],"mappings":";;;;;;;AAuBO,MAAMA,qBAAqBC,aAAAA,CAAAA;EAvBlC;;;EAwBYC,MAAyB,GAAA;AACjC,IAAA,MAAMC,eAAeC,QACnB,CAAA,oBAAA,EACAC,CAAEC,CAAAA,UAAAA,CAAW,CAACC,KAAAA,KAAAA;AACZ,MAAOC,OAAAA,MAAAA,CAAOC,WACZC,CAAAA,MAAAA,CAAOH,KAAS,IAAA,EAAA,EACbI,KAAM,CAAA,GAAA,CACNC,CAAAA,MAAAA,CAAO,CAACC,IAAAA,KAASA,KAAKC,QAAS,CAAA,GAAA,CAAA,CAAA,CAC/BC,GAAI,CAAA,CAACF,SAASA,IAAKF,CAAAA,KAAAA,CAAM,GAAA,CAAA,CAAA,CAAA;AAEhC,KAAA,EAAGN,EAAEW,MAAOX,CAAAA,CAAAA,CAAEY,MAAM,EAAA,CAAA,CAAA,CAAA;AAGtB,IAAA,MAAMC,OAAU,GAAA,IAAA,CAAKC,QAAUD,EAAAA,OAAAA,IAAWE,OAAO,qBAAA,CAAA;AACjD,IAAA,IAAIC,aACF,GAAA,IAAA,CAAKF,QAAUE,EAAAA,aAAAA,IAAiBD,OAAO,2BAAA,CAAA;AACzC,IAAIF,IAAAA,OAAAA,IAAW,CAACG,aAAe,EAAA;AAC7BA,MAAgB,aAAA,GAAA,YAAA;KACP,MAAA,IAAA,CAACH,OAAW,IAAA,CAACG,aAAe,EAAA;AACrCA,MAAgB,aAAA,GAAA,QAAA;AAClB;AAEA,IAAA,OAAOC,YAAa,CAAA;AAClB,MAAA,GAAG,IAAKH,CAAAA,QAAAA;AACRE,MAAAA,aAAAA;AACAE,MAAAA,MAAAA,EAAQ,IAAKJ,CAAAA,QAAAA,EAAUI,MAAUH,IAAAA,MAAAA,CAAO,gBAAA,CAAA;AACxCF,MAAAA,OAAAA;MACAM,OAAS,EAAA;QACP,GAAGrB,YAAAA;AACH,QAAA,GAAG,KAAKgB,QAAUK,EAAAA;AACpB;KACF,CAAA;AACF;AACF","file":"client.js","sourcesContent":["/**\n * Copyright 2025 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createOpenAI, OpenAIProvider, OpenAIProviderSettings } from \"@ai-sdk/openai\";\nimport { getEnv, parseEnv } from \"@/internals/env.js\";\nimport { z } from \"zod\";\nimport { BackendClient } from \"@/backend/client.js\";\n\nexport type OpenAIClientSettings = OpenAIProviderSettings;\n\nexport class OpenAIClient extends BackendClient<OpenAIClientSettings, OpenAIProvider> {\n protected create(): OpenAIProvider {\n const extraHeaders = parseEnv(\n \"OPENAI_API_HEADERS\",\n z.preprocess((value) => {\n return Object.fromEntries(\n String(value || \"\")\n .split(\",\")\n .filter((pair) => pair.includes(\"=\"))\n .map((pair) => pair.split(\"=\")),\n );\n }, z.record(z.string())),\n );\n\n const baseURL = this.settings?.baseURL || getEnv(\"OPENAI_API_ENDPOINT\");\n let compatibility: string | undefined =\n this.settings?.compatibility || getEnv(\"OPENAI_COMPATIBILITY_MODE\");\n if (baseURL && !compatibility) {\n compatibility = \"compatible\";\n } else if (!baseURL && !compatibility) {\n compatibility = \"strict\";\n }\n\n return createOpenAI({\n ...this.settings,\n compatibility: compatibility as \"strict\" | \"compatible\" | undefined,\n apiKey: this.settings?.apiKey || getEnv(\"OPENAI_API_KEY\"),\n baseURL,\n headers: {\n ...extraHeaders,\n ...this.settings?.headers,\n },\n });\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.cjs';
|
|
|
7
7
|
import '../../../internals/helpers/guards.cjs';
|
|
8
8
|
import '../../../backend/embedding.cjs';
|
|
9
9
|
import '../../../context.cjs';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-BWtGHYn0.cjs';
|
|
11
11
|
import '../../../internals/helpers/promise.cjs';
|
|
12
12
|
import '../../../errors.cjs';
|
|
13
13
|
import '../../../backend/utils.cjs';
|
|
@@ -7,7 +7,7 @@ import '../../../internals/types.js';
|
|
|
7
7
|
import '../../../internals/helpers/guards.js';
|
|
8
8
|
import '../../../backend/embedding.js';
|
|
9
9
|
import '../../../context.js';
|
|
10
|
-
import '../../../emitter-
|
|
10
|
+
import '../../../emitter-l0W9gC1A.js';
|
|
11
11
|
import '../../../internals/helpers/promise.js';
|
|
12
12
|
import '../../../errors.js';
|
|
13
13
|
import '../../../backend/utils.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatModel, ChatModelEvents, ChatModelInput, ChatModelOutput, ChatModelObjectInput, ChatModelObjectOutput, ChatModelCache, ChatModelParameters } from '../../../backend/chat.cjs';
|
|
2
2
|
import { LanguageModelV1, generateText, CoreAssistantMessage, CoreToolMessage } from 'ai';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-BWtGHYn0.cjs';
|
|
4
4
|
import { Message } from '../../../backend/message.cjs';
|
|
5
5
|
import { GetRunContext } from '../../../context.cjs';
|
|
6
6
|
import '../../../internals/serializable.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatModel, ChatModelEvents, ChatModelInput, ChatModelOutput, ChatModelObjectInput, ChatModelObjectOutput, ChatModelCache, ChatModelParameters } from '../../../backend/chat.js';
|
|
2
2
|
import { LanguageModelV1, generateText, CoreAssistantMessage, CoreToolMessage } from 'ai';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-l0W9gC1A.js';
|
|
4
4
|
import { Message } from '../../../backend/message.js';
|
|
5
5
|
import { GetRunContext } from '../../../context.js';
|
|
6
6
|
import '../../../internals/serializable.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbeddingModel as EmbeddingModel$1, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.cjs';
|
|
2
2
|
import { EmbeddingModel } from 'ai';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-BWtGHYn0.cjs';
|
|
4
4
|
import { GetRunContext } from '../../../context.cjs';
|
|
5
5
|
import '../../../internals/serializable.cjs';
|
|
6
6
|
import '../../../internals/types.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbeddingModel as EmbeddingModel$1, EmbeddingModelEvents, EmbeddingModelInput, EmbeddingModelOutput } from '../../../backend/embedding.js';
|
|
2
2
|
import { EmbeddingModel } from 'ai';
|
|
3
|
-
import { E as Emitter } from '../../../emitter-
|
|
3
|
+
import { E as Emitter } from '../../../emitter-l0W9gC1A.js';
|
|
4
4
|
import { GetRunContext } from '../../../context.js';
|
|
5
5
|
import '../../../internals/serializable.js';
|
|
6
6
|
import '../../../internals/types.js';
|