beeai-framework 0.1.7 → 0.1.9
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 +56 -43
- 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/agents/base.cjs +1 -4
- package/dist/agents/base.cjs.map +1 -1
- package/dist/agents/base.js +1 -4
- package/dist/agents/base.js.map +1 -1
- package/dist/agents/react/prompts.d.cts +4 -4
- package/dist/agents/react/prompts.d.ts +4 -4
- package/dist/agents/react/runners/deep-think/prompts.d.cts +4 -4
- package/dist/agents/react/runners/deep-think/prompts.d.ts +4 -4
- package/dist/agents/react/runners/deep-think/runner.d.cts +4 -4
- package/dist/agents/react/runners/deep-think/runner.d.ts +4 -4
- package/dist/agents/react/runners/default/runner.d.cts +4 -4
- package/dist/agents/react/runners/default/runner.d.ts +4 -4
- package/dist/agents/react/runners/granite/prompts.d.cts +4 -4
- package/dist/agents/react/runners/granite/prompts.d.ts +4 -4
- package/dist/agents/react/runners/granite/runner.d.cts +6 -6
- package/dist/agents/react/runners/granite/runner.d.ts +6 -6
- 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/backend/chat.cjs +1 -3
- package/dist/backend/chat.cjs.map +1 -1
- package/dist/backend/chat.d.cts +2 -2
- package/dist/backend/chat.d.ts +2 -2
- package/dist/backend/chat.js +2 -4
- package/dist/backend/chat.js.map +1 -1
- package/dist/backend/embedding.d.cts +1 -1
- package/dist/backend/embedding.d.ts +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +3 -0
- package/dist/tools/base.cjs +1 -3
- package/dist/tools/base.cjs.map +1 -1
- package/dist/tools/base.js +2 -4
- package/dist/tools/base.js.map +1 -1
- package/dist/tools/database/milvus.d.cts +4 -4
- package/dist/tools/database/milvus.d.ts +4 -4
- 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 +221 -41
- package/dist/workflows/agent.d.ts +221 -41
- package/dist/workflows/agent.js +29 -21
- package/dist/workflows/agent.js.map +1 -1
- package/package.json +5 -12
- package/dist/instrumentation/config.cjs +0 -12
- package/dist/instrumentation/config.cjs.map +0 -1
- package/dist/instrumentation/config.d.cts +0 -19
- package/dist/instrumentation/config.d.ts +0 -19
- package/dist/instrumentation/config.js +0 -9
- package/dist/instrumentation/config.js.map +0 -1
- package/dist/instrumentation/create-telemetry-middleware.cjs +0 -239
- package/dist/instrumentation/create-telemetry-middleware.cjs.map +0 -1
- package/dist/instrumentation/create-telemetry-middleware.d.cts +0 -26
- package/dist/instrumentation/create-telemetry-middleware.d.ts +0 -26
- package/dist/instrumentation/create-telemetry-middleware.js +0 -237
- package/dist/instrumentation/create-telemetry-middleware.js.map +0 -1
- package/dist/instrumentation/helpers/create-span.cjs +0 -36
- package/dist/instrumentation/helpers/create-span.cjs.map +0 -1
- package/dist/instrumentation/helpers/create-span.d.cts +0 -34
- package/dist/instrumentation/helpers/create-span.d.ts +0 -34
- package/dist/instrumentation/helpers/create-span.js +0 -34
- package/dist/instrumentation/helpers/create-span.js.map +0 -1
- package/dist/instrumentation/helpers/get-error-safe.cjs +0 -20
- package/dist/instrumentation/helpers/get-error-safe.cjs.map +0 -1
- package/dist/instrumentation/helpers/get-error-safe.d.cts +0 -18
- package/dist/instrumentation/helpers/get-error-safe.d.ts +0 -18
- package/dist/instrumentation/helpers/get-error-safe.js +0 -18
- package/dist/instrumentation/helpers/get-error-safe.js.map +0 -1
- package/dist/instrumentation/helpers/get-serialized-object-safe.cjs +0 -27
- package/dist/instrumentation/helpers/get-serialized-object-safe.cjs.map +0 -1
- package/dist/instrumentation/helpers/get-serialized-object-safe.d.cts +0 -18
- package/dist/instrumentation/helpers/get-serialized-object-safe.d.ts +0 -18
- package/dist/instrumentation/helpers/get-serialized-object-safe.js +0 -25
- package/dist/instrumentation/helpers/get-serialized-object-safe.js.map +0 -1
- package/dist/instrumentation/helpers/id-name-manager.cjs +0 -34
- package/dist/instrumentation/helpers/id-name-manager.cjs.map +0 -1
- package/dist/instrumentation/helpers/id-name-manager.d.cts +0 -31
- package/dist/instrumentation/helpers/id-name-manager.d.ts +0 -31
- package/dist/instrumentation/helpers/id-name-manager.js +0 -32
- package/dist/instrumentation/helpers/id-name-manager.js.map +0 -1
- package/dist/instrumentation/helpers/trace-serializer.cjs +0 -30
- package/dist/instrumentation/helpers/trace-serializer.cjs.map +0 -1
- package/dist/instrumentation/helpers/trace-serializer.d.cts +0 -20
- package/dist/instrumentation/helpers/trace-serializer.d.ts +0 -20
- package/dist/instrumentation/helpers/trace-serializer.js +0 -28
- package/dist/instrumentation/helpers/trace-serializer.js.map +0 -1
- package/dist/instrumentation/helpers/utils.cjs +0 -14
- package/dist/instrumentation/helpers/utils.cjs.map +0 -1
- package/dist/instrumentation/helpers/utils.d.cts +0 -40
- package/dist/instrumentation/helpers/utils.d.ts +0 -40
- package/dist/instrumentation/helpers/utils.js +0 -12
- package/dist/instrumentation/helpers/utils.js.map +0 -1
- package/dist/instrumentation/logger.cjs +0 -12
- package/dist/instrumentation/logger.cjs.map +0 -1
- package/dist/instrumentation/logger.d.cts +0 -26
- package/dist/instrumentation/logger.d.ts +0 -26
- package/dist/instrumentation/logger.js +0 -10
- package/dist/instrumentation/logger.js.map +0 -1
- package/dist/instrumentation/tracer.cjs +0 -84
- package/dist/instrumentation/tracer.cjs.map +0 -1
- package/dist/instrumentation/tracer.d.cts +0 -36
- package/dist/instrumentation/tracer.d.ts +0 -36
- package/dist/instrumentation/tracer.js +0 -76
- package/dist/instrumentation/tracer.js.map +0 -1
- package/dist/instrumentation/types.cjs +0 -4
- package/dist/instrumentation/types.cjs.map +0 -1
- package/dist/instrumentation/types.d.cts +0 -39
- package/dist/instrumentation/types.d.ts +0 -39
- package/dist/instrumentation/types.js +0 -3
- package/dist/instrumentation/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,20 +11,27 @@ Build production-ready multi-agent systems in TypeScript. BeeAI framework is als
|
|
|
11
11
|
|
|
12
12
|
The source directory (`src`) contains the available modules:
|
|
13
13
|
|
|
14
|
-
| Name
|
|
15
|
-
|
|
|
16
|
-
| [**agents**](/typescript/docs/agents.md)
|
|
17
|
-
| [**backend**](/typescript/docs/backend.md)
|
|
18
|
-
| [**template**](/typescript/docs/templates.md)
|
|
19
|
-
| [**memory**](/typescript/docs/memory.md)
|
|
20
|
-
| [**tools**](/typescript/docs/tools.md)
|
|
21
|
-
| [**cache**](/typescript/docs/cache.md)
|
|
22
|
-
| [**errors**](/typescript/docs/errors.md)
|
|
23
|
-
| [**logger**](/typescript/docs/logger.md)
|
|
24
|
-
| [**serializer**](/typescript/docs/serialization.md)
|
|
25
|
-
| [**version**](/typescript/docs/version.md)
|
|
26
|
-
| [**emitter**](/typescript/docs/emitter.md)
|
|
27
|
-
|
|
14
|
+
| Name | Description |
|
|
15
|
+
| --------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
16
|
+
| [**agents**](/typescript/docs/agents.md) | Base classes defining the common interface for agent. |
|
|
17
|
+
| [**backend**](/typescript/docs/backend.md) | Functionalities that relates to AI models (chat, embedding, image, tool calling, ...) |
|
|
18
|
+
| [**template**](/typescript/docs/templates.md) | Prompt Templating system based on `Mustache` with various improvements. |
|
|
19
|
+
| [**memory**](/typescript/docs/memory.md) | Various types of memories to use with agent. |
|
|
20
|
+
| [**tools**](/typescript/docs/tools.md) | Tools that an agent can use. |
|
|
21
|
+
| [**cache**](/typescript/docs/cache.md) | Preset of different caching approaches that can be used together with tools. |
|
|
22
|
+
| [**errors**](/typescript/docs/errors.md) | Base framework error classes used by each module. |
|
|
23
|
+
| [**logger**](/typescript/docs/logger.md) | Core component for logging all actions within the framework. |
|
|
24
|
+
| [**serializer**](/typescript/docs/serialization.md) | Core component for the ability to serialize/deserialize modules into the serialized format. |
|
|
25
|
+
| [**version**](/typescript/docs/version.md) | Constants representing the framework (e.g., the latest version) |
|
|
26
|
+
| [**emitter**](/typescript/docs/emitter.md) | Bringing visibility to the system by emitting events. |
|
|
27
|
+
|
|
28
|
+
## External modules
|
|
29
|
+
|
|
30
|
+
Use these packages to extend the base BeeAI framework functionality:
|
|
31
|
+
|
|
32
|
+
| Name | Description |
|
|
33
|
+
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
34
|
+
| [**instrumentation**](https://github.com/Arize-ai/openinference/tree/main/js/packages/openinference-instrumentation-beeai) | Integrate monitoring tools into your application. |
|
|
28
35
|
|
|
29
36
|
## Installation
|
|
30
37
|
|
|
@@ -46,54 +53,60 @@ The following example demonstrates how to build a multi-agent workflow using the
|
|
|
46
53
|
|
|
47
54
|
```ts
|
|
48
55
|
import "dotenv/config";
|
|
49
|
-
import { UnconstrainedMemory } from "beeai-framework/memory/unconstrainedMemory";
|
|
50
56
|
import { OpenMeteoTool } from "beeai-framework/tools/weather/openMeteo";
|
|
51
57
|
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";
|
|
58
|
+
import { AgentWorkflow } from "beeai-framework/workflows/agent";
|
|
59
|
+
import { OllamaChatModel } from "beeai-framework/adapters/ollama/backend/chat";
|
|
55
60
|
|
|
56
61
|
const workflow = new AgentWorkflow();
|
|
57
62
|
|
|
58
63
|
workflow.addAgent({
|
|
59
64
|
name: "Researcher",
|
|
60
|
-
|
|
65
|
+
role: "A diligent researcher",
|
|
66
|
+
instructions: "You look up and provide information about a specific topic.",
|
|
61
67
|
tools: [new WikipediaTool()],
|
|
62
|
-
llm: new
|
|
68
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
63
69
|
});
|
|
64
70
|
|
|
65
71
|
workflow.addAgent({
|
|
66
72
|
name: "WeatherForecaster",
|
|
67
|
-
|
|
73
|
+
role: "A weather reporter",
|
|
74
|
+
instructions: "You provide detailed weather reports.",
|
|
68
75
|
tools: [new OpenMeteoTool()],
|
|
69
|
-
llm: new
|
|
70
|
-
execution: { maxIterations: 3 },
|
|
76
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
71
77
|
});
|
|
72
78
|
|
|
73
79
|
workflow.addAgent({
|
|
74
|
-
name: "
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
llm: new
|
|
80
|
+
name: "DataSynthesizer",
|
|
81
|
+
role: "A meticulous and creative data synthesizer",
|
|
82
|
+
instructions: "You can combine disparate information into a final coherent summary.",
|
|
83
|
+
llm: new OllamaChatModel("llama3.1"),
|
|
78
84
|
});
|
|
79
85
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
const location = "Saint-Tropez";
|
|
87
|
+
await workflow
|
|
88
|
+
.run([
|
|
89
|
+
{
|
|
90
|
+
prompt: `Provide a short history of ${location}.`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
prompt: `Provide a comprehensive weather summary for ${location} today.`,
|
|
94
|
+
expectedOutput:
|
|
95
|
+
"Essential weather details such as chance of rain, temperature and wind. Only report information that is available.",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
prompt: `Summarize the historical and weather data for ${location}.`,
|
|
99
|
+
expectedOutput: `A paragraph that describes the history of ${location}, followed by the current weather conditions.`,
|
|
100
|
+
},
|
|
101
|
+
])
|
|
102
|
+
.observe((emitter) => {
|
|
103
|
+
emitter.on("success", (data) => {
|
|
104
|
+
console.log(
|
|
105
|
+
`-> ${data.step} has been completed with the following outcome\n`,
|
|
106
|
+
data?.state.finalAnswer ?? "-",
|
|
107
|
+
);
|
|
108
|
+
});
|
|
93
109
|
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
console.log(`Agent 🤖`, result.finalAnswer);
|
|
97
110
|
```
|
|
98
111
|
|
|
99
112
|
### Running the example
|
|
@@ -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"]}
|
package/dist/agents/base.cjs
CHANGED
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
var errors_cjs = require('../errors.cjs');
|
|
4
4
|
var serializable_cjs = require('../internals/serializable.cjs');
|
|
5
5
|
var context_cjs = require('../context.cjs');
|
|
6
|
-
var createTelemetryMiddleware_cjs = require('../instrumentation/create-telemetry-middleware.cjs');
|
|
7
|
-
var config_cjs = require('../instrumentation/config.cjs');
|
|
8
|
-
var remeda = require('remeda');
|
|
9
6
|
|
|
10
7
|
var __defProp = Object.defineProperty;
|
|
11
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -44,7 +41,7 @@ class BaseAgent extends serializable_cjs.Serializable {
|
|
|
44
41
|
} finally {
|
|
45
42
|
this.isRunning = false;
|
|
46
43
|
}
|
|
47
|
-
})
|
|
44
|
+
});
|
|
48
45
|
}
|
|
49
46
|
destroy() {
|
|
50
47
|
this.emitter.destroy();
|
package/dist/agents/base.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["base.ts"],"names":["AgentError","FrameworkError","BaseAgent","Serializable","isRunning","run","input","options","RunContext","enter","signal","params","context","_run","e","
|
|
1
|
+
{"version":3,"sources":["base.ts"],"names":["AgentError","FrameworkError","BaseAgent","Serializable","isRunning","run","input","options","RunContext","enter","signal","params","context","_run","e","destroy","emitter","meta","name","constructor","description","tools","createSnapshot","loadSnapshot","snapshot","Object","assign"],"mappings":";;;;;;;;AAuBO,MAAMA,mBAAmBC,yBAAAA,CAAAA;EAvBhC;;;AAuBgD;AAMzC,MAAeC,kBAIZC,6BAAAA,CAAAA;EAjCV;;;EAkCYC,SAAY,GAAA,KAAA;EAIfC,GACF,CAAA,GAAA,CAACC,KAAOC,EAAAA,OAAAA,CAGX,EAAA;AACA,IAAA,IAAI,KAAKH,SAAW,EAAA;AAClB,MAAM,MAAA,IAAIJ,WAAW,2BAAA,CAAA;AACvB;AAEA,IAAOQ,OAAAA,sBAAAA,CAAWC,MAChB,IACA,EAAA;AAAEC,MAAAA,MAAAA,EAAQH,OAASG,EAAAA,MAAAA;MAAQC,MAAQ,EAAA;AAACL,QAAAA,KAAAA;AAAOC,QAAAA;;AAAkB,KAAA,EAC7D,OAAOK,OAAAA,KAAAA;AACL,MAAI,IAAA;AACF,QAAA,IAAA,CAAKR,SAAY,GAAA,IAAA;AAEjB,QAAA,OAAO,MAAM,IAAA,CAAKS,IAAKP,CAAAA,KAAAA,EAAOC,SAASK,OAAAA,CAAAA;AACzC,OAAA,CAAA,OAASE,CAAG,EAAA;AACV,QAAA,IAAIA,aAAad,UAAY,EAAA;AAC3B,UAAMc,MAAAA,CAAAA;SACD,MAAA;AACL,UAAM,MAAA,IAAId,WAAW,CAAuC,mCAAA,CAAA,EAAA;AAACc,YAAAA;AAAE,WAAA,CAAA;AACjE;OACF,SAAA;AACE,QAAA,IAAA,CAAKV,SAAY,GAAA,KAAA;AACnB;KACF,CAAA;AAEJ;EAQAW,OAAU,GAAA;AACR,IAAA,IAAA,CAAKC,QAAQD,OAAO,EAAA;AACtB;AAKA,EAAA,IAAWE,IAAkB,GAAA;AAC3B,IAAO,OAAA;MACLC,IAAM,EAAA,IAAA,CAAKC,YAAYD,IAAQ,IAAA,WAAA;MAC/BE,WAAa,EAAA,EAAA;AACbC,MAAAA,KAAAA,EAAO;AACT,KAAA;AACF;EAEAC,cAAiB,GAAA;AACf,IAAO,OAAA;MAAElB,SAAW,EAAA,KAAA;AAAOY,MAAAA,OAAAA,EAAS,IAAKA,CAAAA;AAAQ,KAAA;AACnD;AAEAO,EAAAA,YAAAA,CAAaC,QAAkD,EAAA;AAC7DC,IAAOC,MAAAA,CAAAA,MAAAA,CAAO,MAAMF,QAAAA,CAAAA;AACtB;AACF","file":"base.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 { FrameworkError } from \"@/errors.js\";\nimport { AgentMeta } from \"@/agents/types.js\";\nimport { Serializable } from \"@/internals/serializable.js\";\nimport { GetRunContext, RunContext } from \"@/context.js\";\nimport { Emitter } from \"@/emitter/emitter.js\";\nimport { BaseMemory } from \"@/memory/base.js\";\n\nexport class AgentError extends FrameworkError {}\n\nexport interface BaseAgentRunOptions {\n signal?: AbortSignal;\n}\n\nexport abstract class BaseAgent<\n TInput,\n TOutput,\n TOptions extends BaseAgentRunOptions = BaseAgentRunOptions,\n> extends Serializable {\n protected isRunning = false;\n\n public abstract readonly emitter: Emitter<unknown>;\n\n public run(\n ...[input, options]: Partial<TOptions> extends TOptions\n ? [input: TInput, options?: TOptions]\n : [input: TInput, options: TOptions]\n ) {\n if (this.isRunning) {\n throw new AgentError(\"Agent is already running!\");\n }\n\n return RunContext.enter(\n this,\n { signal: options?.signal, params: [input, options] as const },\n async (context) => {\n try {\n this.isRunning = true;\n // @ts-expect-error\n return await this._run(input, options, context);\n } catch (e) {\n if (e instanceof AgentError) {\n throw e;\n } else {\n throw new AgentError(`The Agent has encountered an error.`, [e]);\n }\n } finally {\n this.isRunning = false;\n }\n },\n );\n }\n\n protected abstract _run(\n input: TInput,\n options: TOptions,\n run: GetRunContext<typeof this>,\n ): Promise<TOutput>;\n\n destroy() {\n this.emitter.destroy();\n }\n\n public abstract set memory(memory: BaseMemory);\n public abstract get memory(): BaseMemory;\n\n public get meta(): AgentMeta {\n return {\n name: this.constructor.name ?? \"BaseAgent\",\n description: \"\",\n tools: [],\n };\n }\n\n createSnapshot() {\n return { isRunning: false, emitter: this.emitter };\n }\n\n loadSnapshot(snapshot: ReturnType<typeof this.createSnapshot>) {\n Object.assign(this, snapshot);\n }\n}\n"]}
|
package/dist/agents/base.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { FrameworkError } from '../errors.js';
|
|
2
2
|
import { Serializable } from '../internals/serializable.js';
|
|
3
3
|
import { RunContext } from '../context.js';
|
|
4
|
-
import { createTelemetryMiddleware } from '../instrumentation/create-telemetry-middleware.js';
|
|
5
|
-
import { INSTRUMENTATION_ENABLED } from '../instrumentation/config.js';
|
|
6
|
-
import { doNothing } from 'remeda';
|
|
7
4
|
|
|
8
5
|
var __defProp = Object.defineProperty;
|
|
9
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -42,7 +39,7 @@ class BaseAgent extends Serializable {
|
|
|
42
39
|
} finally {
|
|
43
40
|
this.isRunning = false;
|
|
44
41
|
}
|
|
45
|
-
})
|
|
42
|
+
});
|
|
46
43
|
}
|
|
47
44
|
destroy() {
|
|
48
45
|
this.emitter.destroy();
|
package/dist/agents/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["base.ts"],"names":["AgentError","FrameworkError","BaseAgent","Serializable","isRunning","run","input","options","RunContext","enter","signal","params","context","_run","e","
|
|
1
|
+
{"version":3,"sources":["base.ts"],"names":["AgentError","FrameworkError","BaseAgent","Serializable","isRunning","run","input","options","RunContext","enter","signal","params","context","_run","e","destroy","emitter","meta","name","constructor","description","tools","createSnapshot","loadSnapshot","snapshot","Object","assign"],"mappings":";;;;;;AAuBO,MAAMA,mBAAmBC,cAAAA,CAAAA;EAvBhC;;;AAuBgD;AAMzC,MAAeC,kBAIZC,YAAAA,CAAAA;EAjCV;;;EAkCYC,SAAY,GAAA,KAAA;EAIfC,GACF,CAAA,GAAA,CAACC,KAAOC,EAAAA,OAAAA,CAGX,EAAA;AACA,IAAA,IAAI,KAAKH,SAAW,EAAA;AAClB,MAAM,MAAA,IAAIJ,WAAW,2BAAA,CAAA;AACvB;AAEA,IAAOQ,OAAAA,UAAAA,CAAWC,MAChB,IACA,EAAA;AAAEC,MAAAA,MAAAA,EAAQH,OAASG,EAAAA,MAAAA;MAAQC,MAAQ,EAAA;AAACL,QAAAA,KAAAA;AAAOC,QAAAA;;AAAkB,KAAA,EAC7D,OAAOK,OAAAA,KAAAA;AACL,MAAI,IAAA;AACF,QAAA,IAAA,CAAKR,SAAY,GAAA,IAAA;AAEjB,QAAA,OAAO,MAAM,IAAA,CAAKS,IAAKP,CAAAA,KAAAA,EAAOC,SAASK,OAAAA,CAAAA;AACzC,OAAA,CAAA,OAASE,CAAG,EAAA;AACV,QAAA,IAAIA,aAAad,UAAY,EAAA;AAC3B,UAAMc,MAAAA,CAAAA;SACD,MAAA;AACL,UAAM,MAAA,IAAId,WAAW,CAAuC,mCAAA,CAAA,EAAA;AAACc,YAAAA;AAAE,WAAA,CAAA;AACjE;OACF,SAAA;AACE,QAAA,IAAA,CAAKV,SAAY,GAAA,KAAA;AACnB;KACF,CAAA;AAEJ;EAQAW,OAAU,GAAA;AACR,IAAA,IAAA,CAAKC,QAAQD,OAAO,EAAA;AACtB;AAKA,EAAA,IAAWE,IAAkB,GAAA;AAC3B,IAAO,OAAA;MACLC,IAAM,EAAA,IAAA,CAAKC,YAAYD,IAAQ,IAAA,WAAA;MAC/BE,WAAa,EAAA,EAAA;AACbC,MAAAA,KAAAA,EAAO;AACT,KAAA;AACF;EAEAC,cAAiB,GAAA;AACf,IAAO,OAAA;MAAElB,SAAW,EAAA,KAAA;AAAOY,MAAAA,OAAAA,EAAS,IAAKA,CAAAA;AAAQ,KAAA;AACnD;AAEAO,EAAAA,YAAAA,CAAaC,QAAkD,EAAA;AAC7DC,IAAOC,MAAAA,CAAAA,MAAAA,CAAO,MAAMF,QAAAA,CAAAA;AACtB;AACF","file":"base.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 { FrameworkError } from \"@/errors.js\";\nimport { AgentMeta } from \"@/agents/types.js\";\nimport { Serializable } from \"@/internals/serializable.js\";\nimport { GetRunContext, RunContext } from \"@/context.js\";\nimport { Emitter } from \"@/emitter/emitter.js\";\nimport { BaseMemory } from \"@/memory/base.js\";\n\nexport class AgentError extends FrameworkError {}\n\nexport interface BaseAgentRunOptions {\n signal?: AbortSignal;\n}\n\nexport abstract class BaseAgent<\n TInput,\n TOutput,\n TOptions extends BaseAgentRunOptions = BaseAgentRunOptions,\n> extends Serializable {\n protected isRunning = false;\n\n public abstract readonly emitter: Emitter<unknown>;\n\n public run(\n ...[input, options]: Partial<TOptions> extends TOptions\n ? [input: TInput, options?: TOptions]\n : [input: TInput, options: TOptions]\n ) {\n if (this.isRunning) {\n throw new AgentError(\"Agent is already running!\");\n }\n\n return RunContext.enter(\n this,\n { signal: options?.signal, params: [input, options] as const },\n async (context) => {\n try {\n this.isRunning = true;\n // @ts-expect-error\n return await this._run(input, options, context);\n } catch (e) {\n if (e instanceof AgentError) {\n throw e;\n } else {\n throw new AgentError(`The Agent has encountered an error.`, [e]);\n }\n } finally {\n this.isRunning = false;\n }\n },\n );\n }\n\n protected abstract _run(\n input: TInput,\n options: TOptions,\n run: GetRunContext<typeof this>,\n ): Promise<TOutput>;\n\n destroy() {\n this.emitter.destroy();\n }\n\n public abstract set memory(memory: BaseMemory);\n public abstract get memory(): BaseMemory;\n\n public get meta(): AgentMeta {\n return {\n name: this.constructor.name ?? \"BaseAgent\",\n description: \"\",\n tools: [],\n };\n }\n\n createSnapshot() {\n return { isRunning: false, emitter: this.emitter };\n }\n\n loadSnapshot(snapshot: ReturnType<typeof this.createSnapshot>) {\n Object.assign(this, snapshot);\n }\n}\n"]}
|
|
@@ -39,12 +39,12 @@ declare const ReActAgentSystemPrompt: PromptTemplate<z.ZodObject<{
|
|
|
39
39
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
40
40
|
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
instructions: string;
|
|
43
42
|
tools: z.objectOutputType<{
|
|
44
43
|
name: z.ZodString;
|
|
45
44
|
description: z.ZodString;
|
|
46
45
|
schema: z.ZodString;
|
|
47
46
|
}, z.ZodTypeAny, "passthrough">[];
|
|
47
|
+
instructions: string;
|
|
48
48
|
createdAt?: string | null | undefined;
|
|
49
49
|
}, {
|
|
50
50
|
tools: z.objectInputType<{
|
|
@@ -52,8 +52,8 @@ declare const ReActAgentSystemPrompt: PromptTemplate<z.ZodObject<{
|
|
|
52
52
|
description: z.ZodString;
|
|
53
53
|
schema: z.ZodString;
|
|
54
54
|
}, z.ZodTypeAny, "passthrough">[];
|
|
55
|
-
createdAt?: string | null | undefined;
|
|
56
55
|
instructions?: string | undefined;
|
|
56
|
+
createdAt?: string | null | undefined;
|
|
57
57
|
}>>;
|
|
58
58
|
declare const ReActAgentAssistantPrompt: PromptTemplate<z.ZodObject<{
|
|
59
59
|
thought: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -62,14 +62,14 @@ declare const ReActAgentAssistantPrompt: PromptTemplate<z.ZodObject<{
|
|
|
62
62
|
toolOutput: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
63
63
|
finalAnswer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
64
64
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
toolName?: string[] | undefined;
|
|
66
65
|
thought?: string[] | undefined;
|
|
66
|
+
toolName?: string[] | undefined;
|
|
67
67
|
toolInput?: string[] | undefined;
|
|
68
68
|
toolOutput?: string[] | undefined;
|
|
69
69
|
finalAnswer?: string[] | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
toolName?: string[] | undefined;
|
|
72
71
|
thought?: string[] | undefined;
|
|
72
|
+
toolName?: string[] | undefined;
|
|
73
73
|
toolInput?: string[] | undefined;
|
|
74
74
|
toolOutput?: string[] | undefined;
|
|
75
75
|
finalAnswer?: string[] | undefined;
|
|
@@ -39,12 +39,12 @@ declare const ReActAgentSystemPrompt: PromptTemplate<z.ZodObject<{
|
|
|
39
39
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
40
40
|
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
instructions: string;
|
|
43
42
|
tools: z.objectOutputType<{
|
|
44
43
|
name: z.ZodString;
|
|
45
44
|
description: z.ZodString;
|
|
46
45
|
schema: z.ZodString;
|
|
47
46
|
}, z.ZodTypeAny, "passthrough">[];
|
|
47
|
+
instructions: string;
|
|
48
48
|
createdAt?: string | null | undefined;
|
|
49
49
|
}, {
|
|
50
50
|
tools: z.objectInputType<{
|
|
@@ -52,8 +52,8 @@ declare const ReActAgentSystemPrompt: PromptTemplate<z.ZodObject<{
|
|
|
52
52
|
description: z.ZodString;
|
|
53
53
|
schema: z.ZodString;
|
|
54
54
|
}, z.ZodTypeAny, "passthrough">[];
|
|
55
|
-
createdAt?: string | null | undefined;
|
|
56
55
|
instructions?: string | undefined;
|
|
56
|
+
createdAt?: string | null | undefined;
|
|
57
57
|
}>>;
|
|
58
58
|
declare const ReActAgentAssistantPrompt: PromptTemplate<z.ZodObject<{
|
|
59
59
|
thought: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -62,14 +62,14 @@ declare const ReActAgentAssistantPrompt: PromptTemplate<z.ZodObject<{
|
|
|
62
62
|
toolOutput: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
63
63
|
finalAnswer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
64
64
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
toolName?: string[] | undefined;
|
|
66
65
|
thought?: string[] | undefined;
|
|
66
|
+
toolName?: string[] | undefined;
|
|
67
67
|
toolInput?: string[] | undefined;
|
|
68
68
|
toolOutput?: string[] | undefined;
|
|
69
69
|
finalAnswer?: string[] | undefined;
|
|
70
70
|
}, {
|
|
71
|
-
toolName?: string[] | undefined;
|
|
72
71
|
thought?: string[] | undefined;
|
|
72
|
+
toolName?: string[] | undefined;
|
|
73
73
|
toolInput?: string[] | undefined;
|
|
74
74
|
toolOutput?: string[] | undefined;
|
|
75
75
|
finalAnswer?: string[] | undefined;
|
|
@@ -28,14 +28,14 @@ declare const DeepThinkReActAgentAssistantPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
28
28
|
toolOutput: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
29
29
|
finalAnswer: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
30
30
|
}, "strip", zod.ZodTypeAny, {
|
|
31
|
-
toolName?: string[] | undefined;
|
|
32
31
|
thought?: string[] | undefined;
|
|
32
|
+
toolName?: string[] | undefined;
|
|
33
33
|
toolInput?: string[] | undefined;
|
|
34
34
|
toolOutput?: string[] | undefined;
|
|
35
35
|
finalAnswer?: string[] | undefined;
|
|
36
36
|
}, {
|
|
37
|
-
toolName?: string[] | undefined;
|
|
38
37
|
thought?: string[] | undefined;
|
|
38
|
+
toolName?: string[] | undefined;
|
|
39
39
|
toolInput?: string[] | undefined;
|
|
40
40
|
toolOutput?: string[] | undefined;
|
|
41
41
|
finalAnswer?: string[] | undefined;
|
|
@@ -57,12 +57,12 @@ declare const DeepThinkReActAgentSystemPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
57
57
|
}, zod.ZodTypeAny, "passthrough">>, "many">;
|
|
58
58
|
createdAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
59
59
|
}, "strip", zod.ZodTypeAny, {
|
|
60
|
-
instructions: string;
|
|
61
60
|
tools: zod.objectOutputType<{
|
|
62
61
|
name: zod.ZodString;
|
|
63
62
|
description: zod.ZodString;
|
|
64
63
|
schema: zod.ZodString;
|
|
65
64
|
}, zod.ZodTypeAny, "passthrough">[];
|
|
65
|
+
instructions: string;
|
|
66
66
|
createdAt?: string | null | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
tools: zod.objectInputType<{
|
|
@@ -70,8 +70,8 @@ declare const DeepThinkReActAgentSystemPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
70
70
|
description: zod.ZodString;
|
|
71
71
|
schema: zod.ZodString;
|
|
72
72
|
}, zod.ZodTypeAny, "passthrough">[];
|
|
73
|
-
createdAt?: string | null | undefined;
|
|
74
73
|
instructions?: string | undefined;
|
|
74
|
+
createdAt?: string | null | undefined;
|
|
75
75
|
}>>;
|
|
76
76
|
declare const DeepThinkReActAgentSchemaErrorPrompt: PromptTemplate<zod.ZodObject<{}, "passthrough", zod.ZodTypeAny, zod.objectOutputType<{}, zod.ZodTypeAny, "passthrough">, zod.objectInputType<{}, zod.ZodTypeAny, "passthrough">>>;
|
|
77
77
|
declare const DeepThinkReActAgentUserPrompt: PromptTemplate<zod.ZodObject<{
|
|
@@ -28,14 +28,14 @@ declare const DeepThinkReActAgentAssistantPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
28
28
|
toolOutput: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
29
29
|
finalAnswer: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
30
30
|
}, "strip", zod.ZodTypeAny, {
|
|
31
|
-
toolName?: string[] | undefined;
|
|
32
31
|
thought?: string[] | undefined;
|
|
32
|
+
toolName?: string[] | undefined;
|
|
33
33
|
toolInput?: string[] | undefined;
|
|
34
34
|
toolOutput?: string[] | undefined;
|
|
35
35
|
finalAnswer?: string[] | undefined;
|
|
36
36
|
}, {
|
|
37
|
-
toolName?: string[] | undefined;
|
|
38
37
|
thought?: string[] | undefined;
|
|
38
|
+
toolName?: string[] | undefined;
|
|
39
39
|
toolInput?: string[] | undefined;
|
|
40
40
|
toolOutput?: string[] | undefined;
|
|
41
41
|
finalAnswer?: string[] | undefined;
|
|
@@ -57,12 +57,12 @@ declare const DeepThinkReActAgentSystemPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
57
57
|
}, zod.ZodTypeAny, "passthrough">>, "many">;
|
|
58
58
|
createdAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
59
59
|
}, "strip", zod.ZodTypeAny, {
|
|
60
|
-
instructions: string;
|
|
61
60
|
tools: zod.objectOutputType<{
|
|
62
61
|
name: zod.ZodString;
|
|
63
62
|
description: zod.ZodString;
|
|
64
63
|
schema: zod.ZodString;
|
|
65
64
|
}, zod.ZodTypeAny, "passthrough">[];
|
|
65
|
+
instructions: string;
|
|
66
66
|
createdAt?: string | null | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
tools: zod.objectInputType<{
|
|
@@ -70,8 +70,8 @@ declare const DeepThinkReActAgentSystemPrompt: PromptTemplate<zod.ZodObject<{
|
|
|
70
70
|
description: zod.ZodString;
|
|
71
71
|
schema: zod.ZodString;
|
|
72
72
|
}, zod.ZodTypeAny, "passthrough">[];
|
|
73
|
-
createdAt?: string | null | undefined;
|
|
74
73
|
instructions?: string | undefined;
|
|
74
|
+
createdAt?: string | null | undefined;
|
|
75
75
|
}>>;
|
|
76
76
|
declare const DeepThinkReActAgentSchemaErrorPrompt: PromptTemplate<zod.ZodObject<{}, "passthrough", zod.ZodTypeAny, zod.objectOutputType<{}, zod.ZodTypeAny, "passthrough">, zod.objectInputType<{}, zod.ZodTypeAny, "passthrough">>>;
|
|
77
77
|
declare const DeepThinkReActAgentUserPrompt: PromptTemplate<zod.ZodObject<{
|
|
@@ -51,12 +51,12 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
51
51
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
52
52
|
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
instructions: string;
|
|
55
54
|
tools: z.objectOutputType<{
|
|
56
55
|
name: z.ZodString;
|
|
57
56
|
description: z.ZodString;
|
|
58
57
|
schema: z.ZodString;
|
|
59
58
|
}, z.ZodTypeAny, "passthrough">[];
|
|
59
|
+
instructions: string;
|
|
60
60
|
createdAt?: string | null | undefined;
|
|
61
61
|
}, {
|
|
62
62
|
tools: z.objectInputType<{
|
|
@@ -64,8 +64,8 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
64
64
|
description: z.ZodString;
|
|
65
65
|
schema: z.ZodString;
|
|
66
66
|
}, z.ZodTypeAny, "passthrough">[];
|
|
67
|
-
createdAt?: string | null | undefined;
|
|
68
67
|
instructions?: string | undefined;
|
|
68
|
+
createdAt?: string | null | undefined;
|
|
69
69
|
}>>;
|
|
70
70
|
assistant: PromptTemplate<z.ZodObject<{
|
|
71
71
|
thought: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -74,14 +74,14 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
74
74
|
toolOutput: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
75
|
finalAnswer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
toolName?: string[] | undefined;
|
|
78
77
|
thought?: string[] | undefined;
|
|
78
|
+
toolName?: string[] | undefined;
|
|
79
79
|
toolInput?: string[] | undefined;
|
|
80
80
|
toolOutput?: string[] | undefined;
|
|
81
81
|
finalAnswer?: string[] | undefined;
|
|
82
82
|
}, {
|
|
83
|
-
toolName?: string[] | undefined;
|
|
84
83
|
thought?: string[] | undefined;
|
|
84
|
+
toolName?: string[] | undefined;
|
|
85
85
|
toolInput?: string[] | undefined;
|
|
86
86
|
toolOutput?: string[] | undefined;
|
|
87
87
|
finalAnswer?: string[] | undefined;
|
|
@@ -51,12 +51,12 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
51
51
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
52
52
|
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
instructions: string;
|
|
55
54
|
tools: z.objectOutputType<{
|
|
56
55
|
name: z.ZodString;
|
|
57
56
|
description: z.ZodString;
|
|
58
57
|
schema: z.ZodString;
|
|
59
58
|
}, z.ZodTypeAny, "passthrough">[];
|
|
59
|
+
instructions: string;
|
|
60
60
|
createdAt?: string | null | undefined;
|
|
61
61
|
}, {
|
|
62
62
|
tools: z.objectInputType<{
|
|
@@ -64,8 +64,8 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
64
64
|
description: z.ZodString;
|
|
65
65
|
schema: z.ZodString;
|
|
66
66
|
}, z.ZodTypeAny, "passthrough">[];
|
|
67
|
-
createdAt?: string | null | undefined;
|
|
68
67
|
instructions?: string | undefined;
|
|
68
|
+
createdAt?: string | null | undefined;
|
|
69
69
|
}>>;
|
|
70
70
|
assistant: PromptTemplate<z.ZodObject<{
|
|
71
71
|
thought: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -74,14 +74,14 @@ declare class DeepThinkRunner extends DefaultRunner {
|
|
|
74
74
|
toolOutput: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
75
|
finalAnswer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
toolName?: string[] | undefined;
|
|
78
77
|
thought?: string[] | undefined;
|
|
78
|
+
toolName?: string[] | undefined;
|
|
79
79
|
toolInput?: string[] | undefined;
|
|
80
80
|
toolOutput?: string[] | undefined;
|
|
81
81
|
finalAnswer?: string[] | undefined;
|
|
82
82
|
}, {
|
|
83
|
-
toolName?: string[] | undefined;
|
|
84
83
|
thought?: string[] | undefined;
|
|
84
|
+
toolName?: string[] | undefined;
|
|
85
85
|
toolInput?: string[] | undefined;
|
|
86
86
|
toolOutput?: string[] | undefined;
|
|
87
87
|
finalAnswer?: string[] | undefined;
|
|
@@ -51,12 +51,12 @@ declare class DefaultRunner extends BaseRunner {
|
|
|
51
51
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
52
52
|
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
instructions: string;
|
|
55
54
|
tools: z.objectOutputType<{
|
|
56
55
|
name: z.ZodString;
|
|
57
56
|
description: z.ZodString;
|
|
58
57
|
schema: z.ZodString;
|
|
59
58
|
}, z.ZodTypeAny, "passthrough">[];
|
|
59
|
+
instructions: string;
|
|
60
60
|
createdAt?: string | null | undefined;
|
|
61
61
|
}, {
|
|
62
62
|
tools: z.objectInputType<{
|
|
@@ -64,8 +64,8 @@ declare class DefaultRunner extends BaseRunner {
|
|
|
64
64
|
description: z.ZodString;
|
|
65
65
|
schema: z.ZodString;
|
|
66
66
|
}, z.ZodTypeAny, "passthrough">[];
|
|
67
|
-
createdAt?: string | null | undefined;
|
|
68
67
|
instructions?: string | undefined;
|
|
68
|
+
createdAt?: string | null | undefined;
|
|
69
69
|
}>>;
|
|
70
70
|
assistant: PromptTemplate<z.ZodObject<{
|
|
71
71
|
thought: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -74,14 +74,14 @@ declare class DefaultRunner extends BaseRunner {
|
|
|
74
74
|
toolOutput: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
75
|
finalAnswer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
-
toolName?: string[] | undefined;
|
|
78
77
|
thought?: string[] | undefined;
|
|
78
|
+
toolName?: string[] | undefined;
|
|
79
79
|
toolInput?: string[] | undefined;
|
|
80
80
|
toolOutput?: string[] | undefined;
|
|
81
81
|
finalAnswer?: string[] | undefined;
|
|
82
82
|
}, {
|
|
83
|
-
toolName?: string[] | undefined;
|
|
84
83
|
thought?: string[] | undefined;
|
|
84
|
+
toolName?: string[] | undefined;
|
|
85
85
|
toolInput?: string[] | undefined;
|
|
86
86
|
toolOutput?: string[] | undefined;
|
|
87
87
|
finalAnswer?: string[] | undefined;
|