@dbx-tools/model-protocol 0.9.131 → 0.9.136
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 +35 -12
- package/index.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
# @dbx-tools/model-protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Construct Vercel AI SDK ProviderV4 models for Databricks endpoints and translate
|
|
4
|
+
gateway traffic between supported model protocols.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- construct a request-scoped AI SDK model for Databricks Chat Completions, Responses, or Anthropic Messages;
|
|
8
|
-
- translate OpenAI or Anthropic gateway messages to and from AI SDK messages;
|
|
9
|
-
- normalize Databricks Chat Completions request and response wire shapes.
|
|
10
|
-
|
|
11
|
-
Model discovery and capability policy remain in `@dbx-tools/model`. Browser-safe model and gateway contracts remain in `@dbx-tools/shared-model` and `@dbx-tools/shared-model-gateway`.
|
|
12
|
-
|
|
13
|
-
## Invoke A Databricks Model
|
|
6
|
+
## Invoke a Databricks model
|
|
14
7
|
|
|
15
8
|
Construct the AI SDK model after resolving the endpoint protocol and fresh
|
|
16
9
|
authentication headers for the current request:
|
|
@@ -30,11 +23,23 @@ const result = await generateText({ model, prompt: "Summarize the incident." });
|
|
|
30
23
|
console.log(result.text);
|
|
31
24
|
```
|
|
32
25
|
|
|
26
|
+
Use this package when a Node service needs to:
|
|
27
|
+
|
|
28
|
+
- construct a request-scoped AI SDK model for Databricks Chat Completions,
|
|
29
|
+
Responses, or Anthropic Messages.
|
|
30
|
+
- translate OpenAI or Anthropic gateway messages to and from AI SDK messages.
|
|
31
|
+
- normalize Databricks Chat Completions request and response wire shapes.
|
|
32
|
+
|
|
33
|
+
Model discovery and capability policy remain in `@dbx-tools/model`.
|
|
34
|
+
Browser-safe model and gateway contracts remain in
|
|
35
|
+
[@dbx-tools/shared-model](../../shared/model) and
|
|
36
|
+
[@dbx-tools/shared-model-gateway](../../shared/model-gateway).
|
|
37
|
+
|
|
33
38
|
Use `chat`, `responses`, or `anthropic` according to the model-owned protocol
|
|
34
39
|
selection. The chat provider applies Databricks serving-wire repairs through a
|
|
35
|
-
provider-local `fetch
|
|
40
|
+
provider-local `fetch`. It does not patch `globalThis.fetch`.
|
|
36
41
|
|
|
37
|
-
## Translate
|
|
42
|
+
## Translate a gateway request
|
|
38
43
|
|
|
39
44
|
Decode an OpenAI or Anthropic request into AI SDK messages and encode the
|
|
40
45
|
completed generation back into the caller's protocol:
|
|
@@ -68,3 +73,21 @@ const response = encodeGatewayResponse(protocol, "databricks-gpt-5-6-sol", {
|
|
|
68
73
|
Use `encodeGatewayStream()` instead when forwarding `streamText().fullStream`.
|
|
69
74
|
The decoder and encoders share tool-call, reasoning, usage, and finish-reason
|
|
70
75
|
handling between Mastra and the model gateway.
|
|
76
|
+
|
|
77
|
+
## Protocol coverage and limits
|
|
78
|
+
|
|
79
|
+
The provider side supports Databricks Chat Completions, Responses, and
|
|
80
|
+
Anthropic Messages. The gateway decoder and encoders support OpenAI Chat
|
|
81
|
+
Completions, OpenAI Responses, and Anthropic Messages for buffered and
|
|
82
|
+
streaming text and function-tool traffic. The model gateway sends embeddings
|
|
83
|
+
directly and doesn't translate them through this package.
|
|
84
|
+
|
|
85
|
+
Fallback translation preserves text, function tools, tool results, reasoning
|
|
86
|
+
events, token usage, and finish reasons. It doesn't implement stateful
|
|
87
|
+
Responses features such as `previous_response_id`, `store: true`, or
|
|
88
|
+
`background: true`.
|
|
89
|
+
|
|
90
|
+
The Chat provider's request-scoped fetch removes unsupported fields, applies
|
|
91
|
+
GPT 5.6 tool-call reasoning compatibility, strips provider reasoning blocks
|
|
92
|
+
that can't be replayed, repairs assistant prefill after tool results, and
|
|
93
|
+
flattens array-valued response content. It doesn't modify `globalThis.fetch`.
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
|
|
5
5
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/model-protocol";
|
|
6
|
-
export const PACKAGE_VERSION = "0.9.
|
|
6
|
+
export const PACKAGE_VERSION = "0.9.136";
|
|
7
7
|
export * as gatewayDecode from "./src/gateway-decode.ts";
|
|
8
8
|
export * as gatewayEncode from "./src/gateway-encode.ts";
|
|
9
9
|
export * as provider from "./src/provider.ts";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PACKAGE_IDENTIFIER = "@dbx-tools/model-protocol";
|
|
2
|
-
export declare const PACKAGE_VERSION = "0.9.
|
|
2
|
+
export declare const PACKAGE_VERSION = "0.9.136";
|
|
3
3
|
export * as gatewayDecode from "./src/gateway-decode.ts";
|
|
4
4
|
export * as gatewayEncode from "./src/gateway-encode.ts";
|
|
5
5
|
export * as provider from "./src/provider.ts";
|
package/lib/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Regenerated from the exporting modules in ./src.
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/model-protocol";
|
|
5
|
-
export const PACKAGE_VERSION = "0.9.
|
|
5
|
+
export const PACKAGE_VERSION = "0.9.136";
|
|
6
6
|
export * as gatewayDecode from "./src/gateway-decode.js";
|
|
7
7
|
export * as gatewayEncode from "./src/gateway-encode.js";
|
|
8
8
|
export * as provider from "./src/provider.js";
|
|
9
9
|
export * as servingWire from "./src/serving-wire.js";
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdz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nZpbmctd2lyZS50c1wiO1xuZXhwb3J0IHR5cGUgeyBEZWNvZGVkR2F0ZXdheVJlcXVlc3QgfSBmcm9tIFwiLi9zcmMvZ2F0ZXdheS1kZWNvZGUudHNcIjtcbmV4cG9ydCB0eXBlIHsgQ29tcGxldGVkR2VuZXJhdGlvbiB9IGZyb20gXCIuL3NyYy9nYXRld2F5LWVuY29kZS50c1wiO1xuZXhwb3J0IHR5cGUgeyBEYXRhYnJpY2tzTGFuZ3VhZ2VNb2RlbFByb3RvY29sLCBEYXRhYnJpY2tzTGFuZ3VhZ2VNb2RlbCwgRGF0YWJyaWNrc0xhbmd1YWdlTW9kZWxPcHRpb25zIH0gZnJvbSBcIi4vc3JjL3Byb3ZpZGVyLnRzXCI7XG5leHBvcnQgdHlwZSB7IFNlcnZpbmdDaGF0TWVzc2FnZSwgUmV3cml0dGVuU2VydmluZ1JlcXVlc3QgfSBmcm9tIFwiLi9zcmMvc2VydmluZy13aXJlLnRzXCI7XG4iXX0=
|
package/package.json
CHANGED
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@ai-sdk/anthropic": "^4.0.0",
|
|
29
29
|
"@ai-sdk/open-responses": "^2.0.58",
|
|
30
30
|
"@ai-sdk/openai-compatible": "^3.0.62",
|
|
31
|
-
"@dbx-tools/model": "^0.9.
|
|
32
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
33
|
-
"@dbx-tools/shared-model": "^0.9.
|
|
34
|
-
"@dbx-tools/shared-model-gateway": "^0.9.
|
|
31
|
+
"@dbx-tools/model": "^0.9.136",
|
|
32
|
+
"@dbx-tools/shared-core": "^0.9.136",
|
|
33
|
+
"@dbx-tools/shared-model": "^0.9.136",
|
|
34
|
+
"@dbx-tools/shared-model-gateway": "^0.9.136",
|
|
35
35
|
"ai": "^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"main": "./lib/index.js",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"./package.json": "./package.json"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"version": "0.9.
|
|
71
|
+
"version": "0.9.136",
|
|
72
72
|
"types": "./lib/index.d.ts",
|
|
73
73
|
"dbxToolsConfig": {
|
|
74
74
|
"tags": [
|