@zimtsui/brainswitch 0.0.56 → 0.0.59
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 +109 -54
- package/assets/verbatim/declarations.handlebars +11 -0
- package/assets/verbatim/instruction.md +49 -0
- package/build/adaptor.d.ts +40 -9
- package/build/adaptor.js +36 -38
- package/build/adaptor.js.map +1 -1
- package/build/api-types/anthropic/billing.d.ts +5 -5
- package/build/api-types/anthropic/billing.js +1 -2
- package/build/api-types/anthropic/billing.js.map +1 -1
- package/build/api-types/anthropic/tool-codec.d.ts +11 -12
- package/build/api-types/anthropic/tool-codec.js +27 -42
- package/build/api-types/anthropic/tool-codec.js.map +1 -1
- package/build/api-types/google/billing.d.ts +5 -5
- package/build/api-types/google/billing.js +2 -3
- package/build/api-types/google/billing.js.map +1 -1
- package/build/api-types/google/restful-request.d.ts +1 -1
- package/build/api-types/google/restful-request.js +0 -1
- package/build/api-types/google/restful-request.js.map +1 -1
- package/build/api-types/google/tool-codec.d.ts +11 -11
- package/build/api-types/google/tool-codec.js +21 -19
- package/build/api-types/google/tool-codec.js.map +1 -1
- package/build/api-types/{openai-chatcompletion → openai-chatcompletions}/billing.d.ts +2 -3
- package/build/api-types/{openai-chatcompletion → openai-chatcompletions}/billing.js +0 -2
- package/build/api-types/openai-chatcompletions/billing.js.map +1 -0
- package/build/api-types/openai-chatcompletions/tool-codec.d.ts +17 -0
- package/build/api-types/{openai-chatcompletion → openai-chatcompletions}/tool-codec.js +26 -32
- package/build/api-types/openai-chatcompletions/tool-codec.js.map +1 -0
- package/build/api-types/openai-responses/billing.d.ts +5 -5
- package/build/api-types/openai-responses/billing.js +1 -2
- package/build/api-types/openai-responses/billing.js.map +1 -1
- package/build/api-types/openai-responses/tool-codec.d.ts +11 -11
- package/build/api-types/openai-responses/tool-codec.js +36 -32
- package/build/api-types/openai-responses/tool-codec.js.map +1 -1
- package/build/assets.d.ts +7 -0
- package/build/assets.js +8 -0
- package/build/assets.js.map +1 -0
- package/build/compatible-engine/session.d.ts +67 -0
- package/build/compatible-engine/session.js +92 -0
- package/build/compatible-engine/session.js.map +1 -0
- package/build/compatible-engine/structuring.d.ts +36 -0
- package/build/compatible-engine/structuring.js +34 -0
- package/build/compatible-engine/structuring.js.map +1 -0
- package/build/compatible-engine/validation.d.ts +21 -0
- package/build/compatible-engine/validation.js +82 -0
- package/build/compatible-engine/validation.js.map +1 -0
- package/build/compatible-engine.d/agentloop.d.ts +12 -0
- package/build/compatible-engine.d/agentloop.js +52 -0
- package/build/compatible-engine.d/agentloop.js.map +1 -0
- package/build/compatible-engine.d/aliyun/transport.d.ts +12 -0
- package/build/compatible-engine.d/aliyun/transport.js +7 -0
- package/build/compatible-engine.d/aliyun/transport.js.map +1 -0
- package/build/compatible-engine.d/aliyun.d.ts +24 -0
- package/build/compatible-engine.d/aliyun.js +46 -0
- package/build/compatible-engine.d/aliyun.js.map +1 -0
- package/build/compatible-engine.d/anthropic/choice-codec.d.ts +5 -0
- package/build/compatible-engine.d/anthropic/choice-codec.js +26 -0
- package/build/compatible-engine.d/anthropic/choice-codec.js.map +1 -0
- package/build/compatible-engine.d/anthropic/message-codec.d.ts +36 -0
- package/build/compatible-engine.d/anthropic/message-codec.js +86 -0
- package/build/compatible-engine.d/anthropic/message-codec.js.map +1 -0
- package/build/compatible-engine.d/anthropic/transport.d.ts +34 -0
- package/build/compatible-engine.d/anthropic/transport.js +150 -0
- package/build/compatible-engine.d/anthropic/transport.js.map +1 -0
- package/build/compatible-engine.d/anthropic.d.ts +26 -0
- package/build/compatible-engine.d/anthropic.js +46 -0
- package/build/compatible-engine.d/anthropic.js.map +1 -0
- package/build/compatible-engine.d/google/choice-codec.d.ts +5 -0
- package/build/compatible-engine.d/google/choice-codec.js +27 -0
- package/build/compatible-engine.d/google/choice-codec.js.map +1 -0
- package/build/compatible-engine.d/google/message-codec.d.ts +36 -0
- package/build/compatible-engine.d/google/message-codec.js +94 -0
- package/build/compatible-engine.d/google/message-codec.js.map +1 -0
- package/build/compatible-engine.d/google/transport.d.ts +30 -0
- package/build/{compatible.d → compatible-engine.d}/google/transport.js +22 -18
- package/build/compatible-engine.d/google/transport.js.map +1 -0
- package/build/compatible-engine.d/google.d.ts +26 -0
- package/build/compatible-engine.d/google.js +50 -0
- package/build/compatible-engine.d/google.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions/choice-codec.d.ts +5 -0
- package/build/compatible-engine.d/openai-chatcompletions/choice-codec.js +31 -0
- package/build/compatible-engine.d/openai-chatcompletions/choice-codec.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions/message-codec.d.ts +24 -0
- package/build/compatible-engine.d/openai-chatcompletions/message-codec.js +71 -0
- package/build/compatible-engine.d/openai-chatcompletions/message-codec.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.d/monolith.d.ts +38 -0
- package/build/{compatible.d/openai-chatcompletions.d → compatible-engine.d/openai-chatcompletions/transport.d}/monolith.js +25 -22
- package/build/compatible-engine.d/openai-chatcompletions/transport.d/monolith.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.d/stream.d.ts +37 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.d/stream.js +190 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.d/stream.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.d.ts +10 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.js +11 -0
- package/build/compatible-engine.d/openai-chatcompletions/transport.js.map +1 -0
- package/build/compatible-engine.d/openai-chatcompletions.d.ts +17 -0
- package/build/compatible-engine.d/openai-chatcompletions.js +14 -0
- package/build/compatible-engine.d/openai-chatcompletions.js.map +1 -0
- package/build/compatible-engine.d/openai-responses/choice-codec.d.ts +5 -0
- package/build/compatible-engine.d/openai-responses/choice-codec.js +30 -0
- package/build/compatible-engine.d/openai-responses/choice-codec.js.map +1 -0
- package/build/compatible-engine.d/openai-responses/message-codec.d.ts +36 -0
- package/build/compatible-engine.d/openai-responses/message-codec.js +96 -0
- package/build/compatible-engine.d/openai-responses/message-codec.js.map +1 -0
- package/build/compatible-engine.d/openai-responses/transport.d.ts +35 -0
- package/build/{compatible.d → compatible-engine.d}/openai-responses/transport.js +21 -29
- package/build/compatible-engine.d/openai-responses/transport.js.map +1 -0
- package/build/compatible-engine.d/openai-responses.d.ts +26 -0
- package/build/compatible-engine.d/openai-responses.js +46 -0
- package/build/compatible-engine.d/openai-responses.js.map +1 -0
- package/build/compatible-engine.d.ts +22 -0
- package/build/compatible-engine.js +29 -0
- package/build/compatible-engine.js.map +1 -0
- package/build/config.d.ts +1 -0
- package/build/config.js +1 -2
- package/build/config.js.map +1 -1
- package/build/endpoint-spec.d.ts +1 -0
- package/build/endpoint-spec.js +2 -1
- package/build/endpoint-spec.js.map +1 -1
- package/build/engine/session.d.ts +7 -0
- package/build/{session.js.map → engine/session.js.map} +1 -1
- package/build/engine/transport.d.ts +5 -0
- package/build/engine/transport.js +1 -0
- package/build/engine/transport.js.map +1 -0
- package/build/engine/validation.d.ts +9 -0
- package/build/engine/validation.js +1 -0
- package/build/engine/validation.js.map +1 -0
- package/build/engine.d.ts +49 -40
- package/build/engine.js +88 -70
- package/build/engine.js.map +1 -1
- package/build/exports.d.ts +14 -14
- package/build/exports.js +14 -14
- package/build/exports.js.map +1 -1
- package/build/function.d.ts +79 -66
- package/build/function.js +30 -47
- package/build/function.js.map +1 -1
- package/build/inference-context.d.ts +2 -2
- package/build/inference-context.js +0 -1
- package/build/inference-context.js.map +1 -1
- package/build/native-engines.d/google/message-codec.d.ts +18 -16
- package/build/native-engines.d/google/message-codec.js +31 -33
- package/build/native-engines.d/google/message-codec.js.map +1 -1
- package/build/native-engines.d/google/session.d.ts +44 -51
- package/build/native-engines.d/google/session.js +85 -81
- package/build/native-engines.d/google/session.js.map +1 -1
- package/build/native-engines.d/google/transport.d.ts +22 -19
- package/build/native-engines.d/google/transport.js +13 -13
- package/build/native-engines.d/google/transport.js.map +1 -1
- package/build/native-engines.d/google/validation.d.ts +22 -0
- package/build/native-engines.d/google/validation.js +20 -0
- package/build/native-engines.d/google/validation.js.map +1 -0
- package/build/native-engines.d/google.d/agentloop.d.ts +12 -0
- package/build/native-engines.d/google.d/agentloop.js +57 -0
- package/build/native-engines.d/google.d/agentloop.js.map +1 -0
- package/build/native-engines.d/google.d/exports.d.ts +3 -0
- package/build/native-engines.d/google.d/exports.js +4 -0
- package/build/native-engines.d/google.d/exports.js.map +1 -0
- package/build/native-engines.d/google.d.ts +42 -0
- package/build/native-engines.d/google.js +83 -0
- package/build/native-engines.d/google.js.map +1 -0
- package/build/native-engines.d/openai-responses/choice-codec.d.ts +5 -0
- package/build/native-engines.d/openai-responses/choice-codec.js +30 -0
- package/build/native-engines.d/openai-responses/choice-codec.js.map +1 -0
- package/build/native-engines.d/openai-responses/message-codec.d.ts +19 -17
- package/build/native-engines.d/openai-responses/message-codec.js +31 -25
- package/build/native-engines.d/openai-responses/message-codec.js.map +1 -1
- package/build/native-engines.d/openai-responses/session.d.ts +47 -45
- package/build/native-engines.d/openai-responses/session.js +75 -105
- package/build/native-engines.d/openai-responses/session.js.map +1 -1
- package/build/native-engines.d/openai-responses/structuring.d.ts +19 -0
- package/build/native-engines.d/openai-responses/structuring.js +19 -0
- package/build/native-engines.d/openai-responses/structuring.js.map +1 -0
- package/build/native-engines.d/openai-responses/tool.d.ts +15 -12
- package/build/native-engines.d/openai-responses/tool.js +1 -12
- package/build/native-engines.d/openai-responses/tool.js.map +1 -1
- package/build/native-engines.d/openai-responses/transport.d.ts +24 -25
- package/build/native-engines.d/openai-responses/transport.js +21 -41
- package/build/native-engines.d/openai-responses/transport.js.map +1 -1
- package/build/native-engines.d/openai-responses/validation.d.ts +20 -0
- package/build/native-engines.d/openai-responses/validation.js +80 -0
- package/build/native-engines.d/openai-responses/validation.js.map +1 -0
- package/build/native-engines.d/openai-responses.d/agentloop.d.ts +12 -0
- package/build/native-engines.d/openai-responses.d/agentloop.js +61 -0
- package/build/native-engines.d/openai-responses.d/agentloop.js.map +1 -0
- package/build/native-engines.d/openai-responses.d/exports.d.ts +4 -0
- package/build/native-engines.d/openai-responses.d/exports.js +5 -0
- package/build/native-engines.d/openai-responses.d/exports.js.map +1 -0
- package/build/native-engines.d/openai-responses.d.ts +44 -0
- package/build/native-engines.d/openai-responses.js +78 -0
- package/build/native-engines.d/openai-responses.js.map +1 -0
- package/build/throttle.d.ts +6 -5
- package/build/throttle.js +17 -14
- package/build/throttle.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/verbatim/codec/declarations.d.ts +2 -0
- package/build/verbatim/codec/declarations.js +22 -0
- package/build/verbatim/codec/declarations.js.map +1 -0
- package/build/verbatim/codec/request.d.ts +7 -0
- package/build/verbatim/codec/request.js +53 -0
- package/build/verbatim/codec/request.js.map +1 -0
- package/build/verbatim/codec.d.ts +2 -0
- package/build/verbatim/codec.js +3 -0
- package/build/verbatim/codec.js.map +1 -0
- package/build/verbatim.d.ts +74 -0
- package/build/verbatim.js +17 -0
- package/build/verbatim.js.map +1 -0
- package/examples/agent.ts +65 -0
- package/examples/chat.ts +24 -0
- package/examples/config.ts +24 -0
- package/{test/src → examples}/tsconfig.json +6 -2
- package/examples/verbatim.ts +44 -0
- package/package.json +15 -13
- package/build/agentloop.d.ts +0 -12
- package/build/agentloop.js +0 -43
- package/build/agentloop.js.map +0 -1
- package/build/api-types/openai-chatcompletion/billing.js.map +0 -1
- package/build/api-types/openai-chatcompletion/tool-codec.d.ts +0 -18
- package/build/api-types/openai-chatcompletion/tool-codec.js.map +0 -1
- package/build/compatible/engine.d/aliyun.d.ts +0 -23
- package/build/compatible/engine.d/aliyun.js +0 -44
- package/build/compatible/engine.d/aliyun.js.map +0 -1
- package/build/compatible/engine.d/anthropic.d.ts +0 -23
- package/build/compatible/engine.d/anthropic.js +0 -41
- package/build/compatible/engine.d/anthropic.js.map +0 -1
- package/build/compatible/engine.d/google.d.ts +0 -23
- package/build/compatible/engine.d/google.js +0 -45
- package/build/compatible/engine.d/google.js.map +0 -1
- package/build/compatible/engine.d/openai-responses.d.ts +0 -23
- package/build/compatible/engine.d/openai-responses.js +0 -41
- package/build/compatible/engine.d/openai-responses.js.map +0 -1
- package/build/compatible/engine.d.ts +0 -18
- package/build/compatible/engine.js +0 -21
- package/build/compatible/engine.js.map +0 -1
- package/build/compatible/session.d.ts +0 -78
- package/build/compatible/session.js +0 -138
- package/build/compatible/session.js.map +0 -1
- package/build/compatible/tool-call-validator.d.ts +0 -11
- package/build/compatible/tool-call-validator.js +0 -12
- package/build/compatible/tool-call-validator.js.map +0 -1
- package/build/compatible.d/aliyun/transport.d.ts +0 -11
- package/build/compatible.d/aliyun/transport.js +0 -9
- package/build/compatible.d/aliyun/transport.js.map +0 -1
- package/build/compatible.d/anthropic/message-codec.d.ts +0 -31
- package/build/compatible.d/anthropic/message-codec.js +0 -88
- package/build/compatible.d/anthropic/message-codec.js.map +0 -1
- package/build/compatible.d/anthropic/transport.d.ts +0 -31
- package/build/compatible.d/anthropic/transport.js +0 -137
- package/build/compatible.d/anthropic/transport.js.map +0 -1
- package/build/compatible.d/google/message-codec.d.ts +0 -31
- package/build/compatible.d/google/message-codec.js +0 -98
- package/build/compatible.d/google/message-codec.js.map +0 -1
- package/build/compatible.d/google/transport.d.ts +0 -28
- package/build/compatible.d/google/transport.js.map +0 -1
- package/build/compatible.d/openai-chatcompletions/message-codec.d.ts +0 -19
- package/build/compatible.d/openai-chatcompletions/message-codec.js +0 -66
- package/build/compatible.d/openai-chatcompletions/message-codec.js.map +0 -1
- package/build/compatible.d/openai-chatcompletions/transport.d.ts +0 -9
- package/build/compatible.d/openai-chatcompletions/transport.js +0 -25
- package/build/compatible.d/openai-chatcompletions/transport.js.map +0 -1
- package/build/compatible.d/openai-chatcompletions.d/monolith.d.ts +0 -36
- package/build/compatible.d/openai-chatcompletions.d/monolith.js.map +0 -1
- package/build/compatible.d/openai-chatcompletions.d/stream.d.ts +0 -35
- package/build/compatible.d/openai-chatcompletions.d/stream.js +0 -196
- package/build/compatible.d/openai-chatcompletions.d/stream.js.map +0 -1
- package/build/compatible.d/openai-responses/message-codec.d.ts +0 -32
- package/build/compatible.d/openai-responses/message-codec.js +0 -105
- package/build/compatible.d/openai-responses/message-codec.js.map +0 -1
- package/build/compatible.d/openai-responses/transport.d.ts +0 -33
- package/build/compatible.d/openai-responses/transport.js.map +0 -1
- package/build/frontmatter.d.ts +0 -5
- package/build/frontmatter.js +0 -13
- package/build/frontmatter.js.map +0 -1
- package/build/native-engines.d/google/agentloop.d.ts +0 -12
- package/build/native-engines.d/google/agentloop.js +0 -42
- package/build/native-engines.d/google/agentloop.js.map +0 -1
- package/build/native-engines.d/google/engine.d.ts +0 -35
- package/build/native-engines.d/google/engine.js +0 -73
- package/build/native-engines.d/google/engine.js.map +0 -1
- package/build/native-engines.d/google/exports.d.ts +0 -5
- package/build/native-engines.d/google/exports.js +0 -6
- package/build/native-engines.d/google/exports.js.map +0 -1
- package/build/native-engines.d/openai-responses/agentloop.d.ts +0 -13
- package/build/native-engines.d/openai-responses/agentloop.js +0 -53
- package/build/native-engines.d/openai-responses/agentloop.js.map +0 -1
- package/build/native-engines.d/openai-responses/engine.d.ts +0 -32
- package/build/native-engines.d/openai-responses/engine.js +0 -63
- package/build/native-engines.d/openai-responses/engine.js.map +0 -1
- package/build/native-engines.d/openai-responses/exports.d.ts +0 -6
- package/build/native-engines.d/openai-responses/exports.js +0 -7
- package/build/native-engines.d/openai-responses/exports.js.map +0 -1
- package/build/native-engines.d/openai-responses/tool-call-validator.d.ts +0 -12
- package/build/native-engines.d/openai-responses/tool-call-validator.js +0 -33
- package/build/native-engines.d/openai-responses/tool-call-validator.js.map +0 -1
- package/build/session.d.ts +0 -7
- package/test/build/test-codecs.d.ts +0 -1
- package/test/build/test-codecs.js +0 -230
- package/test/build/test-codecs.js.map +0 -1
- package/test/build/test-compatible-engine.d.ts +0 -1
- package/test/build/test-compatible-engine.js +0 -27
- package/test/build/test-compatible-engine.js.map +0 -1
- package/test/build/test-compatible-engines.d.ts +0 -1
- package/test/build/test-compatible-engines.js +0 -112
- package/test/build/test-compatible-engines.js.map +0 -1
- package/test/build/test-engine.d.ts +0 -1
- package/test/build/test-engine.js +0 -97
- package/test/build/test-engine.js.map +0 -1
- package/test/build/test-helpers.d.ts +0 -46
- package/test/build/test-helpers.js +0 -45
- package/test/build/test-helpers.js.map +0 -1
- package/test/build/test-native-engines.d.ts +0 -1
- package/test/build/test-native-engines.js +0 -64
- package/test/build/test-native-engines.js.map +0 -1
- package/test/build/test.d.ts +0 -5
- package/test/build/test.js +0 -6
- package/test/build/test.js.map +0 -1
- package/test/build/tsconfig.tsbuildinfo +0 -1
- package/test/src/test-codecs.ts +0 -256
- package/test/src/test-compatible-engine.ts +0 -45
- package/test/src/test-compatible-engines.ts +0 -129
- package/test/src/test-engine.ts +0 -144
- package/test/src/test-helpers.ts +0 -53
- package/test/src/test-native-engines.ts +0 -75
- package/test/src/test.ts +0 -5
- /package/build/{session.js → engine/session.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/anthropic/tool-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/anthropic/tool-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAGtB,MAAM,OAAO,SAAS;IACW;IAA7B,YAA6B,GAA2B;QAA3B,QAAG,GAAH,GAAG,CAAwB;IAAG,CAAC;IAErD,kBAAkB,CACrB,EAA2B;QAE3B,MAAM,IAAI,KAAK,C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EtC,OAAO;YACH,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YAChB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW;YACnC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,UAAqB;SACjD,CAAC;IACN,CAAC;IAEM,4BAA4B,CAC/B,GAAQ;QAER,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAoC,CAAC;QAEzE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC;CAEJ"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as Google from '@google/genai';
|
|
2
|
-
import type { Pricing } from '
|
|
3
|
-
export declare class
|
|
4
|
-
protected ctx:
|
|
5
|
-
constructor(ctx:
|
|
2
|
+
import type { Pricing } from '../../engine.ts';
|
|
3
|
+
export declare class Billing {
|
|
4
|
+
protected ctx: Billing.Context;
|
|
5
|
+
constructor(ctx: Billing.Context);
|
|
6
6
|
charge(usageMetadata: Google.GenerateContentResponseUsageMetadata): number;
|
|
7
7
|
}
|
|
8
|
-
export declare namespace
|
|
8
|
+
export declare namespace Billing {
|
|
9
9
|
interface Context {
|
|
10
10
|
pricing: Pricing;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/api-types/google/billing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/api-types/google/billing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,OAAO,OAAO;IACa;IAA7B,YAA6B,GAAoB;QAApB,QAAG,GAAH,GAAG,CAAiB;IAAG,CAAC;IAE9C,MAAM,CAAC,aAA0D;QACpE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAEpC,IAAI,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAA,CAAC;;YAAM,MAAM,IAAI,KAAK,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QACrH,MAAM,oBAAoB,GAAG,aAAa,CAAC,oBAAoB,IAAI,CAAC,CAAC;QACrE,MAAM,kBAAkB,GAAG,aAAa,CAAC,uBAAuB,IAAI,CAAC,CAAC;QACtE,MAAM,mBAAmB,GAAG,aAAa,CAAC,gBAAgB,GAAG,kBAAkB,CAAC;QAChF,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,IAAI,CAAC,CAAC;QACjE,MAAM,IAAI,GACN,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,mBAAmB,GAAG,GAAG;YACvD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,kBAAkB,GAAG,GAAG;YACtD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,GAAG,oBAAoB,GAAG,GAAG;YACzD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,GAAG,kBAAkB,GAAG,GAAG,CAAC;QAC5D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restful-request.js","sourceRoot":"","sources":["../../../src/api-types/google/restful-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"restful-request.js","sourceRoot":"","sources":["../../../src/api-types/google/restful-request.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Function } from '
|
|
1
|
+
import { Function } from '../../function.ts';
|
|
2
2
|
import * as Google from '@google/genai';
|
|
3
|
-
export declare class
|
|
4
|
-
protected ctx:
|
|
5
|
-
constructor(ctx:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
protected
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export declare class ToolCodec<in out fdm extends Function.Decl.Map.Proto> {
|
|
4
|
+
protected ctx: ToolCodec.Context<fdm>;
|
|
5
|
+
constructor(ctx: ToolCodec.Context<fdm>);
|
|
6
|
+
encodeFunctionCall(fc: Function.Call.From<fdm>): Google.FunctionCall;
|
|
7
|
+
encodeFunctionDeclarationMap(fdm: fdm): Google.FunctionDeclaration[];
|
|
8
|
+
protected encodeFunctionDeclarationEntry(fdentry: Function.Decl.Entry.From<fdm>): Google.FunctionDeclaration;
|
|
9
|
+
decodeFunctionCall(googlefc: Google.FunctionCall): Function.Call.From<fdm>;
|
|
10
|
+
encodeFunctionResponse(fr: Function.Response.From<fdm>): Google.Part;
|
|
11
11
|
}
|
|
12
|
-
export declare namespace
|
|
13
|
-
interface Context<in out fdm extends Function.
|
|
12
|
+
export declare namespace ToolCodec {
|
|
13
|
+
interface Context<in out fdm extends Function.Decl.Map.Proto> {
|
|
14
14
|
fdm: fdm;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { ResponseInvalid } from
|
|
2
|
-
import { Function } from
|
|
1
|
+
import { ResponseInvalid } from "../../engine.js";
|
|
2
|
+
import { Function } from "../../function.js";
|
|
3
3
|
import * as Google from '@google/genai';
|
|
4
4
|
import Ajv from 'ajv';
|
|
5
5
|
const ajv = new Ajv();
|
|
6
|
-
export class
|
|
6
|
+
export class ToolCodec {
|
|
7
7
|
ctx;
|
|
8
8
|
constructor(ctx) {
|
|
9
9
|
this.ctx = ctx;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
encodeFunctionCall(fc) {
|
|
12
12
|
return {
|
|
13
13
|
id: fc.id,
|
|
14
14
|
name: fc.name,
|
|
15
15
|
args: fc.args,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
encodeFunctionDeclarationMap(fdm) {
|
|
19
19
|
const fdentries = Object.entries(fdm);
|
|
20
|
-
return fdentries.map(fdentry => this.
|
|
20
|
+
return fdentries.map(fdentry => this.encodeFunctionDeclarationEntry(fdentry));
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
const json = JSON.stringify(fdentry[1].
|
|
22
|
+
encodeFunctionDeclarationEntry(fdentry) {
|
|
23
|
+
const json = JSON.stringify(fdentry[1].parameters);
|
|
24
24
|
const parsed = JSON.parse(json, (key, value) => {
|
|
25
25
|
if (key === 'type' && typeof value === 'string') {
|
|
26
26
|
if (value === 'string')
|
|
@@ -47,7 +47,7 @@ export class GoogleToolCodec {
|
|
|
47
47
|
parameters: parsed,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
decodeFunctionCall(googlefc) {
|
|
51
51
|
if (googlefc.name) { }
|
|
52
52
|
else
|
|
53
53
|
throw new Error();
|
|
@@ -55,24 +55,26 @@ export class GoogleToolCodec {
|
|
|
55
55
|
if (fditem) { }
|
|
56
56
|
else
|
|
57
57
|
throw new ResponseInvalid('Unknown function call', { cause: googlefc });
|
|
58
|
-
if (ajv.validate(fditem.
|
|
58
|
+
if (ajv.validate(fditem.parameters, googlefc.args)) { }
|
|
59
59
|
else
|
|
60
60
|
throw new ResponseInvalid('Function call not conforming to schema', { cause: googlefc });
|
|
61
|
-
return Function.Call.
|
|
61
|
+
return Function.Call.of({
|
|
62
62
|
id: googlefc.id,
|
|
63
63
|
name: googlefc.name,
|
|
64
64
|
args: googlefc.args,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
else if (
|
|
73
|
-
return {
|
|
67
|
+
encodeFunctionResponse(fr) {
|
|
68
|
+
if (fr instanceof Function.Response.Successful)
|
|
69
|
+
return {
|
|
70
|
+
functionResponse: { id: fr.id, name: fr.name, response: { output: fr.text } },
|
|
71
|
+
};
|
|
72
|
+
else if (fr instanceof Function.Response.Failed)
|
|
73
|
+
return {
|
|
74
|
+
functionResponse: { id: fr.id, name: fr.name, response: { error: fr.error } },
|
|
75
|
+
};
|
|
74
76
|
else
|
|
75
|
-
|
|
77
|
+
throw new Error();
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
//# sourceMappingURL=tool-codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/google/tool-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/google/tool-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAItB,MAAM,OAAO,SAAS;IACW;IAA7B,YAA6B,GAA2B;QAA3B,QAAG,GAAH,GAAG,CAAwB;IAAG,CAAC;IAErD,kBAAkB,CACrB,EAA2B;QAE3B,OAAO;YACH,EAAE,EAAE,EAAE,CAAC,EAAE;YACT,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,IAAI,EAAE,EAAE,CAAC,IAA+B;SAC3C,CAAC;IACN,CAAC;IAEM,4BAA4B,CAAC,GAAQ;QACxC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAoC,CAAC;QACzE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC;IAES,8BAA8B,CACpC,OAAsC;QAEtC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC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AE,QAAQ,EAAE,CAAC,CAAC;QAC5F,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA,CAAC;;YACjD,MAAM,IAAI,eAAe,CAAC,wCAAwC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9F,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACa,CAAC,CAAC;IAC1C,CAAC;IAEM,sBAAsB,CACzB,EAA+B;QAE/B,IAAI,EAAE,YAAY,QAAQ,CAAC,QAAQ,CAAC,UAAU;YAAE,OAAO;gBACnD,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;aAChF,CAAC;aAAM,IAAI,EAAE,YAAY,QAAQ,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO;gBACvD,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;aAChF,CAAC;;YAAM,MAAM,IAAI,KAAK,EAAE,CAAC;IAC9B,CAAC;CAEJ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Pricing } from '
|
|
1
|
+
import type { Pricing } from '../../engine.ts';
|
|
2
2
|
import OpenAI from 'openai';
|
|
3
|
-
|
|
4
|
-
export declare class OpenAIChatCompletionsBilling<in out fdm extends Function.Declaration.Map> {
|
|
3
|
+
export declare class OpenAIChatCompletionsBilling {
|
|
5
4
|
protected ctx: OpenAIChatCompletionsBilling.Context;
|
|
6
5
|
constructor(ctx: OpenAIChatCompletionsBilling.Context);
|
|
7
6
|
charge(usage: OpenAI.CompletionUsage): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/api-types/openai-chatcompletions/billing.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,4BAA4B;IACR;IAA7B,YAA6B,GAAyC;QAAzC,QAAG,GAAH,GAAG,CAAsC;IAAG,CAAC;IAEnE,MAAM,CAAC,KAA6B;QACvC,MAAM,kBAAkB,GAAG,KAAK,CAAC,qBAAqB,EAAE,aAAa,IAAI,CAAC,CAAC;QAC3E,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,GAAG,kBAAkB,CAAC;QACrE,OAAO,CACH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,mBAAmB,GAAG,GAAG;YACvD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,kBAAkB,GAAG,GAAG;YACtD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,iBAAiB,GAAG,GAAG,CAC/D,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Function } from '../../function.ts';
|
|
2
|
+
import OpenAI from 'openai';
|
|
3
|
+
export declare class OpenAIChatCompletionsToolCodec<in out fdm extends Function.Decl.Map.Proto> {
|
|
4
|
+
protected ctx: OpenAIChatCompletionsToolCodec.Context<fdm>;
|
|
5
|
+
constructor(ctx: OpenAIChatCompletionsToolCodec.Context<fdm>);
|
|
6
|
+
encodeFunctionCall(fc: Function.Call.From<fdm>): OpenAI.ChatCompletionMessageToolCall;
|
|
7
|
+
decodeFunctionCall(apifc: OpenAI.ChatCompletionMessageFunctionToolCall): Function.Call.From<fdm>;
|
|
8
|
+
encodeFunctionResponse(fr: Function.Response.From<fdm>): OpenAI.ChatCompletionToolMessageParam;
|
|
9
|
+
protected encodeFunctionDeclarationEntry(fdentry: Function.Decl.Entry.From<fdm>): OpenAI.ChatCompletionTool;
|
|
10
|
+
encodeFunctionDeclarationMap(fdm: fdm): OpenAI.ChatCompletionTool[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace OpenAIChatCompletionsToolCodec {
|
|
13
|
+
interface Context<in out fdm extends Function.Decl.Map.Proto> {
|
|
14
|
+
parallelToolCall: boolean;
|
|
15
|
+
fdm: fdm;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Function } from
|
|
2
|
-
import
|
|
3
|
-
import { ResponseInvalid } from '#@/engine.ts';
|
|
1
|
+
import { Function } from "../../function.js";
|
|
2
|
+
import { ResponseInvalid } from "../../engine.js";
|
|
4
3
|
import Ajv from 'ajv';
|
|
5
4
|
const ajv = new Ajv();
|
|
6
5
|
export class OpenAIChatCompletionsToolCodec {
|
|
@@ -8,7 +7,7 @@ export class OpenAIChatCompletionsToolCodec {
|
|
|
8
7
|
constructor(ctx) {
|
|
9
8
|
this.ctx = ctx;
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
encodeFunctionCall(fc) {
|
|
12
11
|
if (fc.id) { }
|
|
13
12
|
else
|
|
14
13
|
throw new Error();
|
|
@@ -21,7 +20,7 @@ export class OpenAIChatCompletionsToolCodec {
|
|
|
21
20
|
},
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
decodeFunctionCall(apifc) {
|
|
25
24
|
const fditem = this.ctx.fdm[apifc.function.name];
|
|
26
25
|
if (fditem) { }
|
|
27
26
|
else
|
|
@@ -31,56 +30,51 @@ export class OpenAIChatCompletionsToolCodec {
|
|
|
31
30
|
return JSON.parse(apifc.function.arguments);
|
|
32
31
|
}
|
|
33
32
|
catch (e) {
|
|
34
|
-
|
|
33
|
+
throw new ResponseInvalid('Invalid JSON of function call', { cause: apifc });
|
|
35
34
|
}
|
|
36
35
|
})();
|
|
37
|
-
if (ajv.validate(fditem.
|
|
36
|
+
if (ajv.validate(fditem.parameters, args)) { }
|
|
38
37
|
else
|
|
39
38
|
throw new ResponseInvalid('Invalid function arguments', { cause: apifc });
|
|
40
|
-
return Function.Call.
|
|
39
|
+
return Function.Call.of({
|
|
41
40
|
id: apifc.id,
|
|
42
41
|
name: apifc.function.name,
|
|
43
42
|
args,
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
|
-
|
|
45
|
+
encodeFunctionResponse(fr) {
|
|
47
46
|
if (fr.id) { }
|
|
48
47
|
else
|
|
49
48
|
throw new Error();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
if (fr instanceof Function.Response.Successful)
|
|
50
|
+
return {
|
|
51
|
+
role: 'tool',
|
|
52
|
+
tool_call_id: fr.id,
|
|
53
|
+
content: fr.text,
|
|
54
|
+
};
|
|
55
|
+
else if (fr instanceof Function.Response.Failed)
|
|
56
|
+
return {
|
|
57
|
+
role: 'tool',
|
|
58
|
+
tool_call_id: fr.id,
|
|
59
|
+
content: fr.error,
|
|
60
|
+
};
|
|
61
|
+
else
|
|
62
|
+
throw new Error();
|
|
55
63
|
}
|
|
56
|
-
|
|
64
|
+
encodeFunctionDeclarationEntry(fdentry) {
|
|
57
65
|
return {
|
|
58
66
|
type: 'function',
|
|
59
67
|
function: {
|
|
60
68
|
name: fdentry[0],
|
|
61
69
|
description: fdentry[1].description,
|
|
62
70
|
strict: true,
|
|
63
|
-
parameters: fdentry[1].
|
|
71
|
+
parameters: fdentry[1].parameters,
|
|
64
72
|
},
|
|
65
73
|
};
|
|
66
74
|
}
|
|
67
|
-
|
|
75
|
+
encodeFunctionDeclarationMap(fdm) {
|
|
68
76
|
const fdentries = Object.entries(fdm);
|
|
69
|
-
return fdentries.map(fdentry => this.
|
|
70
|
-
}
|
|
71
|
-
convertFromToolChoice(toolChoice) {
|
|
72
|
-
if (toolChoice === Function.ToolChoice.NONE)
|
|
73
|
-
return 'none';
|
|
74
|
-
else if (toolChoice === Function.ToolChoice.REQUIRED)
|
|
75
|
-
return 'required';
|
|
76
|
-
else if (toolChoice === Function.ToolChoice.AUTO)
|
|
77
|
-
return 'auto';
|
|
78
|
-
else {
|
|
79
|
-
if (toolChoice.length === 1) { }
|
|
80
|
-
else
|
|
81
|
-
throw new Error();
|
|
82
|
-
return { type: 'function', function: { name: toolChoice[0] } };
|
|
83
|
-
}
|
|
77
|
+
return fdentries.map(fdentry => this.encodeFunctionDeclarationEntry(fdentry));
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
80
|
//# sourceMappingURL=tool-codec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/openai-chatcompletions/tool-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAGtB,MAAM,OAAO,8BAA8B;IACV;IAA7B,YAA6B,GAAgD;QAAhD,QAAG,GAAH,GAAG,CAA6C;IAAG,CAAC;IAG1E,kBAAkB,CACrB,EAA2B;QAE3B,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC;;YAAM,MAAM,IAAI,KAAK,EAAE,CAAC;QACrC,OAAO;YACH,EAAE,EAAE,EAAE,CAAC,EAAE;YACT,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACN,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC;aACrC;SACJ,CAAC;IACN,CAAC;IAEM,kBAAkB,CACrB,KAAmD;QAEnD,MAAM,MAAM,GAAG,IAAI,CAA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3C,OAAO;gBACH,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,EAAE,CAAC,EAAE;gBACnB,OAAO,EAAE,EAAE,CAAC,KAAK;aACpB,CAAC;;YACD,MAAM,IAAI,KAAK,EAAE,CAAC;IAC3B,CAAC;IAES,8BAA8B,CACpC,OAAsC;QAEtC,OAAO;YACH,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACN,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;gBAChB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW;gBACnC,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU;aACpC;SACJ,CAAC;IACN,CAAC;IAEM,4BAA4B,CAAC,GAAQ;QACxC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAoC,CAAC;QACzE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC;CAGJ"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
import type { Pricing } from '
|
|
3
|
-
export declare class
|
|
4
|
-
protected ctx:
|
|
5
|
-
constructor(ctx:
|
|
2
|
+
import type { Pricing } from '../../engine.ts';
|
|
3
|
+
export declare class Billing {
|
|
4
|
+
protected ctx: Billing.Context;
|
|
5
|
+
constructor(ctx: Billing.Context);
|
|
6
6
|
charge(usage: OpenAI.Responses.ResponseUsage): number;
|
|
7
7
|
}
|
|
8
|
-
export declare namespace
|
|
8
|
+
export declare namespace Billing {
|
|
9
9
|
interface Context {
|
|
10
10
|
pricing: Pricing;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/api-types/openai-responses/billing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/api-types/openai-responses/billing.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,OAAO;IACa;IAA7B,YAA6B,GAAoB;QAApB,QAAG,GAAH,GAAG,CAAiB;IAAG,CAAC;IAG9C,MAAM,CAAC,KAAqC;QAC/C,MAAM,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,CAAC,aAAa,CAAC;QACpE,MAAM,mBAAmB,GAAG,KAAK,CAAC,YAAY,GAAG,kBAAkB,CAAC;QACpE,OAAO,CACH,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,mBAAmB,GAAG,GAAG;YACvD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,GAAG,kBAAkB,GAAG,GAAG;YACtD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,aAAa,GAAG,GAAG,CAC3D,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
import { Function } from '
|
|
3
|
-
export declare class
|
|
4
|
-
protected ctx:
|
|
5
|
-
constructor(ctx:
|
|
6
|
-
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { Function } from '../../function.ts';
|
|
3
|
+
export declare class ToolCodec<in out fdm extends Function.Decl.Map.Proto> {
|
|
4
|
+
protected ctx: ToolCodec.Context<fdm>;
|
|
5
|
+
constructor(ctx: ToolCodec.Context<fdm>);
|
|
6
|
+
encodeFunctionResponse(fr: Function.Response.From<fdm>): OpenAI.Responses.ResponseInputItem.FunctionCallOutput;
|
|
7
|
+
protected encodeFunctionDeclarationEntry(fdentry: Function.Decl.Entry.From<fdm>): OpenAI.Responses.FunctionTool;
|
|
8
|
+
encodeFunctionDeclarationMap(fdm: fdm): OpenAI.Responses.FunctionTool[];
|
|
9
|
+
decodeFunctionCall(apifc: OpenAI.Responses.ResponseFunctionToolCall): Function.Call.From<fdm>;
|
|
10
|
+
encodeFunctionCall(fc: Function.Call.From<fdm>): OpenAI.Responses.ResponseFunctionToolCall;
|
|
11
11
|
}
|
|
12
|
-
export declare namespace
|
|
13
|
-
interface Context<in out fdm extends Function.
|
|
12
|
+
export declare namespace ToolCodec {
|
|
13
|
+
interface Context<in out fdm extends Function.Decl.Map.Proto> {
|
|
14
14
|
fdm: fdm;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ResponseInvalid } from '#@/engine.ts';
|
|
1
|
+
import { Function } from "../../function.js";
|
|
2
|
+
import { ResponseInvalid } from "../../engine.js";
|
|
4
3
|
import Ajv from 'ajv';
|
|
5
4
|
const ajv = new Ajv();
|
|
6
|
-
export class
|
|
5
|
+
export class ToolCodec {
|
|
7
6
|
ctx;
|
|
8
7
|
constructor(ctx) {
|
|
9
8
|
this.ctx = ctx;
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
encodeFunctionResponse(fr) {
|
|
12
11
|
if (fr.id) { }
|
|
13
12
|
else
|
|
14
13
|
throw new Error();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
if (fr instanceof Function.Response.Successful)
|
|
15
|
+
return {
|
|
16
|
+
type: 'function_call_output',
|
|
17
|
+
call_id: fr.id,
|
|
18
|
+
output: fr.text,
|
|
19
|
+
};
|
|
20
|
+
else if (fr instanceof Function.Response.Failed)
|
|
21
|
+
return {
|
|
22
|
+
type: 'function_call_output',
|
|
23
|
+
call_id: fr.id,
|
|
24
|
+
output: fr.error,
|
|
25
|
+
};
|
|
26
|
+
else
|
|
27
|
+
throw new Error();
|
|
20
28
|
}
|
|
21
|
-
|
|
29
|
+
encodeFunctionDeclarationEntry(fdentry) {
|
|
22
30
|
return {
|
|
23
31
|
name: fdentry[0],
|
|
24
32
|
description: fdentry[1].description,
|
|
25
|
-
parameters: fdentry[1].
|
|
33
|
+
parameters: fdentry[1].parameters,
|
|
26
34
|
strict: true,
|
|
27
35
|
type: 'function',
|
|
28
36
|
};
|
|
29
37
|
}
|
|
30
|
-
|
|
38
|
+
encodeFunctionDeclarationMap(fdm) {
|
|
31
39
|
const fdentries = Object.entries(fdm);
|
|
32
|
-
return fdentries.map(fdentry => this.
|
|
40
|
+
return fdentries.map(fdentry => this.encodeFunctionDeclarationEntry(fdentry));
|
|
33
41
|
}
|
|
34
|
-
|
|
35
|
-
if (toolChoice === Function.ToolChoice.NONE)
|
|
36
|
-
return 'none';
|
|
37
|
-
else if (toolChoice === Function.ToolChoice.REQUIRED)
|
|
38
|
-
return 'required';
|
|
39
|
-
else if (toolChoice === Function.ToolChoice.AUTO)
|
|
40
|
-
return 'auto';
|
|
41
|
-
else {
|
|
42
|
-
return {
|
|
43
|
-
type: 'allowed_tools',
|
|
44
|
-
mode: 'required',
|
|
45
|
-
tools: toolChoice.map(name => ({ type: 'function', name })),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
convertToFunctionCall(apifc) {
|
|
42
|
+
decodeFunctionCall(apifc) {
|
|
50
43
|
const fditem = this.ctx.fdm[apifc.name];
|
|
51
44
|
if (fditem) { }
|
|
52
45
|
else
|
|
@@ -59,14 +52,25 @@ export class OpenAIResponsesToolCodec {
|
|
|
59
52
|
throw new ResponseInvalid('Invalid JSON of function call', { cause: apifc });
|
|
60
53
|
}
|
|
61
54
|
})();
|
|
62
|
-
if (ajv.validate(fditem.
|
|
55
|
+
if (ajv.validate(fditem.parameters, args)) { }
|
|
63
56
|
else
|
|
64
57
|
throw new ResponseInvalid('Function call not conforming to schema', { cause: apifc });
|
|
65
|
-
return Function.Call.
|
|
58
|
+
return Function.Call.of({
|
|
66
59
|
id: apifc.call_id,
|
|
67
60
|
name: apifc.name,
|
|
68
61
|
args,
|
|
69
62
|
});
|
|
70
63
|
}
|
|
64
|
+
encodeFunctionCall(fc) {
|
|
65
|
+
if (fc.id) { }
|
|
66
|
+
else
|
|
67
|
+
throw new Error();
|
|
68
|
+
return {
|
|
69
|
+
type: 'function_call',
|
|
70
|
+
call_id: fc.id,
|
|
71
|
+
name: fc.name,
|
|
72
|
+
arguments: JSON.stringify(fc.args),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
71
75
|
}
|
|
72
76
|
//# sourceMappingURL=tool-codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/openai-responses/tool-codec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-codec.js","sourceRoot":"","sources":["../../../src/api-types/openai-responses/tool-codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAItB,MAAM,OAAO,SAAS;IAGW;IAA7B,YAA6B,GAA2B;QAA3B,QAAG,GAAH,GAAG,CAAwB;IAAG,CAAC;IAErD,sBAAsB,CACzB,EAA+B;QAE/B,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC;;YAAM,MAAM,IAAI,KAAK,EAAE,CAAC;QACrC,IAAI,EAAE,YAAY,QAAQ,CAAC,QAAQ,CAAC,UAAU;YAC1C,OAAO;gBACH,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,EAAE,CAAC,EAAE;gBACd,MAAM,EAAE,EAAE,CAAC,IAAI;aAClB,CAAC;aACD,IAAI,EAAE,YAAY,QAAQ,CAAC,QAAQ,CAAC,MAAM;YAC3C,OAAO;gBACH,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,EAAE,CAAC,EAAE;gBACd,MAAM,EAAE,EAAE,CAAC,KAA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,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3F,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,EAAE,EAAE,KAAK,CAAC,OAAO;YACjB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI;SAC4B,CAAC,CAAC;IAC1C,CAAC;IAEM,kBAAkB,CACrB,EAA2B;QAE3B,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC;;YAAM,MAAM,IAAI,KAAK,EAAE,CAAC;QACrC,OAAO;YACH,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,EAAE,CAAC,EAAE;YACd,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC;SACrC,CAAC;IACN,CAAC;CACJ"}
|
package/build/assets.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { loadtext } from '@zimtsui/node-loaders';
|
|
2
|
+
export default {
|
|
3
|
+
verbatim: {
|
|
4
|
+
instruction: loadtext(import.meta.resolve('../assets/verbatim/instruction.md')),
|
|
5
|
+
declarations: loadtext(import.meta.resolve('../assets/verbatim/declarations.handlebars')),
|
|
6
|
+
},
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,eAAe;IACX,QAAQ,EAAE;QACN,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;QAC/E,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;KAC5F;CACK,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Function } from '../function.ts';
|
|
2
|
+
import { Engine } from '../engine.ts';
|
|
3
|
+
import { Verbatim } from '../verbatim.ts';
|
|
4
|
+
declare const NOMINAL: unique symbol;
|
|
5
|
+
export interface Session<in out fdu extends Function.Decl.Proto, in out vdu extends Verbatim.Decl.Proto> extends Engine.Session<RoleMessage.User<fdu>, RoleMessage.Ai<fdu, vdu>, RoleMessage.Developer> {
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Session {
|
|
8
|
+
type From<fdm extends Function.Decl.Map.Proto, vdm extends Verbatim.Decl.Map.Proto> = Session<Function.Decl.From<fdm>, Verbatim.Decl.From<vdm>>;
|
|
9
|
+
type ChatMessage<fdu extends Function.Decl.Proto, vdu extends Verbatim.Decl.Proto> = Engine.Session.ChatMessage<RoleMessage.User<fdu>, RoleMessage.Ai<fdu, vdu>>;
|
|
10
|
+
namespace ChatMessage {
|
|
11
|
+
type From<fdm extends Function.Decl.Map.Proto, vdm extends Verbatim.Decl.Map.Proto> = ChatMessage<Function.Decl.From<fdm>, Verbatim.Decl.From<vdm>>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare namespace RoleMessage {
|
|
15
|
+
namespace Part {
|
|
16
|
+
class Text<out vdu extends Verbatim.Decl.Proto> {
|
|
17
|
+
text: string;
|
|
18
|
+
vrs: Verbatim.Request.Of<vdu>[];
|
|
19
|
+
static paragraph(text: string): Text<never>;
|
|
20
|
+
protected [NOMINAL]: never;
|
|
21
|
+
constructor(text: string, vrs: Verbatim.Request.Of<vdu>[]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class Ai<out fdu extends Function.Decl.Proto, out vdu extends Verbatim.Decl.Proto> {
|
|
25
|
+
protected parts: RoleMessage.Ai.Part<fdu, vdu>[];
|
|
26
|
+
protected [NOMINAL]: never;
|
|
27
|
+
constructor(parts: RoleMessage.Ai.Part<fdu, vdu>[]);
|
|
28
|
+
getParts(): RoleMessage.Ai.Part<fdu, vdu>[];
|
|
29
|
+
allTextPart(): boolean;
|
|
30
|
+
getTextParts(): RoleMessage.Part.Text<vdu>[];
|
|
31
|
+
getText(): string;
|
|
32
|
+
getFunctionCalls(): Function.Call.Of<fdu>[];
|
|
33
|
+
getVerbatimRequests(): Verbatim.Request.Of<vdu>[];
|
|
34
|
+
getOnlyFunctionCall(): Function.Call.Of<fdu>;
|
|
35
|
+
getOnlyVerbatimRequest(): Verbatim.Request.Of<vdu>;
|
|
36
|
+
}
|
|
37
|
+
namespace Ai {
|
|
38
|
+
type From<fdm extends Function.Decl.Map.Proto, vdm extends Verbatim.Decl.Map.Proto> = RoleMessage.Ai<Function.Decl.From<fdm>, Verbatim.Decl.From<vdm>>;
|
|
39
|
+
type Part<fdu extends Function.Decl.Proto, vdu extends Verbatim.Decl.Proto> = RoleMessage.Part.Text<vdu> | Function.Call.Of<fdu>;
|
|
40
|
+
namespace Part {
|
|
41
|
+
type From<fdm extends Function.Decl.Map.Proto, vdm extends Verbatim.Decl.Map.Proto> = RoleMessage.Ai.Part<Function.Decl.From<fdm>, Verbatim.Decl.From<vdm>>;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class User<out fdu extends Function.Decl.Proto> {
|
|
45
|
+
protected parts: RoleMessage.User.Part<fdu>[];
|
|
46
|
+
protected [NOMINAL]: never;
|
|
47
|
+
constructor(parts: RoleMessage.User.Part<fdu>[]);
|
|
48
|
+
getParts(): RoleMessage.User.Part<fdu>[];
|
|
49
|
+
getFunctionResponses(): Function.Response.Of<fdu>[];
|
|
50
|
+
getOnlyFunctionResponse(): Function.Response.Of<fdu>;
|
|
51
|
+
}
|
|
52
|
+
namespace User {
|
|
53
|
+
type From<fdm extends Function.Decl.Map.Proto> = RoleMessage.User<Function.Decl.From<fdm>>;
|
|
54
|
+
type Part<fdu extends Function.Decl.Proto> = RoleMessage.Part.Text<never> | Function.Response.Of<fdu>;
|
|
55
|
+
}
|
|
56
|
+
class Developer {
|
|
57
|
+
protected parts: RoleMessage.Developer.Part[];
|
|
58
|
+
protected [NOMINAL]: never;
|
|
59
|
+
constructor(parts: RoleMessage.Developer.Part[]);
|
|
60
|
+
getParts(): RoleMessage.Developer.Part[];
|
|
61
|
+
getText(): string;
|
|
62
|
+
}
|
|
63
|
+
namespace Developer {
|
|
64
|
+
type Part = RoleMessage.Part.Text<never>;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {};
|