@elizaos/plugin-openai 2.0.3-beta.2 → 2.0.3-beta.4
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/dist/browser/index.browser.js +3 -0
- package/dist/browser/index.browser.js.map +23 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/index.browser.d.ts +4 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.node.d.ts +4 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/init.d.ts +4 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/models/audio.d.ts +9 -0
- package/dist/models/audio.d.ts.map +1 -0
- package/dist/models/embedding.d.ts +3 -0
- package/dist/models/embedding.d.ts.map +1 -0
- package/dist/models/image.d.ts +5 -0
- package/dist/models/image.d.ts.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/research.d.ts +34 -0
- package/dist/models/research.d.ts.map +1 -0
- package/dist/models/text.d.ts +62 -0
- package/dist/models/text.d.ts.map +1 -0
- package/dist/models/tokenizer.d.ts +4 -0
- package/dist/models/tokenizer.d.ts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.node.js +2057 -0
- package/dist/node/index.node.js.map +23 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/openai.d.ts +4 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/types/index.d.ts +367 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/audio.d.ts +6 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/config.d.ts +47 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/events.d.ts +21 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/tokenization.d.ts +6 -0
- package/dist/utils/tokenization.d.ts.map +1 -0
- package/package.json +7 -4
- package/registry-entry.json +189 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IAgentRuntime, ImageDescriptionParams, ImageGenerationParams } from "@elizaos/core";
|
|
2
|
+
import type { ImageDescriptionResult, ImageGenerationResult } from "../types";
|
|
3
|
+
export declare function handleImageGeneration(runtime: IAgentRuntime, params: ImageGenerationParams): Promise<ImageGenerationResult[]>;
|
|
4
|
+
export declare function handleImageDescription(runtime: IAgentRuntime, params: ImageDescriptionParams | string): Promise<ImageDescriptionResult>;
|
|
5
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../models/image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EAMtB,MAAM,UAAU,CAAC;AAoBlB,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAuElC;AAWD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,sBAAsB,GAAG,MAAM,GACtC,OAAO,CAAC,sBAAsB,CAAC,CAwGjC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { handleTextToSpeech, handleTranscription } from "./audio";
|
|
2
|
+
export { handleTextEmbedding } from "./embedding";
|
|
3
|
+
export { handleImageDescription, handleImageGeneration } from "./image";
|
|
4
|
+
export { handleResearch } from "./research";
|
|
5
|
+
export { handleActionPlanner, handleResponseHandler, handleTextLarge, handleTextMedium, handleTextMega, handleTextNano, handleTextSmall, } from "./text";
|
|
6
|
+
export { handleTokenizerDecode, handleTokenizerEncode } from "./tokenizer";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep Research model handler
|
|
3
|
+
*
|
|
4
|
+
* Provides deep research capabilities using OpenAI's o3-deep-research and o4-mini-deep-research models.
|
|
5
|
+
* These models can find, analyze, and synthesize hundreds of sources to create comprehensive reports.
|
|
6
|
+
*
|
|
7
|
+
* @see https://platform.openai.com/docs/guides/deep-research
|
|
8
|
+
*/
|
|
9
|
+
import type { IAgentRuntime, ResearchParams, ResearchResult } from "@elizaos/core";
|
|
10
|
+
/**
|
|
11
|
+
* Handles RESEARCH model requests using OpenAI's deep research models.
|
|
12
|
+
*
|
|
13
|
+
* Deep research models can take tens of minutes to complete tasks.
|
|
14
|
+
* Use background mode for long-running tasks.
|
|
15
|
+
*
|
|
16
|
+
* @param runtime - The agent runtime
|
|
17
|
+
* @param params - Research parameters
|
|
18
|
+
* @returns Research result with text, annotations, and output items
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const result = await handleResearch(runtime, {
|
|
23
|
+
* input: "Research the economic impact of AI on global labor markets",
|
|
24
|
+
* tools: [
|
|
25
|
+
* { type: "web_search_preview" },
|
|
26
|
+
* { type: "code_interpreter", container: { type: "auto" } }
|
|
27
|
+
* ],
|
|
28
|
+
* background: true,
|
|
29
|
+
* });
|
|
30
|
+
* console.log(result.text);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function handleResearch(runtime: IAgentRuntime, params: ResearchParams): Promise<ResearchResult>;
|
|
34
|
+
//# sourceMappingURL=research.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../models/research.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EASb,cAAc,EACd,cAAc,EAGf,MAAM,eAAe,CAAC;AAgPvB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,cAAc,CAAC,CAwHzB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text generation model handlers
|
|
3
|
+
*
|
|
4
|
+
* Provides text generation using OpenAI's language models.
|
|
5
|
+
*/
|
|
6
|
+
import type { GenerateTextParams, IAgentRuntime } from "@elizaos/core";
|
|
7
|
+
import { type ModelMessage } from "ai";
|
|
8
|
+
import type { TextStreamResult } from "../types";
|
|
9
|
+
declare function resolveProviderOptions(params: GenerateTextParams, runtime: IAgentRuntime, modelName?: string): Record<string, unknown> | undefined;
|
|
10
|
+
declare function normalizeNativeMessages(messages: unknown): ModelMessage[] | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Strip reasoning-only parts from outbound assistant content.
|
|
13
|
+
*
|
|
14
|
+
* OpenAI-spec reasoning models (Cerebras gpt-oss-120b, OpenAI o1/o3,
|
|
15
|
+
* DeepSeek R1, Qwen-3-thinking, etc.) return reasoning in the assistant
|
|
16
|
+
* response — either as a separate `reasoning` / `reasoning_content`
|
|
17
|
+
* field, or as content parts with `type: "reasoning"`. Echoing those
|
|
18
|
+
* back to the next turn is wrong on both ends:
|
|
19
|
+
* - Cerebras returns HTTP 400 (`messages.X.assistant.reasoning_content:
|
|
20
|
+
* property is unsupported`).
|
|
21
|
+
* - OpenAI silently drops them, which wastes prompt tokens.
|
|
22
|
+
*
|
|
23
|
+
* The AI SDK upstream of this normalizer surfaces those reasoning blocks
|
|
24
|
+
* as `{ type: "reasoning", ... }` content parts. We drop them here so
|
|
25
|
+
* the wire stays spec-clean for the next turn. The reasoning itself
|
|
26
|
+
* remains usable as a single-turn signal (still on the response object);
|
|
27
|
+
* we only refuse to round-trip it.
|
|
28
|
+
*/
|
|
29
|
+
declare function stripReasoningParts(content: unknown[]): unknown[];
|
|
30
|
+
/**
|
|
31
|
+
* Handles TEXT_SMALL model requests.
|
|
32
|
+
*
|
|
33
|
+
* Uses the configured small model (default: gpt-5-mini).
|
|
34
|
+
*
|
|
35
|
+
* @param runtime - The agent runtime
|
|
36
|
+
* @param params - Generation parameters
|
|
37
|
+
* @returns Generated text or stream result
|
|
38
|
+
*/
|
|
39
|
+
export declare function handleTextSmall(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
40
|
+
export declare function handleTextNano(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
41
|
+
export declare function handleTextMedium(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Handles TEXT_LARGE model requests.
|
|
44
|
+
*
|
|
45
|
+
* Uses the configured large model (default: gpt-5).
|
|
46
|
+
*
|
|
47
|
+
* @param runtime - The agent runtime
|
|
48
|
+
* @param params - Generation parameters
|
|
49
|
+
* @returns Generated text or stream result
|
|
50
|
+
*/
|
|
51
|
+
export declare function handleTextLarge(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
52
|
+
export declare function handleTextMega(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
53
|
+
export declare function handleResponseHandler(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
54
|
+
export declare function handleActionPlanner(runtime: IAgentRuntime, params: GenerateTextParams): Promise<string | TextStreamResult>;
|
|
55
|
+
/** @internal — exported for unit tests only. */
|
|
56
|
+
export declare const __INTERNAL_resolveProviderOptions: typeof resolveProviderOptions;
|
|
57
|
+
/** @internal — exported for unit tests only. */
|
|
58
|
+
export declare const __INTERNAL_normalizeNativeMessages: typeof normalizeNativeMessages;
|
|
59
|
+
/** @internal — exported for unit tests only. */
|
|
60
|
+
export declare const __INTERNAL_stripReasoningParts: typeof stripReasoningParts;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../models/text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EAId,MAAM,eAAe,CAAC;AAWvB,OAAO,EAKL,KAAK,YAAY,EAMlB,MAAM,IAAI,CAAC;AAEZ,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,UAAU,CAAC;AA4R7D,iBAAS,sBAAsB,CAC7B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAwDrC;AAqFD,iBAAS,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,YAAY,EAAE,GAAG,SAAS,CAM9E;AAqCD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAM1D;AAilBD;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAOpC;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAEpC;AAMD,gDAAgD;AAChD,eAAO,MAAM,iCAAiC,+BAAyB,CAAC;AACxE,gDAAgD;AAChD,eAAO,MAAM,kCAAkC,gCAA0B,CAAC;AAC1E,gDAAgD;AAChD,eAAO,MAAM,8BAA8B,4BAAsB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DetokenizeTextParams, IAgentRuntime, TokenizeTextParams } from "@elizaos/core";
|
|
2
|
+
export declare function handleTokenizerEncode(runtime: IAgentRuntime, params: TokenizeTextParams): Promise<number[]>;
|
|
3
|
+
export declare function handleTokenizerDecode(runtime: IAgentRuntime, params: DetokenizeTextParams): Promise<string>;
|
|
4
|
+
//# sourceMappingURL=tokenizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../models/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG7F,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAejB"}
|