@jeffusion/bungee-llms 5.21.0 → 5.22.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/README.md +8 -31
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1896 -5420
- package/dist/plugin-api.d.ts +1 -4
- package/dist/plugin-api.js +3276 -7767
- package/dist/protocol-session/index.d.ts +14 -0
- package/dist/protocol-session/request.d.ts +5 -0
- package/dist/protocol-session/response.d.ts +23 -0
- package/dist/protocol-session/schema.d.ts +5 -0
- package/dist/protocol-session/stream.d.ts +35 -0
- package/dist/protocol-session/types.d.ts +48 -0
- package/dist/protocol-session/validation.d.ts +5 -0
- package/dist/providers/openai/index.d.ts +0 -1
- package/dist/responses-codec/common.d.ts +4 -0
- package/dist/responses-codec/events.d.ts +7 -1
- package/dist/responses-codec/web-search.d.ts +3 -0
- package/package.json +3 -3
- package/dist/protocol-converters/anthropic-to-gemini.converter.d.ts +0 -62
- package/dist/protocol-converters/anthropic-to-openai.converter.d.ts +0 -110
- package/dist/protocol-converters/base.d.ts +0 -38
- package/dist/protocol-converters/default-registry.d.ts +0 -1
- package/dist/protocol-converters/gemini-to-anthropic.converter.d.ts +0 -57
- package/dist/protocol-converters/gemini-to-openai.converter.d.ts +0 -31
- package/dist/protocol-converters/index.d.ts +0 -10
- package/dist/protocol-converters/openai-to-anthropic.converter.d.ts +0 -27
- package/dist/protocol-converters/openai-to-gemini.converter.d.ts +0 -32
- package/dist/protocol-converters/registry.d.ts +0 -9
- package/dist/protocol-converters/utils.d.ts +0 -71
- package/dist/providers/openai/messages-compat-normalization.d.ts +0 -42
package/README.md
CHANGED
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
# @jeffusion/bungee-llms
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pure protocol sessions, canonical messages/tools, streaming state machines and token accounting for Bungee.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Provider-agnostic protocol conversion abstractions
|
|
8
|
-
- Adapter registry and conversion service
|
|
9
|
-
- Provider catalog and runtime container
|
|
10
|
-
- OpenAI/Anthropic/Gemini protocol converters (request/response/stream) centralized in `src/protocol-converters`
|
|
11
|
-
- Runtime registration helper `registerDefaultProtocolConverters()` for plugin/wrapper layers
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
5
|
+
Gateway plugins consume `llm-protocol-adapter` public services. The adapter executes the codec locally in each worker; generation bodies never go through control RPC. Provider runtime abstractions remain available to other package consumers, but are not a second gateway conversion path.
|
|
14
6
|
|
|
15
7
|
```ts
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from '@jeffusion/bungee-llms';
|
|
22
|
-
|
|
23
|
-
registerDefaultProtocolConverters();
|
|
8
|
+
import {createProtocolSession, describeProtocolConversion} from '@jeffusion/bungee-llms/plugin-api';
|
|
9
|
+
const session = createProtocolSession({sourceProtocol: 'responses', targetProtocol: 'chat_completions', model: 'model'});
|
|
10
|
+
const request = session.convertRequest({input: 'Hello'});
|
|
11
|
+
// Feed the target JSON response or parsed SSE events into the same session.
|
|
12
|
+
session.dispose();
|
|
24
13
|
```
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
For plugin and wrapper layers, prefer the dedicated stable entrypoint to reduce coupling to internal file layout:
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
import {
|
|
32
|
-
type AIConverter,
|
|
33
|
-
ProtocolTransformerRegistry,
|
|
34
|
-
registerDefaultProtocolConverters,
|
|
35
|
-
OpenAIProtocolConversion,
|
|
36
|
-
OpenAIMessagesCompatibilityNormalizer
|
|
37
|
-
} from '@jeffusion/bungee-llms/plugin-api';
|
|
38
|
-
```
|
|
15
|
+
The matrix has four passthrough pairs, ten direct conversions and two rejected Responses/Gemini pairs. Explicit reasoning controls require a verified wire policy. Tools, history and output constraints fail with a safe reason and param when their semantics cannot be preserved. See [LLM Protocol Adapter](../../docs/reference/llm-protocol-adapter.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export * from './registry';
|
|
|
7
7
|
export * from './service';
|
|
8
8
|
export * from './openai';
|
|
9
9
|
export * from './openai-anthropic';
|
|
10
|
-
export * from './protocol-converters';
|
|
11
10
|
export * from './token-accounting';
|
|
12
11
|
export * from './responses-codec';
|
|
12
|
+
export * from './protocol-session';
|