@yourgpt/llm-sdk 2.6.0-beta.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +87 -17
- package/dist/adapters/index.d.mts +11 -13
- package/dist/adapters/index.d.ts +11 -13
- package/dist/adapters/index.js +406 -114
- package/dist/adapters/index.mjs +406 -114
- package/dist/audio-K-Z3-Bce.d.mts +191 -0
- package/dist/audio-K-Z3-Bce.d.ts +191 -0
- package/dist/{base-BICaQaRS.d.mts → base-6LzczuCg.d.ts} +8 -1
- package/dist/{base-CpRPB8u8.d.ts → base-DySbTP8C.d.mts} +8 -1
- package/dist/decisions-CJzOt87t.d.mts +137 -0
- package/dist/decisions-CJzOt87t.d.ts +137 -0
- package/dist/fallback/index.d.mts +4 -4
- package/dist/fallback/index.d.ts +4 -4
- package/dist/http-BQxUT5A9.d.mts +9 -0
- package/dist/http-BQxUT5A9.d.ts +9 -0
- package/dist/index.d.mts +17 -9
- package/dist/index.d.ts +17 -9
- package/dist/index.js +698 -205
- package/dist/index.mjs +695 -206
- package/dist/providers/anthropic/index.d.mts +7 -4
- package/dist/providers/anthropic/index.d.ts +7 -4
- package/dist/providers/anthropic/index.js +389 -115
- package/dist/providers/anthropic/index.mjs +389 -115
- package/dist/providers/azure/index.d.mts +3 -3
- package/dist/providers/azure/index.d.ts +3 -3
- package/dist/providers/cloudflare/index.d.mts +11 -0
- package/dist/providers/cloudflare/index.d.ts +11 -0
- package/dist/providers/cloudflare/index.js +743 -0
- package/dist/providers/cloudflare/index.mjs +741 -0
- package/dist/providers/fireworks/index.d.mts +3 -3
- package/dist/providers/fireworks/index.d.ts +3 -3
- package/dist/providers/fireworks/index.js +181 -60
- package/dist/providers/fireworks/index.mjs +181 -60
- package/dist/providers/google/index.d.mts +3 -3
- package/dist/providers/google/index.d.ts +3 -3
- package/dist/providers/google/index.js +181 -60
- package/dist/providers/google/index.mjs +181 -60
- package/dist/providers/ollama/index.d.mts +4 -4
- package/dist/providers/ollama/index.d.ts +4 -4
- package/dist/providers/openai/index.d.mts +38 -6
- package/dist/providers/openai/index.d.ts +38 -6
- package/dist/providers/openai/index.js +1451 -85
- package/dist/providers/openai/index.mjs +1449 -86
- package/dist/providers/openrouter/index.d.mts +21 -4
- package/dist/providers/openrouter/index.d.ts +21 -4
- package/dist/providers/openrouter/index.js +1040 -131
- package/dist/providers/openrouter/index.mjs +1040 -132
- package/dist/providers/togetherai/index.d.mts +3 -3
- package/dist/providers/togetherai/index.d.ts +3 -3
- package/dist/providers/togetherai/index.js +181 -60
- package/dist/providers/togetherai/index.mjs +181 -60
- package/dist/providers/typesafe/index.d.mts +8 -0
- package/dist/providers/typesafe/index.d.ts +8 -0
- package/dist/providers/typesafe/index.js +735 -0
- package/dist/providers/typesafe/index.mjs +733 -0
- package/dist/providers/xai/index.d.mts +3 -3
- package/dist/providers/xai/index.d.ts +3 -3
- package/dist/providers/xai/index.js +181 -60
- package/dist/providers/xai/index.mjs +181 -60
- package/dist/{types-DCFqkJAy.d.ts → types-B0y6VZSQ.d.ts} +1 -1
- package/dist/{types-DHQEMFHA.d.mts → types-BXQMtaCX.d.ts} +17 -3
- package/dist/{types-C3RgRbEC.d.mts → types-BY6BVhFg.d.mts} +1 -1
- package/dist/{types-Dikj3En4.d.ts → types-C7_qVSSd.d.mts} +17 -3
- package/dist/{types-Dg1Bcg1k.d.mts → types-D7lzMMLu.d.mts} +13 -1
- package/dist/{types-Dg1Bcg1k.d.ts → types-D7lzMMLu.d.ts} +13 -1
- package/dist/yourgpt/index.d.mts +1 -1
- package/dist/yourgpt/index.d.ts +1 -1
- package/docs/decisions.md +174 -0
- package/docs/media.md +201 -0
- package/docs/multimodal-and-audio.md +9 -2
- package/package.json +34 -12
- package/dist/audio-BBSwnjo8.d.mts +0 -92
- package/dist/audio-BBSwnjo8.d.ts +0 -92
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as OllamaProviderConfig, A as AIProvider } from '../../types-
|
|
2
|
-
export { d as OllamaModelOptions } from '../../types-
|
|
3
|
-
import '../../types-
|
|
1
|
+
import { c as OllamaProviderConfig, A as AIProvider } from '../../types-C7_qVSSd.mjs';
|
|
2
|
+
export { d as OllamaModelOptions } from '../../types-C7_qVSSd.mjs';
|
|
3
|
+
import '../../types-D7lzMMLu.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../base-
|
|
5
|
+
import '../../base-DySbTP8C.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Ollama Provider
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as OllamaProviderConfig, A as AIProvider } from '../../types-
|
|
2
|
-
export { d as OllamaModelOptions } from '../../types-
|
|
3
|
-
import '../../types-
|
|
1
|
+
import { c as OllamaProviderConfig, A as AIProvider } from '../../types-BXQMtaCX.js';
|
|
2
|
+
export { d as OllamaModelOptions } from '../../types-BXQMtaCX.js';
|
|
3
|
+
import '../../types-D7lzMMLu.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../base-
|
|
5
|
+
import '../../base-6LzczuCg.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Ollama Provider
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ae as OpenAIParameterOptions, O as OpenAITransportOptions, L as LanguageModel } from '../../types-
|
|
2
|
-
export { h as OpenAIReasoningEffort, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, P as ProviderMetadata } from '../../types-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ae as OpenAIParameterOptions, O as OpenAITransportOptions, L as LanguageModel } from '../../types-D7lzMMLu.mjs';
|
|
2
|
+
export { h as OpenAIReasoningEffort, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, P as ProviderMetadata } from '../../types-D7lzMMLu.mjs';
|
|
3
|
+
import { j as DecisionModel } from '../../decisions-CJzOt87t.mjs';
|
|
4
|
+
import { D as DecisionProviderOptions } from '../../http-BQxUT5A9.mjs';
|
|
5
|
+
import { O as OpenAIProviderConfig, A as AIProvider } from '../../types-C7_qVSSd.mjs';
|
|
6
|
+
import { S as SpeechModel, T as TranscriptionModel, c as ImageModel, f as RealtimeModel } from '../../audio-K-Z3-Bce.mjs';
|
|
5
7
|
import 'zod';
|
|
6
|
-
import '../../base-
|
|
8
|
+
import '../../base-DySbTP8C.mjs';
|
|
7
9
|
|
|
8
10
|
interface OpenAIProviderOptions extends OpenAIParameterOptions, OpenAITransportOptions {
|
|
9
11
|
/** API key (defaults to OPENAI_API_KEY env var) */
|
|
@@ -36,6 +38,13 @@ interface OpenAIProviderOptions extends OpenAIParameterOptions, OpenAITransportO
|
|
|
36
38
|
*/
|
|
37
39
|
declare function openai(modelId: string, options?: OpenAIProviderOptions): LanguageModel;
|
|
38
40
|
|
|
41
|
+
interface OpenAIDecisionProviderOptions extends DecisionProviderOptions {
|
|
42
|
+
organization?: string;
|
|
43
|
+
project?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Native /v1/decisions. Independent of the optional OpenAI npm client. */
|
|
46
|
+
declare function openaiDecision(modelId?: string, options?: OpenAIDecisionProviderOptions): DecisionModel;
|
|
47
|
+
|
|
39
48
|
interface OpenAIAudioProviderOptions {
|
|
40
49
|
apiKey?: string;
|
|
41
50
|
baseUrl?: string;
|
|
@@ -54,6 +63,29 @@ declare function openaiSpeech(modelId?: string, config?: OpenAIAudioProviderOpti
|
|
|
54
63
|
/** Recorded-file transcription. Timestamp and diarization options are model-gated. */
|
|
55
64
|
declare function openaiTranscription(modelId?: string, config?: OpenAIAudioProviderOptions): TranscriptionModel;
|
|
56
65
|
|
|
66
|
+
interface OpenAIMediaProviderOptions {
|
|
67
|
+
apiKey?: string;
|
|
68
|
+
baseUrl?: string;
|
|
69
|
+
organization?: string;
|
|
70
|
+
project?: string;
|
|
71
|
+
fetch?: typeof globalThis.fetch;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface OpenAIImageOptions {
|
|
75
|
+
quality?: "auto" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
76
|
+
background?: "auto" | "opaque" | "transparent";
|
|
77
|
+
outputFormat?: "png" | "jpeg" | "webp";
|
|
78
|
+
outputCompression?: number;
|
|
79
|
+
moderation?: "auto" | "low";
|
|
80
|
+
inputFidelity?: "high" | "low";
|
|
81
|
+
safetyIdentifier?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Server-side Images API generation/editing. Does not change chat or Responses models. */
|
|
84
|
+
declare function openaiImage(modelId?: string, config?: OpenAIMediaProviderOptions): ImageModel;
|
|
85
|
+
|
|
86
|
+
/** OpenAI GA Realtime. GPT-Live has a different protocol and is intentionally rejected. */
|
|
87
|
+
declare function openaiRealtime(modelId?: string, config?: OpenAIMediaProviderOptions): RealtimeModel;
|
|
88
|
+
|
|
57
89
|
/**
|
|
58
90
|
* OpenAI Provider
|
|
59
91
|
*
|
|
@@ -86,4 +118,4 @@ declare function openaiTranscription(modelId?: string, config?: OpenAIAudioProvi
|
|
|
86
118
|
declare function createOpenAI(config?: OpenAIProviderConfig): AIProvider;
|
|
87
119
|
declare const createOpenAIProvider: typeof createOpenAI;
|
|
88
120
|
|
|
89
|
-
export { type OpenAIAudioProviderOptions, OpenAIParameterOptions, type OpenAIProviderOptions, type OpenAITranscriptionOptions, OpenAITransportOptions, createOpenAI, openai as createOpenAIModel, createOpenAIProvider, openai, openaiSpeech, openaiTranscription };
|
|
121
|
+
export { type OpenAIAudioProviderOptions, type OpenAIDecisionProviderOptions, type OpenAIImageOptions, type OpenAIMediaProviderOptions, OpenAIParameterOptions, type OpenAIProviderOptions, type OpenAITranscriptionOptions, OpenAITransportOptions, createOpenAI, openai as createOpenAIModel, createOpenAIProvider, openai, openaiDecision, openaiImage, openaiRealtime, openaiSpeech, openaiTranscription };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ae as OpenAIParameterOptions, O as OpenAITransportOptions, L as LanguageModel } from '../../types-
|
|
2
|
-
export { h as OpenAIReasoningEffort, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, P as ProviderMetadata } from '../../types-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ae as OpenAIParameterOptions, O as OpenAITransportOptions, L as LanguageModel } from '../../types-D7lzMMLu.js';
|
|
2
|
+
export { h as OpenAIReasoningEffort, ab as OpenAIResponseItem, ac as OpenAIResponseMetadata, aa as OpenAIResponsesOptions, P as ProviderMetadata } from '../../types-D7lzMMLu.js';
|
|
3
|
+
import { j as DecisionModel } from '../../decisions-CJzOt87t.js';
|
|
4
|
+
import { D as DecisionProviderOptions } from '../../http-BQxUT5A9.js';
|
|
5
|
+
import { O as OpenAIProviderConfig, A as AIProvider } from '../../types-BXQMtaCX.js';
|
|
6
|
+
import { S as SpeechModel, T as TranscriptionModel, c as ImageModel, f as RealtimeModel } from '../../audio-K-Z3-Bce.js';
|
|
5
7
|
import 'zod';
|
|
6
|
-
import '../../base-
|
|
8
|
+
import '../../base-6LzczuCg.js';
|
|
7
9
|
|
|
8
10
|
interface OpenAIProviderOptions extends OpenAIParameterOptions, OpenAITransportOptions {
|
|
9
11
|
/** API key (defaults to OPENAI_API_KEY env var) */
|
|
@@ -36,6 +38,13 @@ interface OpenAIProviderOptions extends OpenAIParameterOptions, OpenAITransportO
|
|
|
36
38
|
*/
|
|
37
39
|
declare function openai(modelId: string, options?: OpenAIProviderOptions): LanguageModel;
|
|
38
40
|
|
|
41
|
+
interface OpenAIDecisionProviderOptions extends DecisionProviderOptions {
|
|
42
|
+
organization?: string;
|
|
43
|
+
project?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Native /v1/decisions. Independent of the optional OpenAI npm client. */
|
|
46
|
+
declare function openaiDecision(modelId?: string, options?: OpenAIDecisionProviderOptions): DecisionModel;
|
|
47
|
+
|
|
39
48
|
interface OpenAIAudioProviderOptions {
|
|
40
49
|
apiKey?: string;
|
|
41
50
|
baseUrl?: string;
|
|
@@ -54,6 +63,29 @@ declare function openaiSpeech(modelId?: string, config?: OpenAIAudioProviderOpti
|
|
|
54
63
|
/** Recorded-file transcription. Timestamp and diarization options are model-gated. */
|
|
55
64
|
declare function openaiTranscription(modelId?: string, config?: OpenAIAudioProviderOptions): TranscriptionModel;
|
|
56
65
|
|
|
66
|
+
interface OpenAIMediaProviderOptions {
|
|
67
|
+
apiKey?: string;
|
|
68
|
+
baseUrl?: string;
|
|
69
|
+
organization?: string;
|
|
70
|
+
project?: string;
|
|
71
|
+
fetch?: typeof globalThis.fetch;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface OpenAIImageOptions {
|
|
75
|
+
quality?: "auto" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
76
|
+
background?: "auto" | "opaque" | "transparent";
|
|
77
|
+
outputFormat?: "png" | "jpeg" | "webp";
|
|
78
|
+
outputCompression?: number;
|
|
79
|
+
moderation?: "auto" | "low";
|
|
80
|
+
inputFidelity?: "high" | "low";
|
|
81
|
+
safetyIdentifier?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Server-side Images API generation/editing. Does not change chat or Responses models. */
|
|
84
|
+
declare function openaiImage(modelId?: string, config?: OpenAIMediaProviderOptions): ImageModel;
|
|
85
|
+
|
|
86
|
+
/** OpenAI GA Realtime. GPT-Live has a different protocol and is intentionally rejected. */
|
|
87
|
+
declare function openaiRealtime(modelId?: string, config?: OpenAIMediaProviderOptions): RealtimeModel;
|
|
88
|
+
|
|
57
89
|
/**
|
|
58
90
|
* OpenAI Provider
|
|
59
91
|
*
|
|
@@ -86,4 +118,4 @@ declare function openaiTranscription(modelId?: string, config?: OpenAIAudioProvi
|
|
|
86
118
|
declare function createOpenAI(config?: OpenAIProviderConfig): AIProvider;
|
|
87
119
|
declare const createOpenAIProvider: typeof createOpenAI;
|
|
88
120
|
|
|
89
|
-
export { type OpenAIAudioProviderOptions, OpenAIParameterOptions, type OpenAIProviderOptions, type OpenAITranscriptionOptions, OpenAITransportOptions, createOpenAI, openai as createOpenAIModel, createOpenAIProvider, openai, openaiSpeech, openaiTranscription };
|
|
121
|
+
export { type OpenAIAudioProviderOptions, type OpenAIDecisionProviderOptions, type OpenAIImageOptions, type OpenAIMediaProviderOptions, OpenAIParameterOptions, type OpenAIProviderOptions, type OpenAITranscriptionOptions, OpenAITransportOptions, createOpenAI, openai as createOpenAIModel, createOpenAIProvider, openai, openaiDecision, openaiImage, openaiRealtime, openaiSpeech, openaiTranscription };
|