@odla-ai/ai 0.1.1 → 0.1.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/index.cjs +30 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/{openai-Y3OAONAU.js → openai-XZRXMKCC.js} +2 -1
- package/dist/openai-XZRXMKCC.js.map +1 -0
- package/llms.txt +2 -0
- package/package.json +4 -4
- package/dist/openai-Y3OAONAU.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -5,8 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
|
|
8
|
+
var __esm = (fn, res, err) => function __init() {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
10
15
|
};
|
|
11
16
|
var __export = (target, all) => {
|
|
12
17
|
for (var name in all)
|
|
@@ -438,6 +443,7 @@ function buildParams2(spec, req, stream) {
|
|
|
438
443
|
json_schema: { name: req.responseFormat.name ?? "response", schema: req.responseFormat.schema }
|
|
439
444
|
};
|
|
440
445
|
}
|
|
446
|
+
if (req.webSearch) params.web_search_options = { search_context_size: "medium" };
|
|
441
447
|
if (stream) {
|
|
442
448
|
params.stream = true;
|
|
443
449
|
params.stream_options = { include_usage: true };
|
|
@@ -1069,6 +1075,22 @@ var OPENAI_MODELS = [
|
|
|
1069
1075
|
capabilities: chatCapabilities({ effort: true }),
|
|
1070
1076
|
contextWindow: 4e5
|
|
1071
1077
|
},
|
|
1078
|
+
{
|
|
1079
|
+
id: "gpt-5-nano",
|
|
1080
|
+
provider: "openai",
|
|
1081
|
+
nativeId: "gpt-5-nano",
|
|
1082
|
+
capabilities: chatCapabilities({ effort: true }),
|
|
1083
|
+
contextWindow: 4e5
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
// Search-tuned chat model: the adapter sends web_search_options when a
|
|
1087
|
+
// request sets webSearch. No reasoning-effort knob.
|
|
1088
|
+
id: "gpt-5-search-api",
|
|
1089
|
+
provider: "openai",
|
|
1090
|
+
nativeId: "gpt-5-search-api",
|
|
1091
|
+
capabilities: chatCapabilities({ webSearch: true }),
|
|
1092
|
+
contextWindow: 4e5
|
|
1093
|
+
},
|
|
1072
1094
|
{
|
|
1073
1095
|
// Non-reasoning multimodal chat (image input, no effort knob).
|
|
1074
1096
|
id: "gpt-4o",
|
|
@@ -1885,6 +1907,9 @@ async function pushAgentSchema(ctx, appId, appKey) {
|
|
|
1885
1907
|
async function putSecret(ctx, appId, name, value) {
|
|
1886
1908
|
await post(ctx, `/admin/apps/${encodeURIComponent(appId)}/secrets`, { name, value });
|
|
1887
1909
|
}
|
|
1910
|
+
async function putRules(ctx, appId, rules) {
|
|
1911
|
+
await post(ctx, `/app/${encodeURIComponent(appId)}/admin/rules`, rules);
|
|
1912
|
+
}
|
|
1888
1913
|
async function provisionAgentApp(opts) {
|
|
1889
1914
|
const ctx = { endpoint: opts.endpoint, token: opts.token, fetch: opts.fetch };
|
|
1890
1915
|
const appId = await createApp(ctx, { appId: opts.appId, name: opts.appName });
|
|
@@ -1892,6 +1917,9 @@ async function provisionAgentApp(opts) {
|
|
|
1892
1917
|
if (opts.pushSchema !== false) {
|
|
1893
1918
|
await pushAgentSchema({ endpoint: opts.endpoint, fetch: opts.fetch }, appId, appKey);
|
|
1894
1919
|
}
|
|
1920
|
+
if (opts.rules) {
|
|
1921
|
+
await putRules(ctx, appId, opts.rules);
|
|
1922
|
+
}
|
|
1895
1923
|
const nameFor = opts.secretName ?? ((p) => DEFAULT_SECRET_NAMES[p]);
|
|
1896
1924
|
for (const [provider, value] of Object.entries(opts.providerKeys ?? {})) {
|
|
1897
1925
|
if (!value) continue;
|