@rulvar/openai 1.3.0 → 1.3.2
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 +30 -0
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @rulvar/openai
|
|
2
|
+
|
|
3
|
+
First-class adapter for the OpenAI Responses API (reasoning items,
|
|
4
|
+
strict `json_schema` outputs), plus `openaiCompatible`, the factory that
|
|
5
|
+
points the same adapter at any OpenAI-compatible endpoint (Ollama, vLLM,
|
|
6
|
+
gateways) with an explicit id and baseURL. Models are addressed as
|
|
7
|
+
`'openai:<model>'` in routing.
|
|
8
|
+
|
|
9
|
+
Part of [rulvar](https://rulvar.com), an embeddable TypeScript engine
|
|
10
|
+
for durable, budget-bounded multi-agent LLM workflows, where a completed
|
|
11
|
+
LLM call is never paid for twice. Full documentation:
|
|
12
|
+
[docs.rulvar.com](https://docs.rulvar.com).
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @rulvar/core @rulvar/openai
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The umbrella package `@rulvar/rulvar` already bundles this adapter.
|
|
21
|
+
|
|
22
|
+
## Documentation
|
|
23
|
+
|
|
24
|
+
- [Providers](https://docs.rulvar.com/guide/providers)
|
|
25
|
+
- [Model routing](https://docs.rulvar.com/guide/model-routing)
|
|
26
|
+
- [API reference](https://docs.rulvar.com/api/%40rulvar/openai/)
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
[Apache-2.0](https://github.com/o-stepper/rulvar/blob/main/LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ function buildResponsesParams(req, ids) {
|
|
|
127
127
|
"previous_response_id",
|
|
128
128
|
"previousResponseId",
|
|
129
129
|
"conversation"
|
|
130
|
-
]) if (openaiOptions[forbidden] !== void 0) throw new ConfigError(`providerOptions.openai.${forbidden} is rejected: server-side conversation state is incompatible with content-addressed journal determinism
|
|
130
|
+
]) if (openaiOptions[forbidden] !== void 0) throw new ConfigError(`providerOptions.openai.${forbidden} is rejected: server-side conversation state is incompatible with content-addressed journal determinism`);
|
|
131
131
|
const instructions = [];
|
|
132
132
|
const input = [];
|
|
133
133
|
for (const msg of req.messages) {
|
|
@@ -653,7 +653,7 @@ const CONSERVATIVE_COMPATIBLE_CAPS = {
|
|
|
653
653
|
};
|
|
654
654
|
/** Creates a Chat Completions dialect adapter for a compatible endpoint. */
|
|
655
655
|
function openaiCompatible(cfg) {
|
|
656
|
-
if (cfg.id === void 0 || cfg.id === "") throw new ConfigError("openaiCompatible requires an explicit non-empty 'id'
|
|
656
|
+
if (cfg.id === void 0 || cfg.id === "") throw new ConfigError("openaiCompatible requires an explicit non-empty 'id'");
|
|
657
657
|
if (cfg.baseURL === void 0 || cfg.baseURL === "") throw new ConfigError("openaiCompatible requires 'baseURL'");
|
|
658
658
|
const client = cfg.client ?? new OpenAI({
|
|
659
659
|
baseURL: cfg.baseURL,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/openai",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "rulvar first-class provider adapter for the OpenAI Responses API, plus the openaiCompatible factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"openai": "^6.45.0",
|
|
26
|
-
"@rulvar/core": "1.3.
|
|
26
|
+
"@rulvar/core": "1.3.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.20.0",
|