@particle-academy/prism 0.0.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/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/audio/pending-request.d.ts +37 -0
- package/dist/audio/pending-request.d.ts.map +1 -0
- package/dist/audio/pending-request.js +91 -0
- package/dist/audio/pending-request.js.map +1 -0
- package/dist/audio/request.d.ts +37 -0
- package/dist/audio/request.d.ts.map +1 -0
- package/dist/audio/request.js +50 -0
- package/dist/audio/request.js.map +1 -0
- package/dist/audio/response.d.ts +24 -0
- package/dist/audio/response.d.ts.map +1 -0
- package/dist/audio/response.js +36 -0
- package/dist/audio/response.js.map +1 -0
- package/dist/batch/batch-job.d.ts +91 -0
- package/dist/batch/batch-job.d.ts.map +1 -0
- package/dist/batch/batch-job.js +156 -0
- package/dist/batch/batch-job.js.map +1 -0
- package/dist/batch/pending-request.d.ts +29 -0
- package/dist/batch/pending-request.d.ts.map +1 -0
- package/dist/batch/pending-request.js +73 -0
- package/dist/batch/pending-request.js.map +1 -0
- package/dist/batch/request.d.ts +73 -0
- package/dist/batch/request.d.ts.map +1 -0
- package/dist/batch/request.js +79 -0
- package/dist/batch/request.js.map +1 -0
- package/dist/embeddings/pending-request.d.ts +38 -0
- package/dist/embeddings/pending-request.d.ts.map +1 -0
- package/dist/embeddings/pending-request.js +86 -0
- package/dist/embeddings/pending-request.js.map +1 -0
- package/dist/embeddings/request.d.ts +27 -0
- package/dist/embeddings/request.d.ts.map +1 -0
- package/dist/embeddings/request.js +38 -0
- package/dist/embeddings/request.js.map +1 -0
- package/dist/embeddings/response.d.ts +19 -0
- package/dist/embeddings/response.d.ts.map +1 -0
- package/dist/embeddings/response.js +21 -0
- package/dist/embeddings/response.js.map +1 -0
- package/dist/enums.d.ts +52 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +69 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +119 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +115 -0
- package/dist/errors.js.map +1 -0
- package/dist/files/file-data.d.ts +53 -0
- package/dist/files/file-data.d.ts.map +1 -0
- package/dist/files/file-data.js +79 -0
- package/dist/files/file-data.js.map +1 -0
- package/dist/files/pending-request.d.ts +38 -0
- package/dist/files/pending-request.d.ts.map +1 -0
- package/dist/files/pending-request.js +96 -0
- package/dist/files/pending-request.js.map +1 -0
- package/dist/files/request.d.ts +77 -0
- package/dist/files/request.d.ts.map +1 -0
- package/dist/files/request.js +81 -0
- package/dist/files/request.js.map +1 -0
- package/dist/fim/pending-request.d.ts +31 -0
- package/dist/fim/pending-request.d.ts.map +1 -0
- package/dist/fim/pending-request.js +89 -0
- package/dist/fim/pending-request.js.map +1 -0
- package/dist/fim/request.d.ts +39 -0
- package/dist/fim/request.d.ts.map +1 -0
- package/dist/fim/request.js +65 -0
- package/dist/fim/request.js.map +1 -0
- package/dist/fim/response.d.ts +21 -0
- package/dist/fim/response.d.ts.map +1 -0
- package/dist/fim/response.js +30 -0
- package/dist/fim/response.js.map +1 -0
- package/dist/http/header-names.d.ts +36 -0
- package/dist/http/header-names.d.ts.map +1 -0
- package/dist/http/header-names.js +44 -0
- package/dist/http/header-names.js.map +1 -0
- package/dist/http/transport.d.ts +94 -0
- package/dist/http/transport.d.ts.map +1 -0
- package/dist/http/transport.js +131 -0
- package/dist/http/transport.js.map +1 -0
- package/dist/images/pending-request.d.ts +30 -0
- package/dist/images/pending-request.d.ts.map +1 -0
- package/dist/images/pending-request.js +66 -0
- package/dist/images/pending-request.js.map +1 -0
- package/dist/images/request.d.ts +19 -0
- package/dist/images/request.d.ts.map +1 -0
- package/dist/images/request.js +30 -0
- package/dist/images/request.js.map +1 -0
- package/dist/images/response.d.ts +29 -0
- package/dist/images/response.d.ts.map +1 -0
- package/dist/images/response.js +34 -0
- package/dist/images/response.js.map +1 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/filters.d.ts +40 -0
- package/dist/internal/filters.d.ts.map +1 -0
- package/dist/internal/filters.js +83 -0
- package/dist/internal/filters.js.map +1 -0
- package/dist/json.d.ts +41 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +75 -0
- package/dist/json.js.map +1 -0
- package/dist/moderation/pending-request.d.ts +24 -0
- package/dist/moderation/pending-request.d.ts.map +1 -0
- package/dist/moderation/pending-request.js +60 -0
- package/dist/moderation/pending-request.js.map +1 -0
- package/dist/moderation/request.d.ts +20 -0
- package/dist/moderation/request.d.ts.map +1 -0
- package/dist/moderation/request.js +31 -0
- package/dist/moderation/request.js.map +1 -0
- package/dist/moderation/response.d.ts +26 -0
- package/dist/moderation/response.d.ts.map +1 -0
- package/dist/moderation/response.js +34 -0
- package/dist/moderation/response.js.map +1 -0
- package/dist/prism.d.ts +43 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prism.js +79 -0
- package/dist/prism.js.map +1 -0
- package/dist/providers/anthropic/anthropic.d.ts +67 -0
- package/dist/providers/anthropic/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic/anthropic.js +172 -0
- package/dist/providers/anthropic/anthropic.js.map +1 -0
- package/dist/providers/anthropic/build-request-body.d.ts +15 -0
- package/dist/providers/anthropic/build-request-body.d.ts.map +1 -0
- package/dist/providers/anthropic/build-request-body.js +51 -0
- package/dist/providers/anthropic/build-request-body.js.map +1 -0
- package/dist/providers/anthropic/maps/finish-reason-map.d.ts +14 -0
- package/dist/providers/anthropic/maps/finish-reason-map.d.ts.map +1 -0
- package/dist/providers/anthropic/maps/finish-reason-map.js +30 -0
- package/dist/providers/anthropic/maps/finish-reason-map.js.map +1 -0
- package/dist/providers/anthropic/maps/media-map.d.ts +25 -0
- package/dist/providers/anthropic/maps/media-map.d.ts.map +1 -0
- package/dist/providers/anthropic/maps/media-map.js +87 -0
- package/dist/providers/anthropic/maps/media-map.js.map +1 -0
- package/dist/providers/anthropic/maps/message-map.d.ts +31 -0
- package/dist/providers/anthropic/maps/message-map.d.ts.map +1 -0
- package/dist/providers/anthropic/maps/message-map.js +121 -0
- package/dist/providers/anthropic/maps/message-map.js.map +1 -0
- package/dist/providers/anthropic/maps/tool-choice-map.d.ts +11 -0
- package/dist/providers/anthropic/maps/tool-choice-map.d.ts.map +1 -0
- package/dist/providers/anthropic/maps/tool-choice-map.js +25 -0
- package/dist/providers/anthropic/maps/tool-choice-map.js.map +1 -0
- package/dist/providers/anthropic/maps/tool-map.d.ts +14 -0
- package/dist/providers/anthropic/maps/tool-map.d.ts.map +1 -0
- package/dist/providers/anthropic/maps/tool-map.js +22 -0
- package/dist/providers/anthropic/maps/tool-map.js.map +1 -0
- package/dist/providers/anthropic/parse-response.d.ts +21 -0
- package/dist/providers/anthropic/parse-response.d.ts.map +1 -0
- package/dist/providers/anthropic/parse-response.js +109 -0
- package/dist/providers/anthropic/parse-response.js.map +1 -0
- package/dist/providers/anthropic/rate-limits.d.ts +4 -0
- package/dist/providers/anthropic/rate-limits.d.ts.map +1 -0
- package/dist/providers/anthropic/rate-limits.js +47 -0
- package/dist/providers/anthropic/rate-limits.js.map +1 -0
- package/dist/providers/anthropic/stream-events.d.ts +27 -0
- package/dist/providers/anthropic/stream-events.d.ts.map +1 -0
- package/dist/providers/anthropic/stream-events.js +147 -0
- package/dist/providers/anthropic/stream-events.js.map +1 -0
- package/dist/providers/mistral/build-request-body.d.ts +32 -0
- package/dist/providers/mistral/build-request-body.d.ts.map +1 -0
- package/dist/providers/mistral/build-request-body.js +69 -0
- package/dist/providers/mistral/build-request-body.js.map +1 -0
- package/dist/providers/mistral/embeddings.d.ts +14 -0
- package/dist/providers/mistral/embeddings.d.ts.map +1 -0
- package/dist/providers/mistral/embeddings.js +41 -0
- package/dist/providers/mistral/embeddings.js.map +1 -0
- package/dist/providers/mistral/fim.d.ts +32 -0
- package/dist/providers/mistral/fim.d.ts.map +1 -0
- package/dist/providers/mistral/fim.js +70 -0
- package/dist/providers/mistral/fim.js.map +1 -0
- package/dist/providers/mistral/maps/finish-reason-map.d.ts +15 -0
- package/dist/providers/mistral/maps/finish-reason-map.d.ts.map +1 -0
- package/dist/providers/mistral/maps/finish-reason-map.js +32 -0
- package/dist/providers/mistral/maps/finish-reason-map.js.map +1 -0
- package/dist/providers/mistral/maps/media-map.d.ts +24 -0
- package/dist/providers/mistral/maps/media-map.d.ts.map +1 -0
- package/dist/providers/mistral/maps/media-map.js +41 -0
- package/dist/providers/mistral/maps/media-map.js.map +1 -0
- package/dist/providers/mistral/maps/message-map.d.ts +20 -0
- package/dist/providers/mistral/maps/message-map.d.ts.map +1 -0
- package/dist/providers/mistral/maps/message-map.js +83 -0
- package/dist/providers/mistral/maps/message-map.js.map +1 -0
- package/dist/providers/mistral/maps/tool-choice-map.d.ts +12 -0
- package/dist/providers/mistral/maps/tool-choice-map.d.ts.map +1 -0
- package/dist/providers/mistral/maps/tool-choice-map.js +25 -0
- package/dist/providers/mistral/maps/tool-choice-map.js.map +1 -0
- package/dist/providers/mistral/maps/tool-map.d.ts +15 -0
- package/dist/providers/mistral/maps/tool-map.d.ts.map +1 -0
- package/dist/providers/mistral/maps/tool-map.js +26 -0
- package/dist/providers/mistral/maps/tool-map.js.map +1 -0
- package/dist/providers/mistral/mistral.d.ts +90 -0
- package/dist/providers/mistral/mistral.d.ts.map +1 -0
- package/dist/providers/mistral/mistral.js +210 -0
- package/dist/providers/mistral/mistral.js.map +1 -0
- package/dist/providers/mistral/parse-response.d.ts +35 -0
- package/dist/providers/mistral/parse-response.d.ts.map +1 -0
- package/dist/providers/mistral/parse-response.js +114 -0
- package/dist/providers/mistral/parse-response.js.map +1 -0
- package/dist/providers/mistral/rate-limits.d.ts +24 -0
- package/dist/providers/mistral/rate-limits.d.ts.map +1 -0
- package/dist/providers/mistral/rate-limits.js +55 -0
- package/dist/providers/mistral/rate-limits.js.map +1 -0
- package/dist/providers/mistral/stream-events.d.ts +29 -0
- package/dist/providers/mistral/stream-events.d.ts.map +1 -0
- package/dist/providers/mistral/stream-events.js +142 -0
- package/dist/providers/mistral/stream-events.js.map +1 -0
- package/dist/providers/openai/audio.d.ts +16 -0
- package/dist/providers/openai/audio.d.ts.map +1 -0
- package/dist/providers/openai/audio.js +105 -0
- package/dist/providers/openai/audio.js.map +1 -0
- package/dist/providers/openai/batch.d.ts +29 -0
- package/dist/providers/openai/batch.d.ts.map +1 -0
- package/dist/providers/openai/batch.js +181 -0
- package/dist/providers/openai/batch.js.map +1 -0
- package/dist/providers/openai/build-request-body.d.ts +25 -0
- package/dist/providers/openai/build-request-body.d.ts.map +1 -0
- package/dist/providers/openai/build-request-body.js +66 -0
- package/dist/providers/openai/build-request-body.js.map +1 -0
- package/dist/providers/openai/build-structured-body.d.ts +16 -0
- package/dist/providers/openai/build-structured-body.d.ts.map +1 -0
- package/dist/providers/openai/build-structured-body.js +47 -0
- package/dist/providers/openai/build-structured-body.js.map +1 -0
- package/dist/providers/openai/embeddings.d.ts +6 -0
- package/dist/providers/openai/embeddings.d.ts.map +1 -0
- package/dist/providers/openai/embeddings.js +61 -0
- package/dist/providers/openai/embeddings.js.map +1 -0
- package/dist/providers/openai/files.d.ts +16 -0
- package/dist/providers/openai/files.d.ts.map +1 -0
- package/dist/providers/openai/files.js +80 -0
- package/dist/providers/openai/files.js.map +1 -0
- package/dist/providers/openai/images.d.ts +6 -0
- package/dist/providers/openai/images.d.ts.map +1 -0
- package/dist/providers/openai/images.js +55 -0
- package/dist/providers/openai/images.js.map +1 -0
- package/dist/providers/openai/maps/finish-reason-map.d.ts +21 -0
- package/dist/providers/openai/maps/finish-reason-map.d.ts.map +1 -0
- package/dist/providers/openai/maps/finish-reason-map.js +56 -0
- package/dist/providers/openai/maps/finish-reason-map.js.map +1 -0
- package/dist/providers/openai/maps/media-map.d.ts +25 -0
- package/dist/providers/openai/maps/media-map.d.ts.map +1 -0
- package/dist/providers/openai/maps/media-map.js +53 -0
- package/dist/providers/openai/maps/media-map.js.map +1 -0
- package/dist/providers/openai/maps/message-map.d.ts +21 -0
- package/dist/providers/openai/maps/message-map.d.ts.map +1 -0
- package/dist/providers/openai/maps/message-map.js +128 -0
- package/dist/providers/openai/maps/message-map.js.map +1 -0
- package/dist/providers/openai/maps/tool-choice-map.d.ts +14 -0
- package/dist/providers/openai/maps/tool-choice-map.d.ts.map +1 -0
- package/dist/providers/openai/maps/tool-choice-map.js +27 -0
- package/dist/providers/openai/maps/tool-choice-map.js.map +1 -0
- package/dist/providers/openai/maps/tool-map.d.ts +16 -0
- package/dist/providers/openai/maps/tool-map.d.ts.map +1 -0
- package/dist/providers/openai/maps/tool-map.js +34 -0
- package/dist/providers/openai/maps/tool-map.js.map +1 -0
- package/dist/providers/openai/moderation.d.ts +6 -0
- package/dist/providers/openai/moderation.d.ts.map +1 -0
- package/dist/providers/openai/moderation.js +26 -0
- package/dist/providers/openai/moderation.js.map +1 -0
- package/dist/providers/openai/openai.d.ts +103 -0
- package/dist/providers/openai/openai.d.ts.map +1 -0
- package/dist/providers/openai/openai.js +385 -0
- package/dist/providers/openai/openai.js.map +1 -0
- package/dist/providers/openai/parse-response.d.ts +21 -0
- package/dist/providers/openai/parse-response.d.ts.map +1 -0
- package/dist/providers/openai/parse-response.js +114 -0
- package/dist/providers/openai/parse-response.js.map +1 -0
- package/dist/providers/openai/rate-limits.d.ts +4 -0
- package/dist/providers/openai/rate-limits.d.ts.map +1 -0
- package/dist/providers/openai/rate-limits.js +47 -0
- package/dist/providers/openai/rate-limits.js.map +1 -0
- package/dist/providers/openai/stream-events.d.ts +13 -0
- package/dist/providers/openai/stream-events.d.ts.map +1 -0
- package/dist/providers/openai/stream-events.js +79 -0
- package/dist/providers/openai/stream-events.js.map +1 -0
- package/dist/providers/openai/structured-mode-resolver.d.ts +3 -0
- package/dist/providers/openai/structured-mode-resolver.d.ts.map +1 -0
- package/dist/providers/openai/structured-mode-resolver.js +41 -0
- package/dist/providers/openai/structured-mode-resolver.js.map +1 -0
- package/dist/providers/provider.d.ts +55 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/provider.js +73 -0
- package/dist/providers/provider.js.map +1 -0
- package/dist/providers/registry.d.ts +10 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +27 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/support/media.d.ts +16 -0
- package/dist/providers/support/media.d.ts.map +1 -0
- package/dist/providers/support/media.js +26 -0
- package/dist/providers/support/media.js.map +1 -0
- package/dist/schema/index.d.ts +114 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +192 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/streaming/events.d.ts +90 -0
- package/dist/streaming/events.d.ts.map +1 -0
- package/dist/streaming/events.js +152 -0
- package/dist/streaming/events.js.map +1 -0
- package/dist/streaming/sse.d.ts +17 -0
- package/dist/streaming/sse.d.ts.map +1 -0
- package/dist/streaming/sse.js +50 -0
- package/dist/streaming/sse.js.map +1 -0
- package/dist/structured/extract.d.ts +23 -0
- package/dist/structured/extract.d.ts.map +1 -0
- package/dist/structured/extract.js +43 -0
- package/dist/structured/extract.js.map +1 -0
- package/dist/structured/from-text.d.ts +16 -0
- package/dist/structured/from-text.d.ts.map +1 -0
- package/dist/structured/from-text.js +27 -0
- package/dist/structured/from-text.js.map +1 -0
- package/dist/structured/pending-request.d.ts +28 -0
- package/dist/structured/pending-request.d.ts.map +1 -0
- package/dist/structured/pending-request.js +48 -0
- package/dist/structured/pending-request.js.map +1 -0
- package/dist/structured/request.d.ts +28 -0
- package/dist/structured/request.d.ts.map +1 -0
- package/dist/structured/request.js +31 -0
- package/dist/structured/request.js.map +1 -0
- package/dist/structured/response.d.ts +44 -0
- package/dist/structured/response.d.ts.map +1 -0
- package/dist/structured/response.js +49 -0
- package/dist/structured/response.js.map +1 -0
- package/dist/text/pending-request.d.ts +77 -0
- package/dist/text/pending-request.d.ts.map +1 -0
- package/dist/text/pending-request.js +189 -0
- package/dist/text/pending-request.js.map +1 -0
- package/dist/text/request.d.ts +62 -0
- package/dist/text/request.d.ts.map +1 -0
- package/dist/text/request.js +117 -0
- package/dist/text/request.js.map +1 -0
- package/dist/text/response-builder.d.ts +16 -0
- package/dist/text/response-builder.d.ts.map +1 -0
- package/dist/text/response-builder.js +52 -0
- package/dist/text/response-builder.js.map +1 -0
- package/dist/text/response.d.ts +36 -0
- package/dist/text/response.d.ts.map +1 -0
- package/dist/text/response.js +40 -0
- package/dist/text/response.js.map +1 -0
- package/dist/text/step.d.ts +41 -0
- package/dist/text/step.d.ts.map +1 -0
- package/dist/text/step.js +46 -0
- package/dist/text/step.js.map +1 -0
- package/dist/tool.d.ts +34 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +86 -0
- package/dist/tool.js.map +1 -0
- package/dist/value-objects/artifact.d.ts +14 -0
- package/dist/value-objects/artifact.d.ts.map +1 -0
- package/dist/value-objects/artifact.js +32 -0
- package/dist/value-objects/artifact.js.map +1 -0
- package/dist/value-objects/embedding.d.ts +24 -0
- package/dist/value-objects/embedding.d.ts.map +1 -0
- package/dist/value-objects/embedding.js +29 -0
- package/dist/value-objects/embedding.js.map +1 -0
- package/dist/value-objects/embeddings-usage.d.ts +16 -0
- package/dist/value-objects/embeddings-usage.d.ts.map +1 -0
- package/dist/value-objects/embeddings-usage.js +19 -0
- package/dist/value-objects/embeddings-usage.js.map +1 -0
- package/dist/value-objects/generated-audio.d.ts +20 -0
- package/dist/value-objects/generated-audio.d.ts.map +1 -0
- package/dist/value-objects/generated-audio.js +23 -0
- package/dist/value-objects/generated-audio.js.map +1 -0
- package/dist/value-objects/generated-image.d.ts +36 -0
- package/dist/value-objects/generated-image.d.ts.map +1 -0
- package/dist/value-objects/generated-image.js +35 -0
- package/dist/value-objects/generated-image.js.map +1 -0
- package/dist/value-objects/index.d.ts +13 -0
- package/dist/value-objects/index.d.ts.map +1 -0
- package/dist/value-objects/index.js +10 -0
- package/dist/value-objects/index.js.map +1 -0
- package/dist/value-objects/media/audio.d.ts +8 -0
- package/dist/value-objects/media/audio.d.ts.map +1 -0
- package/dist/value-objects/media/audio.js +9 -0
- package/dist/value-objects/media/audio.js.map +1 -0
- package/dist/value-objects/media/document.d.ts +44 -0
- package/dist/value-objects/media/document.d.ts.map +1 -0
- package/dist/value-objects/media/document.js +75 -0
- package/dist/value-objects/media/document.js.map +1 -0
- package/dist/value-objects/media/image.d.ts +13 -0
- package/dist/value-objects/media/image.d.ts.map +1 -0
- package/dist/value-objects/media/image.js +14 -0
- package/dist/value-objects/media/image.js.map +1 -0
- package/dist/value-objects/media/media.d.ts +119 -0
- package/dist/value-objects/media/media.d.ts.map +1 -0
- package/dist/value-objects/media/media.js +267 -0
- package/dist/value-objects/media/media.js.map +1 -0
- package/dist/value-objects/media/part.d.ts +25 -0
- package/dist/value-objects/media/part.d.ts.map +1 -0
- package/dist/value-objects/media/part.js +41 -0
- package/dist/value-objects/media/part.js.map +1 -0
- package/dist/value-objects/media/text.d.ts +24 -0
- package/dist/value-objects/media/text.d.ts.map +1 -0
- package/dist/value-objects/media/text.js +33 -0
- package/dist/value-objects/media/text.js.map +1 -0
- package/dist/value-objects/media/video.d.ts +7 -0
- package/dist/value-objects/media/video.d.ts.map +1 -0
- package/dist/value-objects/media/video.js +8 -0
- package/dist/value-objects/media/video.js.map +1 -0
- package/dist/value-objects/messages/assistant-message.d.ts +26 -0
- package/dist/value-objects/messages/assistant-message.d.ts.map +1 -0
- package/dist/value-objects/messages/assistant-message.js +37 -0
- package/dist/value-objects/messages/assistant-message.js.map +1 -0
- package/dist/value-objects/messages/index.d.ts +27 -0
- package/dist/value-objects/messages/index.d.ts.map +1 -0
- package/dist/value-objects/messages/index.js +32 -0
- package/dist/value-objects/messages/index.js.map +1 -0
- package/dist/value-objects/messages/system-message.d.ts +9 -0
- package/dist/value-objects/messages/system-message.d.ts.map +1 -0
- package/dist/value-objects/messages/system-message.js +17 -0
- package/dist/value-objects/messages/system-message.js.map +1 -0
- package/dist/value-objects/messages/tool-result-message.d.ts +14 -0
- package/dist/value-objects/messages/tool-result-message.d.ts.map +1 -0
- package/dist/value-objects/messages/tool-result-message.js +26 -0
- package/dist/value-objects/messages/tool-result-message.js.map +1 -0
- package/dist/value-objects/messages/user-message.d.ts +47 -0
- package/dist/value-objects/messages/user-message.d.ts.map +1 -0
- package/dist/value-objects/messages/user-message.js +87 -0
- package/dist/value-objects/messages/user-message.js.map +1 -0
- package/dist/value-objects/meta.d.ts +12 -0
- package/dist/value-objects/meta.d.ts.map +1 -0
- package/dist/value-objects/meta.js +28 -0
- package/dist/value-objects/meta.js.map +1 -0
- package/dist/value-objects/moderation-result.d.ts +20 -0
- package/dist/value-objects/moderation-result.d.ts.map +1 -0
- package/dist/value-objects/moderation-result.js +64 -0
- package/dist/value-objects/moderation-result.js.map +1 -0
- package/dist/value-objects/provider-rate-limit.d.ts +11 -0
- package/dist/value-objects/provider-rate-limit.d.ts.map +1 -0
- package/dist/value-objects/provider-rate-limit.js +34 -0
- package/dist/value-objects/provider-rate-limit.js.map +1 -0
- package/dist/value-objects/provider-tool.d.ts +19 -0
- package/dist/value-objects/provider-tool.d.ts.map +1 -0
- package/dist/value-objects/provider-tool.js +31 -0
- package/dist/value-objects/provider-tool.js.map +1 -0
- package/dist/value-objects/tool-call.d.ts +29 -0
- package/dist/value-objects/tool-call.d.ts.map +1 -0
- package/dist/value-objects/tool-call.js +112 -0
- package/dist/value-objects/tool-call.js.map +1 -0
- package/dist/value-objects/tool-result.d.ts +25 -0
- package/dist/value-objects/tool-result.d.ts.map +1 -0
- package/dist/value-objects/tool-result.js +45 -0
- package/dist/value-objects/tool-result.js.map +1 -0
- package/dist/value-objects/usage.d.ts +13 -0
- package/dist/value-objects/usage.d.ts.map +1 -0
- package/dist/value-objects/usage.js +31 -0
- package/dist/value-objects/usage.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 TJ MIller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# @particle-academy/prism
|
|
2
|
+
|
|
3
|
+
A TypeScript port of [Prism](https://github.com/Particle-Academy/prism), the
|
|
4
|
+
PHP/Laravel unified API layer over LLM providers.
|
|
5
|
+
|
|
6
|
+
Real TypeScript: promises, discriminated unions, strict null checking. What it
|
|
7
|
+
is *not* is a transliteration — the idioms are this language's. What crosses the
|
|
8
|
+
wire, and what comes back, is identical.
|
|
9
|
+
|
|
10
|
+
> **Working on this package?** Read **[`AGENTS.md`](AGENTS.md)** first — the boundary
|
|
11
|
+
> this package has to hold, the gates that must be green, and the traps that have
|
|
12
|
+
> already caught someone.
|
|
13
|
+
> `@link AGENTS.md`
|
|
14
|
+
|
|
15
|
+
## Scope
|
|
16
|
+
|
|
17
|
+
**Every capability the reference has**, and three of its eighteen providers.
|
|
18
|
+
That is the shape of the remaining drift: one axis, not two.
|
|
19
|
+
|
|
20
|
+
- **Capabilities — all of them.** `text`, `structured`, `stream`, `embeddings`,
|
|
21
|
+
`images`, `moderation`, `audio` (`textToSpeech` and `speechToText`), `files`,
|
|
22
|
+
`batch`, `fim`. A user message carries images and documents, and each provider
|
|
23
|
+
spells them its own way.
|
|
24
|
+
- **Providers — `anthropic`, `mistral`, `openai`.** The OpenAI provider speaks
|
|
25
|
+
the **Responses API**; Mistral brings the chat-completions shape, which is a
|
|
26
|
+
different wire format rather than a variant of it.
|
|
27
|
+
|
|
28
|
+
Not included, and not stubbed: **the tool-execution loop** — a response that
|
|
29
|
+
finishes on tool calls is refused with `tool_loop_not_supported` rather than
|
|
30
|
+
half-executed — and the fifteen providers the reference has and this port does
|
|
31
|
+
not. Asking for one fails with the `unsupported_provider_action` code rather
|
|
32
|
+
than returning something plausible.
|
|
33
|
+
|
|
34
|
+
Not every capability reaches every provider, because not every provider has one.
|
|
35
|
+
`images`, `moderation`, `textToSpeech`, `files` and `batch` are OpenAI-only
|
|
36
|
+
here, and `fim` is Mistral-only because Mistral is the only provider that
|
|
37
|
+
implements it at all — in the reference as well. See the envelope's port gaps
|
|
38
|
+
register for which of those are work someone could do and which are facts about
|
|
39
|
+
the provider.
|
|
40
|
+
|
|
41
|
+
Every value object serialises **and rebuilds** — `toObject()` and a static
|
|
42
|
+
`fromObject()`. The PHP package has only the first half, which left each consumer
|
|
43
|
+
to invent the second; one of those inventions shipped a defect that corrupted
|
|
44
|
+
stored assistant messages. Both halves ship here, and the rebuild direction is
|
|
45
|
+
pinned by fixtures.
|
|
46
|
+
|
|
47
|
+
Failures carry a stable `code` (`PrismError.code`). The prose is not part of the
|
|
48
|
+
contract and will change; the code will not.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npm install @particle-academy/prism
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Node 20 or newer.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { Prism } from '@particle-academy/prism';
|
|
62
|
+
|
|
63
|
+
const response = await Prism.text()
|
|
64
|
+
.using('openai', 'gpt-4o')
|
|
65
|
+
.withSystemPrompt('You are terse.')
|
|
66
|
+
.withPrompt('Who are you?')
|
|
67
|
+
.asText();
|
|
68
|
+
|
|
69
|
+
console.log(response.text);
|
|
70
|
+
console.log(response.usage.promptTokens, response.usage.completionTokens);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Configuration is explicit first, environment second — `OPENAI_API_KEY`,
|
|
74
|
+
`OPENAI_URL`, `OPENAI_ORGANIZATION`, `OPENAI_PROJECT`:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
Prism.text().using('openai', 'gpt-4o', { apiKey: 'sk-…', transport });
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`transport` is the seam between the provider and the network. Pass one and no
|
|
81
|
+
test ever touches a socket:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import type { HttpTransport } from '@particle-academy/prism';
|
|
85
|
+
|
|
86
|
+
const transport: HttpTransport = async (request) => ({
|
|
87
|
+
status: 200,
|
|
88
|
+
headers: {},
|
|
89
|
+
body: recordedPayload,
|
|
90
|
+
rawBody: JSON.stringify(recordedPayload),
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Build a request without sending it, or parse a stored payload without HTTP:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { buildRequestBody, canonicalJson, parseTextResponse } from '@particle-academy/prism';
|
|
98
|
+
|
|
99
|
+
const request = Prism.text().using('openai', 'gpt-4o').withPrompt('hi').toRequest();
|
|
100
|
+
|
|
101
|
+
canonicalJson(buildRequestBody(request)); // exactly the bytes that would be POSTed
|
|
102
|
+
parseTextResponse(request, recordedPayload); // the same parse a live call performs
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Parity
|
|
106
|
+
|
|
107
|
+
This port's behaviour is not defined by its own tests. It is pinned by
|
|
108
|
+
[**prism-parity**](https://github.com/Particle-Academy/prism-parity) — a
|
|
109
|
+
language-independent conformance corpus generated by executing the PHP
|
|
110
|
+
reference, which states the rules once so three implementations cannot each
|
|
111
|
+
drift into their own reading of them.
|
|
112
|
+
|
|
113
|
+
The corpus and its loader install as `@particle-academy/prism-conformance`. The
|
|
114
|
+
runner lives in [`conformance/runner.mjs`](conformance/runner.mjs) and implements
|
|
115
|
+
prism-parity's subprocess contract, so `scripts/cross-check.mjs` can run this
|
|
116
|
+
port and the others side by side and require **identical verdicts** — a stronger
|
|
117
|
+
claim than three suites that each went green alone.
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
git clone https://github.com/Particle-Academy/prism-parity .parity
|
|
121
|
+
npm install ./.parity/loaders/ts
|
|
122
|
+
npm run conformance # every suite
|
|
123
|
+
node conformance/runner.mjs --suite openai-text-request
|
|
124
|
+
node conformance/runner.mjs --probe omit-null-keys
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Two rows diverge from the reference on purpose, and the corpus says which and
|
|
128
|
+
why: `trq-0021` and `trq-0022`, where the reference drops a prompt of `""` or
|
|
129
|
+
`"0"` and this port sends it. Read the corpus for the rest — restating its rules
|
|
130
|
+
here would only give them somewhere to drift.
|
|
131
|
+
|
|
132
|
+
### Probes
|
|
133
|
+
|
|
134
|
+
`--probe` runs the port with one deliberate defect injected, from the corpus's
|
|
135
|
+
`probes/probes.json`. Each probe declares the exact set of case ids it must fail,
|
|
136
|
+
and [`tests/probes.test.ts`](tests/probes.test.ts) asserts the observed set
|
|
137
|
+
*equals* it — not that it is non-empty. A table every plausible implementation
|
|
138
|
+
passes measures nothing.
|
|
139
|
+
|
|
140
|
+
The mutants live in [`conformance/mutations.mjs`](conformance/mutations.mjs),
|
|
141
|
+
outside `src/`: a defect you can switch on in production is a defect.
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
npm run build # tsc → dist/
|
|
147
|
+
npm run typecheck
|
|
148
|
+
npm run lint
|
|
149
|
+
npm test
|
|
150
|
+
npm run conformance
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { JsonObject } from '../json.js';
|
|
2
|
+
import type { Provider } from '../providers/provider.js';
|
|
3
|
+
import { Audio } from '../value-objects/media/audio.js';
|
|
4
|
+
import { SpeechToTextRequest, TextToSpeechRequest } from './request.js';
|
|
5
|
+
import type { AudioResponse, AudioTextResponse } from './response.js';
|
|
6
|
+
/**
|
|
7
|
+
* The builder for both audio directions.
|
|
8
|
+
*
|
|
9
|
+
* ONE builder with two terminals, matching the reference: `withInput()` takes
|
|
10
|
+
* either a string to speak or an `Audio` to transcribe, and the terminal method
|
|
11
|
+
* decides which request is built. The alternative — two builders — would force
|
|
12
|
+
* a caller to know the direction before they have the input, which is backwards
|
|
13
|
+
* from how audio work actually arrives.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AudioPendingRequest {
|
|
16
|
+
#private;
|
|
17
|
+
using(provider: string, model?: string, providerConfig?: Record<string, unknown>): this;
|
|
18
|
+
/** A string to speak, or an `Audio` to transcribe. */
|
|
19
|
+
withInput(input: string | Audio): this;
|
|
20
|
+
withVoice(voice: string): this;
|
|
21
|
+
withProviderOptions(options?: Readonly<JsonObject>): this;
|
|
22
|
+
withClientOptions(options: Record<string, unknown>): this;
|
|
23
|
+
provider(): Provider;
|
|
24
|
+
/**
|
|
25
|
+
* @throws PrismError code `wrong_audio_input` when the input is an `Audio`.
|
|
26
|
+
*
|
|
27
|
+
* Refused rather than coerced. There is no sensible reading of "speak this
|
|
28
|
+
* recording", and the alternative — stringifying it — would send a provider
|
|
29
|
+
* something like `[object Object]` to read aloud.
|
|
30
|
+
*/
|
|
31
|
+
toTextToSpeechRequest(): TextToSpeechRequest;
|
|
32
|
+
/** @throws PrismError code `wrong_audio_input` when the input is a string. */
|
|
33
|
+
toSpeechToTextRequest(): SpeechToTextRequest;
|
|
34
|
+
asAudio(): Promise<AudioResponse>;
|
|
35
|
+
asText(): Promise<AudioTextResponse>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=pending-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-request.d.ts","sourceRoot":"","sources":["../../src/audio/pending-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE;;;;;;;;GAQG;AACH,qBAAa,mBAAmB;;IAe9B,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,IAAI;IAQvF,sDAAsD;IACtD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;IAMtC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,mBAAmB,CAAC,OAAO,GAAE,QAAQ,CAAC,UAAU,CAAM,GAAG,IAAI;IAM7D,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMzD,QAAQ,IAAI,QAAQ;IAWpB;;;;;;OAMG;IACH,qBAAqB,IAAI,mBAAmB;IAe5C,8EAA8E;IAC9E,qBAAqB,IAAI,mBAAmB;IActC,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IAIjC,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAG3C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { PrismError } from '../errors.js';
|
|
2
|
+
import { resolveProvider } from '../providers/registry.js';
|
|
3
|
+
import { Audio } from '../value-objects/media/audio.js';
|
|
4
|
+
import { SpeechToTextRequest, TextToSpeechRequest } from './request.js';
|
|
5
|
+
/**
|
|
6
|
+
* The builder for both audio directions.
|
|
7
|
+
*
|
|
8
|
+
* ONE builder with two terminals, matching the reference: `withInput()` takes
|
|
9
|
+
* either a string to speak or an `Audio` to transcribe, and the terminal method
|
|
10
|
+
* decides which request is built. The alternative — two builders — would force
|
|
11
|
+
* a caller to know the direction before they have the input, which is backwards
|
|
12
|
+
* from how audio work actually arrives.
|
|
13
|
+
*/
|
|
14
|
+
export class AudioPendingRequest {
|
|
15
|
+
#provider = null;
|
|
16
|
+
#providerKey = '';
|
|
17
|
+
#model = '';
|
|
18
|
+
#input = null;
|
|
19
|
+
#voice = null;
|
|
20
|
+
#providerOptions = {};
|
|
21
|
+
#clientOptions = {};
|
|
22
|
+
using(provider, model = '', providerConfig = {}) {
|
|
23
|
+
this.#providerKey = provider;
|
|
24
|
+
this.#model = model;
|
|
25
|
+
this.#provider = resolveProvider(provider, providerConfig);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/** A string to speak, or an `Audio` to transcribe. */
|
|
29
|
+
withInput(input) {
|
|
30
|
+
this.#input = input;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
withVoice(voice) {
|
|
34
|
+
this.#voice = voice;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
withProviderOptions(options = {}) {
|
|
38
|
+
this.#providerOptions = { ...options };
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
withClientOptions(options) {
|
|
42
|
+
this.#clientOptions = { ...options };
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
provider() {
|
|
46
|
+
if (this.#provider === null) {
|
|
47
|
+
throw PrismError.unsupportedProviderAction('Sending a request', 'a pending request with no provider — call using() first');
|
|
48
|
+
}
|
|
49
|
+
return this.#provider;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @throws PrismError code `wrong_audio_input` when the input is an `Audio`.
|
|
53
|
+
*
|
|
54
|
+
* Refused rather than coerced. There is no sensible reading of "speak this
|
|
55
|
+
* recording", and the alternative — stringifying it — would send a provider
|
|
56
|
+
* something like `[object Object]` to read aloud.
|
|
57
|
+
*/
|
|
58
|
+
toTextToSpeechRequest() {
|
|
59
|
+
if (typeof this.#input !== 'string') {
|
|
60
|
+
throw PrismError.wrongAudioInput('text to speak', 'an audio payload');
|
|
61
|
+
}
|
|
62
|
+
return new TextToSpeechRequest({
|
|
63
|
+
model: this.#model,
|
|
64
|
+
providerKey: this.#providerKey,
|
|
65
|
+
input: this.#input,
|
|
66
|
+
voice: this.#voice,
|
|
67
|
+
clientOptions: this.#clientOptions,
|
|
68
|
+
providerOptions: this.#providerOptions,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/** @throws PrismError code `wrong_audio_input` when the input is a string. */
|
|
72
|
+
toSpeechToTextRequest() {
|
|
73
|
+
if (!(this.#input instanceof Audio)) {
|
|
74
|
+
throw PrismError.wrongAudioInput('an audio payload', 'text');
|
|
75
|
+
}
|
|
76
|
+
return new SpeechToTextRequest({
|
|
77
|
+
model: this.#model,
|
|
78
|
+
providerKey: this.#providerKey,
|
|
79
|
+
input: this.#input,
|
|
80
|
+
clientOptions: this.#clientOptions,
|
|
81
|
+
providerOptions: this.#providerOptions,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
async asAudio() {
|
|
85
|
+
return this.provider().textToSpeech(this.toTextToSpeechRequest());
|
|
86
|
+
}
|
|
87
|
+
async asText() {
|
|
88
|
+
return this.provider().speechToText(this.toSpeechToTextRequest());
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=pending-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-request.js","sourceRoot":"","sources":["../../src/audio/pending-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxE;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IAC9B,SAAS,GAAoB,IAAI,CAAC;IAElC,YAAY,GAAG,EAAE,CAAC;IAElB,MAAM,GAAG,EAAE,CAAC;IAEZ,MAAM,GAA0B,IAAI,CAAC;IAErC,MAAM,GAAkB,IAAI,CAAC;IAE7B,gBAAgB,GAAe,EAAE,CAAC;IAElC,cAAc,GAA4B,EAAE,CAAC;IAE7C,KAAK,CAAC,QAAgB,EAAE,KAAK,GAAG,EAAE,EAAE,iBAA0C,EAAE;QAC9E,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sDAAsD;IACtD,SAAS,CAAC,KAAqB;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mBAAmB,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AE,IAAI,CAAC,cAAc;YAClC,eAAe,EAAE,IAAI,CAAC,gBAAgB;SACvC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue } from '../json.js';
|
|
2
|
+
import type { Audio } from '../value-objects/media/audio.js';
|
|
3
|
+
interface BaseOptions {
|
|
4
|
+
model: string;
|
|
5
|
+
providerKey: string;
|
|
6
|
+
clientOptions?: Readonly<Record<string, unknown>>;
|
|
7
|
+
providerOptions?: Readonly<JsonObject>;
|
|
8
|
+
}
|
|
9
|
+
declare abstract class AudioRequestBase {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(options: BaseOptions);
|
|
12
|
+
model(): string;
|
|
13
|
+
providerKey(): string;
|
|
14
|
+
clientOptions(): Readonly<Record<string, unknown>>;
|
|
15
|
+
providerOptions(): JsonObject;
|
|
16
|
+
providerOptions(path: string): JsonValue | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface TextToSpeechRequestOptions extends BaseOptions {
|
|
19
|
+
input: string;
|
|
20
|
+
voice: string | null;
|
|
21
|
+
}
|
|
22
|
+
export declare class TextToSpeechRequest extends AudioRequestBase {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(options: TextToSpeechRequestOptions);
|
|
25
|
+
input(): string;
|
|
26
|
+
voice(): string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface SpeechToTextRequestOptions extends BaseOptions {
|
|
29
|
+
input: Audio;
|
|
30
|
+
}
|
|
31
|
+
export declare class SpeechToTextRequest extends AudioRequestBase {
|
|
32
|
+
#private;
|
|
33
|
+
constructor(options: SpeechToTextRequestOptions);
|
|
34
|
+
input(): Audio;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAE7D,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClD,eAAe,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;CACxC;AAED,uBAAe,gBAAgB;;gBASjB,OAAO,EAAE,WAAW;IAOhC,KAAK,IAAI,MAAM;IAIf,WAAW,IAAI,MAAM;IAIrB,aAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAIlD,eAAe,IAAI,UAAU;IAC7B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;CAIrD;AAED,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,qBAAa,mBAAoB,SAAQ,gBAAgB;;gBAK3C,OAAO,EAAE,0BAA0B;IAM/C,KAAK,IAAI,MAAM;IAIf,KAAK,IAAI,MAAM,GAAG,IAAI;CAGvB;AAED,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,KAAK,EAAE,KAAK,CAAC;CACd;AAED,qBAAa,mBAAoB,SAAQ,gBAAgB;;gBAG3C,OAAO,EAAE,0BAA0B;IAK/C,KAAK,IAAI,KAAK;CAGf"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
class AudioRequestBase {
|
|
2
|
+
#model;
|
|
3
|
+
#providerKey;
|
|
4
|
+
#clientOptions;
|
|
5
|
+
#providerOptions;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.#model = options.model;
|
|
8
|
+
this.#providerKey = options.providerKey;
|
|
9
|
+
this.#clientOptions = options.clientOptions ?? {};
|
|
10
|
+
this.#providerOptions = { ...(options.providerOptions ?? {}) };
|
|
11
|
+
}
|
|
12
|
+
model() {
|
|
13
|
+
return this.#model;
|
|
14
|
+
}
|
|
15
|
+
providerKey() {
|
|
16
|
+
return this.#providerKey;
|
|
17
|
+
}
|
|
18
|
+
clientOptions() {
|
|
19
|
+
return this.#clientOptions;
|
|
20
|
+
}
|
|
21
|
+
providerOptions(path) {
|
|
22
|
+
return path === undefined ? this.#providerOptions : this.#providerOptions[path];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class TextToSpeechRequest extends AudioRequestBase {
|
|
26
|
+
#input;
|
|
27
|
+
#voice;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
super(options);
|
|
30
|
+
this.#input = options.input;
|
|
31
|
+
this.#voice = options.voice;
|
|
32
|
+
}
|
|
33
|
+
input() {
|
|
34
|
+
return this.#input;
|
|
35
|
+
}
|
|
36
|
+
voice() {
|
|
37
|
+
return this.#voice;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class SpeechToTextRequest extends AudioRequestBase {
|
|
41
|
+
#input;
|
|
42
|
+
constructor(options) {
|
|
43
|
+
super(options);
|
|
44
|
+
this.#input = options.input;
|
|
45
|
+
}
|
|
46
|
+
input() {
|
|
47
|
+
return this.#input;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src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,OAAmC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JsonObject } from '../json.js';
|
|
2
|
+
import type { GeneratedAudio } from '../value-objects/generated-audio.js';
|
|
3
|
+
import type { Usage } from '../value-objects/usage.js';
|
|
4
|
+
/** What `asAudio()` returns: speech, and whatever else the provider said. */
|
|
5
|
+
export declare class AudioResponse {
|
|
6
|
+
readonly audio: GeneratedAudio;
|
|
7
|
+
readonly additionalContent: Readonly<JsonObject>;
|
|
8
|
+
constructor(audio: GeneratedAudio, additionalContent?: Readonly<JsonObject>);
|
|
9
|
+
toObject(): JsonObject;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* What `asText()` returns: a transcript.
|
|
13
|
+
*
|
|
14
|
+
* `usage` is NULLABLE because transcription is billed by audio duration on most
|
|
15
|
+
* providers and they report no tokens at all. Zero would claim it was free.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AudioTextResponse {
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly usage: Usage | null;
|
|
20
|
+
readonly additionalContent: Readonly<JsonObject>;
|
|
21
|
+
constructor(text: string, usage?: Usage | null, additionalContent?: Readonly<JsonObject>);
|
|
22
|
+
toObject(): JsonObject;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/audio/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,6EAA6E;AAC7E,qBAAa,aAAa;IAEtB,QAAQ,CAAC,KAAK,EAAE,cAAc;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC;gBADvC,KAAK,EAAE,cAAc,EACrB,iBAAiB,GAAE,QAAQ,CAAC,UAAU,CAAM;IAGvD,QAAQ,IAAI,UAAU;CAGvB;AAED;;;;;GAKG;AACH,qBAAa,iBAAiB;IAE1B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC;gBAFvC,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,KAAK,GAAG,IAAW,EAC1B,iBAAiB,GAAE,QAAQ,CAAC,UAAU,CAAM;IAGvD,QAAQ,IAAI,UAAU;CAOvB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** What `asAudio()` returns: speech, and whatever else the provider said. */
|
|
2
|
+
export class AudioResponse {
|
|
3
|
+
audio;
|
|
4
|
+
additionalContent;
|
|
5
|
+
constructor(audio, additionalContent = {}) {
|
|
6
|
+
this.audio = audio;
|
|
7
|
+
this.additionalContent = additionalContent;
|
|
8
|
+
}
|
|
9
|
+
toObject() {
|
|
10
|
+
return { audio: this.audio.toObject(), additional_content: { ...this.additionalContent } };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* What `asText()` returns: a transcript.
|
|
15
|
+
*
|
|
16
|
+
* `usage` is NULLABLE because transcription is billed by audio duration on most
|
|
17
|
+
* providers and they report no tokens at all. Zero would claim it was free.
|
|
18
|
+
*/
|
|
19
|
+
export class AudioTextResponse {
|
|
20
|
+
text;
|
|
21
|
+
usage;
|
|
22
|
+
additionalContent;
|
|
23
|
+
constructor(text, usage = null, additionalContent = {}) {
|
|
24
|
+
this.text = text;
|
|
25
|
+
this.usage = usage;
|
|
26
|
+
this.additionalContent = additionalContent;
|
|
27
|
+
}
|
|
28
|
+
toObject() {
|
|
29
|
+
return {
|
|
30
|
+
text: this.text,
|
|
31
|
+
usage: this.usage === null ? null : this.usage.toObject(),
|
|
32
|
+
additional_content: { ...this.additionalContent },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/audio/response.ts"],"names":[],"mappings":"AAIA,6EAA6E;AAC7E,MAAM,OAAO,aAAa;IAEb;IACA;IAFX,YACW,KAAqB,EACrB,oBAA0C,EAAE;QAD5C,UAAK,GAAL,KAAK,CAAgB;QACrB,sBAAiB,GAAjB,iBAAiB,CAA2B;IACpD,CAAC;IAEJ,QAAQ;QACN,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,kBAAkB,EAAE,EAAE,GAAG,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC7F,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IAEjB;IACA;IACA;IAHX,YACW,IAAY,EACZ,QAAsB,IAAI,EAC1B,oBAA0C,EAAE;QAF5C,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAqB;QAC1B,sBAAiB,GAAjB,iBAAiB,CAA2B;IACpD,CAAC;IAEJ,QAAQ;QACN,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACzD,kBAAkB,EAAE,EAAE,GAAG,IAAI,CAAC,iBAAiB,EAAE;SAClD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { JsonObject } from '../json.js';
|
|
2
|
+
import type { Usage } from '../value-objects/usage.js';
|
|
3
|
+
/** Where a batch is in its lifecycle, as the provider names it. */
|
|
4
|
+
export declare enum BatchStatus {
|
|
5
|
+
Validating = "validating",
|
|
6
|
+
InProgress = "in_progress",
|
|
7
|
+
Finalizing = "finalizing",
|
|
8
|
+
Completed = "completed",
|
|
9
|
+
Failed = "failed",
|
|
10
|
+
Cancelling = "cancelling",
|
|
11
|
+
Cancelled = "cancelled",
|
|
12
|
+
Expired = "expired"
|
|
13
|
+
}
|
|
14
|
+
/** How one item inside a batch turned out. */
|
|
15
|
+
export declare enum BatchResultStatus {
|
|
16
|
+
Succeeded = "succeeded",
|
|
17
|
+
Errored = "errored",
|
|
18
|
+
Canceled = "canceled",
|
|
19
|
+
Expired = "expired"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* How many requests are in each state.
|
|
23
|
+
*
|
|
24
|
+
* FIVE counts and a total, matching the reference — but OpenAI reports only
|
|
25
|
+
* three (`total`, `completed`, `failed`), so `canceled` and `expired` stay zero
|
|
26
|
+
* on that provider. They are not dropped, because a batch that was cancelled
|
|
27
|
+
* mid-flight is a real thing another provider does report.
|
|
28
|
+
*/
|
|
29
|
+
export declare class BatchJobRequestCounts {
|
|
30
|
+
readonly processing: number;
|
|
31
|
+
readonly succeeded: number;
|
|
32
|
+
readonly failed: number;
|
|
33
|
+
readonly canceled: number;
|
|
34
|
+
readonly expired: number;
|
|
35
|
+
readonly total: number;
|
|
36
|
+
constructor(processing?: number, succeeded?: number, failed?: number, canceled?: number, expired?: number, total?: number);
|
|
37
|
+
toObject(): JsonObject;
|
|
38
|
+
}
|
|
39
|
+
export interface BatchJobError {
|
|
40
|
+
code: string;
|
|
41
|
+
message: string;
|
|
42
|
+
line: number | null;
|
|
43
|
+
param: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** A submitted batch: what it is, where it is, and what came of it. */
|
|
46
|
+
export declare class BatchJob {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly status: BatchStatus;
|
|
49
|
+
readonly requestCounts: BatchJobRequestCounts;
|
|
50
|
+
/** ISO 8601, in UTC — see `parseBatchJob`. */
|
|
51
|
+
readonly createdAt: string | null;
|
|
52
|
+
readonly expiresAt: string | null;
|
|
53
|
+
readonly endedAt: string | null;
|
|
54
|
+
readonly resultsUrl: string | null;
|
|
55
|
+
readonly inputFileId: string | null;
|
|
56
|
+
readonly outputFileId: string | null;
|
|
57
|
+
readonly errorFileId: string | null;
|
|
58
|
+
readonly errors: readonly BatchJobError[];
|
|
59
|
+
constructor(id: string, status: BatchStatus, requestCounts: BatchJobRequestCounts,
|
|
60
|
+
/** ISO 8601, in UTC — see `parseBatchJob`. */
|
|
61
|
+
createdAt?: string | null, expiresAt?: string | null, endedAt?: string | null, resultsUrl?: string | null, inputFileId?: string | null, outputFileId?: string | null, errorFileId?: string | null, errors?: readonly BatchJobError[]);
|
|
62
|
+
toObject(): JsonObject;
|
|
63
|
+
}
|
|
64
|
+
/** One page of batches. */
|
|
65
|
+
export declare class BatchListResult {
|
|
66
|
+
readonly data: readonly BatchJob[];
|
|
67
|
+
readonly hasMore: boolean;
|
|
68
|
+
readonly lastId: string | null;
|
|
69
|
+
constructor(data: readonly BatchJob[], hasMore?: boolean, lastId?: string | null);
|
|
70
|
+
toObject(): JsonObject;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What one request in a batch produced.
|
|
74
|
+
*
|
|
75
|
+
* `text` and `usage` are null on a failure and `errorType`/`errorMessage` are
|
|
76
|
+
* null on a success — the four fields are read together with `status`, which is
|
|
77
|
+
* the field that says which pair means anything.
|
|
78
|
+
*/
|
|
79
|
+
export declare class BatchResultItem {
|
|
80
|
+
readonly customId: string;
|
|
81
|
+
readonly status: BatchResultStatus;
|
|
82
|
+
readonly text: string | null;
|
|
83
|
+
readonly usage: Usage | null;
|
|
84
|
+
readonly messageId: string | null;
|
|
85
|
+
readonly model: string | null;
|
|
86
|
+
readonly errorType: string | null;
|
|
87
|
+
readonly errorMessage: string | null;
|
|
88
|
+
constructor(customId: string, status: BatchResultStatus, text?: string | null, usage?: Usage | null, messageId?: string | null, model?: string | null, errorType?: string | null, errorMessage?: string | null);
|
|
89
|
+
toObject(): JsonObject;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=batch-job.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-job.d.ts","sourceRoot":"","sources":["../../src/batch/batch-job.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,mEAAmE;AACnE,oBAAY,WAAW;IACrB,UAAU,eAAe;IACzB,UAAU,gBAAgB;IAC1B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED,8CAA8C;AAC9C,oBAAY,iBAAiB;IAC3B,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAE9B,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,SAAS;IAClB,QAAQ,CAAC,MAAM;IACf,QAAQ,CAAC,QAAQ;IACjB,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,KAAK;gBALL,UAAU,SAAI,EACd,SAAS,SAAI,EACb,MAAM,SAAI,EACV,QAAQ,SAAI,EACZ,OAAO,SAAI,EACX,KAAK,SAAI;IAGpB,QAAQ,IAAI,UAAU;CAUvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,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