veryfront 0.1.990 → 0.1.992
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/esm/deno.js +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts +3 -0
- package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-provider.js +46 -15
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts +1 -0
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.js +5 -5
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +5 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.js +3 -0
- package/esm/src/agent/hosted/child-tool-input.d.ts +1 -0
- package/esm/src/agent/hosted/child-tool-input.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-tool-input.js +3 -1
- package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-chat-runtime.js +6 -3
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +3 -0
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.js +2 -0
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +3 -1
- package/esm/src/agent/runtime/default-provider-options.d.ts.map +1 -1
- package/esm/src/agent/runtime/default-provider-options.js +9 -13
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +6 -4
- package/esm/src/agent/runtime/model-capabilities.d.ts +1 -0
- package/esm/src/agent/runtime/model-capabilities.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-capabilities.js +1 -1
- package/esm/src/agent/runtime/model-transport.d.ts +2 -1
- package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-transport.js +18 -1
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts +3 -0
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
- package/esm/src/agent/streaming/fork-runtime-stream.js +10 -2
- package/esm/src/agent/types.d.ts +7 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/extensions/compat/native-services.d.ts +1 -1
- package/esm/src/extensions/compat/native-services.d.ts.map +1 -1
- package/esm/src/platform/compat/opaque-deps.d.ts +2 -5
- package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +1 -0
- package/esm/src/provider/veryfront-cloud/model-catalog.d.ts +4 -0
- package/esm/src/provider/veryfront-cloud/model-catalog.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/model-catalog.js +93 -4
- package/esm/src/provider/veryfront-cloud/openai.d.ts +1 -0
- package/esm/src/provider/veryfront-cloud/openai.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/openai.js +10 -0
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +39 -2
- package/esm/src/runtime/runtime-bridge.d.ts +3 -0
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +1 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { createError, toError } from "../../errors/veryfront-error.js";
|
|
2
2
|
import { ensureBuiltinLLMProviders } from "../../extensions/builtin-extensions.js";
|
|
3
3
|
import { createVeryfrontCloudFetch, getVeryfrontCloudGatewayBaseUrl, parseVeryfrontCloudModelId, requireVeryfrontCloudBootstrap, } from "./shared.js";
|
|
4
|
-
import { createVeryfrontCloudOpenAIModel } from "./openai.js";
|
|
4
|
+
import { createVeryfrontCloudOpenAIModel, createVeryfrontCloudOpenAIResponsesModel, } from "./openai.js";
|
|
5
|
+
import { resolveVeryfrontCloudModelThinking } from "./model-catalog.js";
|
|
5
6
|
function preferStreamedGenerate(model) {
|
|
6
7
|
return Object.assign(model, { _generateViaStream: true });
|
|
7
8
|
}
|
|
9
|
+
function shouldUseOpenAIResponsesRuntime(upstreamModelId) {
|
|
10
|
+
return resolveVeryfrontCloudModelThinking(`openai/${upstreamModelId}`)?.enabled === true;
|
|
11
|
+
}
|
|
8
12
|
export function createVeryfrontCloudModel(modelId) {
|
|
9
13
|
const { provider, modelId: upstreamModelId } = parseVeryfrontCloudModelId(modelId, "language");
|
|
10
14
|
const { apiBaseUrl, apiToken, projectSlug } = requireVeryfrontCloudBootstrap();
|
|
@@ -37,7 +41,39 @@ export function createVeryfrontCloudModel(modelId) {
|
|
|
37
41
|
}
|
|
38
42
|
break;
|
|
39
43
|
}
|
|
40
|
-
case "openai":
|
|
44
|
+
case "openai": {
|
|
45
|
+
const openai = registry.get("openai");
|
|
46
|
+
if (shouldUseOpenAIResponsesRuntime(upstreamModelId)) {
|
|
47
|
+
if (openai?.createResponses) {
|
|
48
|
+
return preferStreamedGenerate(openai.createResponses(upstreamModelId, {
|
|
49
|
+
credential: apiToken,
|
|
50
|
+
baseURL,
|
|
51
|
+
name: "veryfront-cloud",
|
|
52
|
+
providerName: "veryfront-cloud",
|
|
53
|
+
fetch,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
return preferStreamedGenerate(createVeryfrontCloudOpenAIResponsesModel(upstreamModelId, {
|
|
57
|
+
apiToken,
|
|
58
|
+
baseURL,
|
|
59
|
+
fetch,
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
if (openai) {
|
|
63
|
+
return preferStreamedGenerate(openai.createModel(upstreamModelId, {
|
|
64
|
+
credential: apiToken,
|
|
65
|
+
baseURL,
|
|
66
|
+
name: "veryfront-cloud",
|
|
67
|
+
providerName: "veryfront-cloud",
|
|
68
|
+
fetch,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
return preferStreamedGenerate(createVeryfrontCloudOpenAIModel(upstreamModelId, {
|
|
72
|
+
apiToken,
|
|
73
|
+
baseURL,
|
|
74
|
+
fetch,
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
41
77
|
case "mistral":
|
|
42
78
|
case "moonshotai": {
|
|
43
79
|
const openai = registry.get("openai");
|
|
@@ -46,6 +82,7 @@ export function createVeryfrontCloudModel(modelId) {
|
|
|
46
82
|
credential: apiToken,
|
|
47
83
|
baseURL,
|
|
48
84
|
name: "veryfront-cloud",
|
|
85
|
+
providerName: "openai-compatible",
|
|
49
86
|
fetch,
|
|
50
87
|
}));
|
|
51
88
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import type { TextGenerationRuntimeMessage } from "../agent/runtime/text-generation-runtime-message-types.js";
|
|
9
9
|
import type { RuntimeGenerateTextResult, RuntimeStreamResult, RuntimeToolCallRepairFunction, RuntimeToolSet } from "../agent/runtime/runtime-tool-types.js";
|
|
10
10
|
import type { EmbeddingRuntime, ModelRuntime } from "../provider/types.js";
|
|
11
|
+
import type { RuntimeReasoningOption } from "../agent/types.js";
|
|
11
12
|
type GenerateTextOptions = {
|
|
12
13
|
model: ModelRuntime;
|
|
13
14
|
system?: unknown;
|
|
@@ -25,6 +26,7 @@ type GenerateTextOptions = {
|
|
|
25
26
|
frequencyPenalty?: number;
|
|
26
27
|
headers?: HeadersInit;
|
|
27
28
|
providerOptions?: Record<string, unknown>;
|
|
29
|
+
reasoning?: RuntimeReasoningOption;
|
|
28
30
|
abortSignal?: AbortSignal;
|
|
29
31
|
};
|
|
30
32
|
type StreamTextOptions = {
|
|
@@ -44,6 +46,7 @@ type StreamTextOptions = {
|
|
|
44
46
|
frequencyPenalty?: number;
|
|
45
47
|
headers?: HeadersInit;
|
|
46
48
|
providerOptions?: Record<string, unknown>;
|
|
49
|
+
reasoning?: RuntimeReasoningOption;
|
|
47
50
|
includeRawChunks?: boolean;
|
|
48
51
|
abortSignal?: AbortSignal;
|
|
49
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bridge.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/runtime-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AAC9G,OAAO,KAAK,EACV,yBAAyB,EAEzB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACf,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EAEb,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-bridge.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/runtime-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AAC9G,OAAO,KAAK,EACV,yBAAyB,EAEzB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACf,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,4BAA4B,EAAE,CAAC;IACzC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2BAA2B,CAAC,EAAE,6BAA6B,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EA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CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAizBF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAWjG;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAgB1E;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY;;;;;;;;GAW1C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB;;;;;;;GAUlD;AACD,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAsBjE"}
|
|
@@ -253,6 +253,7 @@ function buildDirectModelOptions(options, tools) {
|
|
|
253
253
|
: {}),
|
|
254
254
|
...(options.headers ? { headers: options.headers } : {}),
|
|
255
255
|
...(options.providerOptions ? { providerOptions: options.providerOptions } : {}),
|
|
256
|
+
...(options.reasoning ? { reasoning: options.reasoning } : {}),
|
|
256
257
|
...("includeRawChunks" in options && options.includeRawChunks !== undefined
|
|
257
258
|
? { includeRawChunks: options.includeRawChunks }
|
|
258
259
|
: {}),
|