tekimax-ts 0.1.6 → 1.0.0-beta.1
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 +160 -97
- package/dist/adapter-BtbeHotF.d.cts +81 -0
- package/dist/adapter-BtbeHotF.d.ts +81 -0
- package/dist/adapter-CMu9Gvvm.d.cts +81 -0
- package/dist/adapter-CMu9Gvvm.d.ts +81 -0
- package/dist/adapter-DeUJcFAn.d.cts +43 -0
- package/dist/adapter-DeUJcFAn.d.ts +43 -0
- package/dist/adapter-K9NFtBg8.d.cts +81 -0
- package/dist/adapter-K9NFtBg8.d.ts +81 -0
- package/dist/adapter-TuDzMu0Y.d.cts +43 -0
- package/dist/adapter-TuDzMu0Y.d.ts +43 -0
- package/dist/adapter-YcdKK3By.d.cts +63 -0
- package/dist/adapter-YcdKK3By.d.ts +63 -0
- package/dist/adapter-zXqUGXCx.d.cts +81 -0
- package/dist/adapter-zXqUGXCx.d.ts +81 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/gen/index.js +1572 -378
- package/dist/gen/types.js +290 -201
- package/dist/gen/zod/allowedToolChoiceSchema.js +17 -13
- package/dist/gen/zod/allowedToolsParamSchema.js +28 -13
- package/dist/gen/zod/annotationSchema.js +16 -11
- package/dist/gen/zod/assistantMessageItemParamSchema.js +52 -19
- package/dist/gen/zod/createResponseBodySchema.js +142 -44
- package/dist/gen/zod/createresponseSchema.js +23 -12
- package/dist/gen/zod/detailEnumSchema.js +8 -8
- package/dist/gen/zod/developerMessageItemParamSchema.js +35 -16
- package/dist/gen/zod/emptyModelParamSchema.js +8 -8
- package/dist/gen/zod/errorPayloadSchema.js +27 -14
- package/dist/gen/zod/errorSchema.js +17 -11
- package/dist/gen/zod/errorStreamingEventSchema.js +23 -13
- package/dist/gen/zod/functionCallItemParamSchema.js +38 -15
- package/dist/gen/zod/functionCallItemStatusSchema.js +12 -8
- package/dist/gen/zod/functionCallOutputItemParamSchema.js +90 -27
- package/dist/gen/zod/functionCallOutputSchema.js +67 -24
- package/dist/gen/zod/functionCallOutputStatusEnumSchema.js +12 -8
- package/dist/gen/zod/functionCallSchema.js +29 -16
- package/dist/gen/zod/functionCallStatusSchema.js +12 -8
- package/dist/gen/zod/functionToolChoiceSchema.js +10 -10
- package/dist/gen/zod/functionToolParamSchema.js +25 -14
- package/dist/gen/zod/functionToolSchema.js +24 -14
- package/dist/gen/zod/imageDetailSchema.js +8 -8
- package/dist/gen/zod/includeEnumSchema.js +11 -8
- package/dist/gen/zod/incompleteDetailsSchema.js +14 -10
- package/dist/gen/zod/index.js +871 -213
- package/dist/gen/zod/inputFileContentParamSchema.js +24 -13
- package/dist/gen/zod/inputFileContentSchema.js +23 -12
- package/dist/gen/zod/inputImageContentParamAutoParamSchema.js +29 -13
- package/dist/gen/zod/inputImageContentSchema.js +22 -13
- package/dist/gen/zod/inputTextContentParamSchema.js +19 -11
- package/dist/gen/zod/inputTextContentSchema.js +16 -11
- package/dist/gen/zod/inputTokensDetailsSchema.js +15 -10
- package/dist/gen/zod/inputVideoContentSchema.js +17 -11
- package/dist/gen/zod/itemFieldSchema.js +45 -20
- package/dist/gen/zod/itemParamSchema.js +55 -23
- package/dist/gen/zod/itemReferenceParamSchema.js +15 -11
- package/dist/gen/zod/jsonObjectResponseFormatSchema.js +9 -9
- package/dist/gen/zod/jsonSchemaResponseFormatParamSchema.js +38 -13
- package/dist/gen/zod/jsonSchemaResponseFormatSchema.js +13 -13
- package/dist/gen/zod/logProbSchema.js +20 -14
- package/dist/gen/zod/messageRoleSchema.js +13 -8
- package/dist/gen/zod/messageSchema.js +109 -43
- package/dist/gen/zod/messageStatusSchema.js +12 -8
- package/dist/gen/zod/metadataParamSchema.js +13 -8
- package/dist/gen/zod/outputTextContentParamSchema.js +21 -12
- package/dist/gen/zod/outputTextContentSchema.js +30 -15
- package/dist/gen/zod/outputTokensDetailsSchema.js +17 -10
- package/dist/gen/zod/reasoningBodySchema.js +173 -54
- package/dist/gen/zod/reasoningEffortEnumSchema.js +14 -8
- package/dist/gen/zod/reasoningItemParamSchema.js +26 -14
- package/dist/gen/zod/reasoningParamSchema.js +33 -13
- package/dist/gen/zod/reasoningSchema.js +27 -13
- package/dist/gen/zod/reasoningSummaryContentParamSchema.js +13 -10
- package/dist/gen/zod/reasoningSummaryEnumSchema.js +12 -8
- package/dist/gen/zod/reasoningTextContentSchema.js +16 -11
- package/dist/gen/zod/refusalContentParamSchema.js +13 -10
- package/dist/gen/zod/refusalContentSchema.js +18 -11
- package/dist/gen/zod/responseCompletedStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseContentPartAddedStreamingEventSchema.js +98 -39
- package/dist/gen/zod/responseContentPartDoneStreamingEventSchema.js +98 -39
- package/dist/gen/zod/responseCreatedStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseFailedStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseFunctionCallArgumentsDeltaStreamingEventSchema.js +38 -15
- package/dist/gen/zod/responseFunctionCallArgumentsDoneStreamingEventSchema.js +33 -14
- package/dist/gen/zod/responseInProgressStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseIncompleteStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseOutputItemAddedStreamingEventSchema.js +32 -14
- package/dist/gen/zod/responseOutputItemDoneStreamingEventSchema.js +30 -14
- package/dist/gen/zod/responseOutputTextAnnotationAddedStreamingEventSchema.js +43 -17
- package/dist/gen/zod/responseOutputTextDeltaStreamingEventSchema.js +48 -18
- package/dist/gen/zod/responseOutputTextDoneStreamingEventSchema.js +39 -17
- package/dist/gen/zod/responseQueuedStreamingEventSchema.js +23 -13
- package/dist/gen/zod/responseReasoningDeltaStreamingEventSchema.js +40 -16
- package/dist/gen/zod/responseReasoningDoneStreamingEventSchema.js +31 -15
- package/dist/gen/zod/responseReasoningSummaryDeltaStreamingEventSchema.js +42 -16
- package/dist/gen/zod/responseReasoningSummaryDoneStreamingEventSchema.js +33 -15
- package/dist/gen/zod/responseReasoningSummaryPartAddedStreamingEventSchema.js +102 -39
- package/dist/gen/zod/responseReasoningSummaryPartDoneStreamingEventSchema.js +102 -39
- package/dist/gen/zod/responseRefusalDeltaStreamingEventSchema.js +33 -15
- package/dist/gen/zod/responseRefusalDoneStreamingEventSchema.js +31 -15
- package/dist/gen/zod/responseResourceSchema.js +146 -51
- package/dist/gen/zod/responsesToolParamSchema.js +15 -11
- package/dist/gen/zod/serviceTierEnumSchema.js +13 -8
- package/dist/gen/zod/specificFunctionParamSchema.js +13 -10
- package/dist/gen/zod/specificToolChoiceParamSchema.js +11 -9
- package/dist/gen/zod/streamOptionsParamSchema.js +18 -10
- package/dist/gen/zod/summaryTextContentSchema.js +18 -11
- package/dist/gen/zod/systemMessageItemParamSchema.js +35 -16
- package/dist/gen/zod/textContentSchema.js +13 -11
- package/dist/gen/zod/textFieldSchema.js +24 -14
- package/dist/gen/zod/textFormatParamSchema.js +16 -10
- package/dist/gen/zod/textParamSchema.js +23 -12
- package/dist/gen/zod/textResponseFormatSchema.js +9 -9
- package/dist/gen/zod/toolChoiceParamSchema.js +21 -11
- package/dist/gen/zod/toolChoiceValueEnumSchema.js +8 -8
- package/dist/gen/zod/toolSchema.js +16 -11
- package/dist/gen/zod/topLogProbSchema.js +14 -12
- package/dist/gen/zod/truncationEnumSchema.js +8 -8
- package/dist/gen/zod/urlCitationBodySchema.js +29 -14
- package/dist/gen/zod/urlCitationParamSchema.js +28 -13
- package/dist/gen/zod/usageSchema.js +35 -16
- package/dist/gen/zod/userMessageItemParamSchema.js +64 -22
- package/dist/gen/zod/verbosityEnumSchema.js +8 -8
- package/dist/index.cjs +740 -0
- package/dist/index.d.cts +2742 -0
- package/dist/index.d.mts +51000 -31111
- package/dist/index.d.ts +962 -29932
- package/dist/index.js +347 -1431
- package/dist/index.mjs +2441 -1010
- package/dist/react/index.cjs +119 -0
- package/dist/react/index.d.cts +21 -0
- package/dist/react/index.d.ts +21 -0
- package/dist/react/index.js +94 -0
- package/package.json +40 -8
- package/.dockerignore +0 -5
- package/Dockerfile +0 -25
- package/kubb.config.js +0 -30
- package/kubb.config.ts +0 -35
- package/public/logos/tekimax-logo-ScreenRGB-2.png +0 -0
- package/spec/openapi.json +0 -3876
- package/src/client.ts +0 -129
- package/src/gen/.kubb/config.ts +0 -43
- package/src/gen/client/createresponse.ts +0 -27
- package/src/gen/client/index.ts +0 -1
- package/src/gen/index.ts +0 -187
- package/src/gen/schemas/allowedToolChoice.json +0 -1
- package/src/gen/schemas/allowedToolsParam.json +0 -1
- package/src/gen/schemas/annotation.json +0 -1
- package/src/gen/schemas/assistantMessageItemParam.json +0 -1
- package/src/gen/schemas/createResponseBody.json +0 -1
- package/src/gen/schemas/detailEnum.json +0 -1
- package/src/gen/schemas/developerMessageItemParam.json +0 -1
- package/src/gen/schemas/emptyModelParam.json +0 -1
- package/src/gen/schemas/error.json +0 -1
- package/src/gen/schemas/errorPayload.json +0 -1
- package/src/gen/schemas/errorStreamingEvent.json +0 -1
- package/src/gen/schemas/functionCall.json +0 -1
- package/src/gen/schemas/functionCallItemParam.json +0 -1
- package/src/gen/schemas/functionCallItemStatus.json +0 -1
- package/src/gen/schemas/functionCallOutput.json +0 -1
- package/src/gen/schemas/functionCallOutputItemParam.json +0 -1
- package/src/gen/schemas/functionCallOutputStatusEnum.json +0 -1
- package/src/gen/schemas/functionCallStatus.json +0 -1
- package/src/gen/schemas/functionTool.json +0 -1
- package/src/gen/schemas/functionToolChoice.json +0 -1
- package/src/gen/schemas/functionToolParam.json +0 -1
- package/src/gen/schemas/imageDetail.json +0 -1
- package/src/gen/schemas/includeEnum.json +0 -1
- package/src/gen/schemas/incompleteDetails.json +0 -1
- package/src/gen/schemas/inputFileContent.json +0 -1
- package/src/gen/schemas/inputFileContentParam.json +0 -1
- package/src/gen/schemas/inputImageContent.json +0 -1
- package/src/gen/schemas/inputImageContentParamAutoParam.json +0 -1
- package/src/gen/schemas/inputTextContent.json +0 -1
- package/src/gen/schemas/inputTextContentParam.json +0 -1
- package/src/gen/schemas/inputTokensDetails.json +0 -1
- package/src/gen/schemas/inputVideoContent.json +0 -1
- package/src/gen/schemas/itemField.json +0 -1
- package/src/gen/schemas/itemParam.json +0 -1
- package/src/gen/schemas/itemReferenceParam.json +0 -1
- package/src/gen/schemas/jsonObjectResponseFormat.json +0 -1
- package/src/gen/schemas/jsonSchemaResponseFormat.json +0 -1
- package/src/gen/schemas/jsonSchemaResponseFormatParam.json +0 -1
- package/src/gen/schemas/logProb.json +0 -1
- package/src/gen/schemas/message.json +0 -1
- package/src/gen/schemas/messageRole.json +0 -1
- package/src/gen/schemas/messageStatus.json +0 -1
- package/src/gen/schemas/metadataParam.json +0 -1
- package/src/gen/schemas/outputTextContent.json +0 -1
- package/src/gen/schemas/outputTextContentParam.json +0 -1
- package/src/gen/schemas/outputTokensDetails.json +0 -1
- package/src/gen/schemas/reasoning.json +0 -1
- package/src/gen/schemas/reasoningBody.json +0 -1
- package/src/gen/schemas/reasoningEffortEnum.json +0 -1
- package/src/gen/schemas/reasoningItemParam.json +0 -1
- package/src/gen/schemas/reasoningParam.json +0 -1
- package/src/gen/schemas/reasoningSummaryContentParam.json +0 -1
- package/src/gen/schemas/reasoningSummaryEnum.json +0 -1
- package/src/gen/schemas/reasoningTextContent.json +0 -1
- package/src/gen/schemas/refusalContent.json +0 -1
- package/src/gen/schemas/refusalContentParam.json +0 -1
- package/src/gen/schemas/responseCompletedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseContentPartAddedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseContentPartDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseCreatedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseFailedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseFunctionCallArgumentsDeltaStreamingEvent.json +0 -1
- package/src/gen/schemas/responseFunctionCallArgumentsDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseInProgressStreamingEvent.json +0 -1
- package/src/gen/schemas/responseIncompleteStreamingEvent.json +0 -1
- package/src/gen/schemas/responseOutputItemAddedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseOutputItemDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseOutputTextAnnotationAddedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseOutputTextDeltaStreamingEvent.json +0 -1
- package/src/gen/schemas/responseOutputTextDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseQueuedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningDeltaStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningSummaryDeltaStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningSummaryDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningSummaryPartAddedStreamingEvent.json +0 -1
- package/src/gen/schemas/responseReasoningSummaryPartDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseRefusalDeltaStreamingEvent.json +0 -1
- package/src/gen/schemas/responseRefusalDoneStreamingEvent.json +0 -1
- package/src/gen/schemas/responseResource.json +0 -1
- package/src/gen/schemas/responsesToolParam.json +0 -1
- package/src/gen/schemas/serviceTierEnum.json +0 -1
- package/src/gen/schemas/specificFunctionParam.json +0 -1
- package/src/gen/schemas/specificToolChoiceParam.json +0 -1
- package/src/gen/schemas/streamOptionsParam.json +0 -1
- package/src/gen/schemas/summaryTextContent.json +0 -1
- package/src/gen/schemas/systemMessageItemParam.json +0 -1
- package/src/gen/schemas/textContent.json +0 -1
- package/src/gen/schemas/textField.json +0 -1
- package/src/gen/schemas/textFormatParam.json +0 -1
- package/src/gen/schemas/textParam.json +0 -1
- package/src/gen/schemas/textResponseFormat.json +0 -1
- package/src/gen/schemas/tool.json +0 -1
- package/src/gen/schemas/toolChoiceParam.json +0 -1
- package/src/gen/schemas/toolChoiceValueEnum.json +0 -1
- package/src/gen/schemas/topLogProb.json +0 -1
- package/src/gen/schemas/truncationEnum.json +0 -1
- package/src/gen/schemas/urlCitationBody.json +0 -1
- package/src/gen/schemas/urlCitationParam.json +0 -1
- package/src/gen/schemas/usage.json +0 -1
- package/src/gen/schemas/userMessageItemParam.json +0 -1
- package/src/gen/schemas/verbosityEnum.json +0 -1
- package/src/gen/types.ts +0 -2613
- package/src/gen/zod/allowedToolChoiceSchema.ts +0 -14
- package/src/gen/zod/allowedToolsParamSchema.ts +0 -14
- package/src/gen/zod/annotationSchema.ts +0 -14
- package/src/gen/zod/assistantMessageItemParamSchema.ts +0 -20
- package/src/gen/zod/createResponseBodySchema.ts +0 -45
- package/src/gen/zod/createresponseSchema.ts +0 -17
- package/src/gen/zod/detailEnumSchema.ts +0 -8
- package/src/gen/zod/developerMessageItemParamSchema.ts +0 -17
- package/src/gen/zod/emptyModelParamSchema.ts +0 -10
- package/src/gen/zod/errorPayloadSchema.ts +0 -19
- package/src/gen/zod/errorSchema.ts +0 -14
- package/src/gen/zod/errorStreamingEventSchema.ts +0 -16
- package/src/gen/zod/functionCallItemParamSchema.ts +0 -16
- package/src/gen/zod/functionCallItemStatusSchema.ts +0 -8
- package/src/gen/zod/functionCallOutputItemParamSchema.ts +0 -30
- package/src/gen/zod/functionCallOutputSchema.ts +0 -27
- package/src/gen/zod/functionCallOutputStatusEnumSchema.ts +0 -11
- package/src/gen/zod/functionCallSchema.ts +0 -19
- package/src/gen/zod/functionCallStatusSchema.ts +0 -8
- package/src/gen/zod/functionToolChoiceSchema.ts +0 -11
- package/src/gen/zod/functionToolParamSchema.ts +0 -15
- package/src/gen/zod/functionToolSchema.ts +0 -19
- package/src/gen/zod/imageDetailSchema.ts +0 -8
- package/src/gen/zod/includeEnumSchema.ts +0 -8
- package/src/gen/zod/incompleteDetailsSchema.ts +0 -13
- package/src/gen/zod/index.ts +0 -103
- package/src/gen/zod/inputFileContentParamSchema.ts +0 -16
- package/src/gen/zod/inputFileContentSchema.ts +0 -15
- package/src/gen/zod/inputImageContentParamAutoParamSchema.ts +0 -16
- package/src/gen/zod/inputImageContentSchema.ts +0 -16
- package/src/gen/zod/inputTextContentParamSchema.ts +0 -14
- package/src/gen/zod/inputTextContentSchema.ts +0 -14
- package/src/gen/zod/inputTokensDetailsSchema.ts +0 -13
- package/src/gen/zod/inputVideoContentSchema.ts +0 -14
- package/src/gen/zod/itemFieldSchema.ts +0 -23
- package/src/gen/zod/itemParamSchema.ts +0 -23
- package/src/gen/zod/itemReferenceParamSchema.ts +0 -14
- package/src/gen/zod/jsonObjectResponseFormatSchema.ts +0 -10
- package/src/gen/zod/jsonSchemaResponseFormatParamSchema.ts +0 -16
- package/src/gen/zod/jsonSchemaResponseFormatSchema.ts +0 -14
- package/src/gen/zod/logProbSchema.ts +0 -17
- package/src/gen/zod/messageRoleSchema.ts +0 -8
- package/src/gen/zod/messageSchema.ts +0 -46
- package/src/gen/zod/messageStatusSchema.ts +0 -8
- package/src/gen/zod/metadataParamSchema.ts +0 -13
- package/src/gen/zod/outputTextContentParamSchema.ts +0 -13
- package/src/gen/zod/outputTextContentSchema.ts +0 -18
- package/src/gen/zod/outputTokensDetailsSchema.ts +0 -13
- package/src/gen/zod/reasoningBodySchema.ts +0 -57
- package/src/gen/zod/reasoningEffortEnumSchema.ts +0 -8
- package/src/gen/zod/reasoningItemParamSchema.ts +0 -15
- package/src/gen/zod/reasoningParamSchema.ts +0 -16
- package/src/gen/zod/reasoningSchema.ts +0 -16
- package/src/gen/zod/reasoningSummaryContentParamSchema.ts +0 -11
- package/src/gen/zod/reasoningSummaryEnumSchema.ts +0 -8
- package/src/gen/zod/reasoningTextContentSchema.ts +0 -14
- package/src/gen/zod/refusalContentParamSchema.ts +0 -11
- package/src/gen/zod/refusalContentSchema.ts +0 -14
- package/src/gen/zod/responseCompletedStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseContentPartAddedStreamingEventSchema.ts +0 -42
- package/src/gen/zod/responseContentPartDoneStreamingEventSchema.ts +0 -42
- package/src/gen/zod/responseCreatedStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseFailedStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseFunctionCallArgumentsDeltaStreamingEventSchema.ts +0 -18
- package/src/gen/zod/responseFunctionCallArgumentsDoneStreamingEventSchema.ts +0 -17
- package/src/gen/zod/responseInProgressStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseIncompleteStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseOutputItemAddedStreamingEventSchema.ts +0 -17
- package/src/gen/zod/responseOutputItemDoneStreamingEventSchema.ts +0 -17
- package/src/gen/zod/responseOutputTextAnnotationAddedStreamingEventSchema.ts +0 -20
- package/src/gen/zod/responseOutputTextDeltaStreamingEventSchema.ts +0 -21
- package/src/gen/zod/responseOutputTextDoneStreamingEventSchema.ts +0 -20
- package/src/gen/zod/responseQueuedStreamingEventSchema.ts +0 -16
- package/src/gen/zod/responseReasoningDeltaStreamingEventSchema.ts +0 -19
- package/src/gen/zod/responseReasoningDoneStreamingEventSchema.ts +0 -18
- package/src/gen/zod/responseReasoningSummaryDeltaStreamingEventSchema.ts +0 -19
- package/src/gen/zod/responseReasoningSummaryDoneStreamingEventSchema.ts +0 -18
- package/src/gen/zod/responseReasoningSummaryPartAddedStreamingEventSchema.ts +0 -42
- package/src/gen/zod/responseReasoningSummaryPartDoneStreamingEventSchema.ts +0 -42
- package/src/gen/zod/responseRefusalDeltaStreamingEventSchema.ts +0 -18
- package/src/gen/zod/responseRefusalDoneStreamingEventSchema.ts +0 -18
- package/src/gen/zod/responseResourceSchema.ts +0 -54
- package/src/gen/zod/responsesToolParamSchema.ts +0 -11
- package/src/gen/zod/serviceTierEnumSchema.ts +0 -8
- package/src/gen/zod/specificFunctionParamSchema.ts +0 -11
- package/src/gen/zod/specificToolChoiceParamSchema.ts +0 -9
- package/src/gen/zod/streamOptionsParamSchema.ts +0 -13
- package/src/gen/zod/summaryTextContentSchema.ts +0 -14
- package/src/gen/zod/systemMessageItemParamSchema.ts +0 -17
- package/src/gen/zod/textContentSchema.ts +0 -14
- package/src/gen/zod/textFieldSchema.ts +0 -15
- package/src/gen/zod/textFormatParamSchema.ts +0 -10
- package/src/gen/zod/textParamSchema.ts +0 -13
- package/src/gen/zod/textResponseFormatSchema.ts +0 -10
- package/src/gen/zod/toolChoiceParamSchema.ts +0 -14
- package/src/gen/zod/toolChoiceValueEnumSchema.ts +0 -8
- package/src/gen/zod/toolSchema.ts +0 -14
- package/src/gen/zod/topLogProbSchema.ts +0 -15
- package/src/gen/zod/truncationEnumSchema.ts +0 -8
- package/src/gen/zod/urlCitationBodySchema.ts +0 -17
- package/src/gen/zod/urlCitationParamSchema.ts +0 -14
- package/src/gen/zod/usageSchema.ts +0 -19
- package/src/gen/zod/userMessageItemParamSchema.ts +0 -23
- package/src/gen/zod/verbosityEnumSchema.ts +0 -8
- package/src/index.ts +0 -3
- package/tsconfig.json +0 -21
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ApiTypes: () => types_exports,
|
|
24
|
+
TekimaxClient: () => TekimaxClient,
|
|
25
|
+
TekimaxProvider: () => TekimaxProvider,
|
|
26
|
+
generateText: () => generateText,
|
|
27
|
+
tool: () => tool
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
|
|
31
|
+
// src/providers/tekimax/client.ts
|
|
32
|
+
var import_eventsource_parser = require("eventsource-parser");
|
|
33
|
+
var TekimaxResponse = class {
|
|
34
|
+
constructor(_raw) {
|
|
35
|
+
this._raw = _raw;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Access the raw response object returned by the API.
|
|
39
|
+
*/
|
|
40
|
+
get raw() {
|
|
41
|
+
return this._raw;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Automatically extracts the text content from the response.
|
|
45
|
+
* It looks for the first "output_text" item in the response content.
|
|
46
|
+
*/
|
|
47
|
+
get text() {
|
|
48
|
+
for (const item of this._raw.output) {
|
|
49
|
+
if (item.type === "message") {
|
|
50
|
+
for (const contentPart of item.content) {
|
|
51
|
+
if (contentPart.type === "output_text" || contentPart.type === "text") {
|
|
52
|
+
return contentPart.text;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The ID of the response.
|
|
61
|
+
*/
|
|
62
|
+
get id() {
|
|
63
|
+
return this._raw.id;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The model used to generate the response.
|
|
67
|
+
*/
|
|
68
|
+
get model() {
|
|
69
|
+
return this._raw.model;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var TekimaxClient = class {
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new TekimaxClient.
|
|
75
|
+
*
|
|
76
|
+
* @param options - Configuration options for the client.
|
|
77
|
+
* @param options.baseUrl - The base URL of the API (default: "https://api.tekimax.com").
|
|
78
|
+
* @param options.apiKey - Your Tekimax API key.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* const client = new TekimaxClient({ apiKey: "tm_..." });
|
|
82
|
+
*/
|
|
83
|
+
constructor(options = {}) {
|
|
84
|
+
this.baseUrl = options.baseUrl || "https://api.tekimax.com";
|
|
85
|
+
this.headers = {
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
...options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async request(path, body, options) {
|
|
91
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: this.headers,
|
|
94
|
+
body: JSON.stringify(body),
|
|
95
|
+
signal: options?.signal
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
`Tekimax API Error: ${response.status} ${response.statusText}`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const data = await response.json();
|
|
103
|
+
return new TekimaxResponse(data);
|
|
104
|
+
}
|
|
105
|
+
async *requestStream(path, body, options) {
|
|
106
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
107
|
+
method: "POST",
|
|
108
|
+
headers: this.headers,
|
|
109
|
+
body: JSON.stringify(body),
|
|
110
|
+
signal: options?.signal
|
|
111
|
+
});
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
`Tekimax API Error: ${response.status} ${response.statusText}`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
if (!response.body) {
|
|
118
|
+
throw new Error("No response body received for streaming request");
|
|
119
|
+
}
|
|
120
|
+
const reader = response.body.getReader();
|
|
121
|
+
const decoder = new TextDecoder();
|
|
122
|
+
const buffer = [];
|
|
123
|
+
const parser = (0, import_eventsource_parser.createParser)({
|
|
124
|
+
onEvent(event) {
|
|
125
|
+
if (event.type === "event") {
|
|
126
|
+
try {
|
|
127
|
+
if (event.data === "[DONE]") return;
|
|
128
|
+
buffer.push(JSON.parse(event.data));
|
|
129
|
+
} catch (e) {
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
try {
|
|
135
|
+
while (true) {
|
|
136
|
+
const { done, value } = await reader.read();
|
|
137
|
+
if (done) break;
|
|
138
|
+
parser.feed(decoder.decode(value, { stream: true }));
|
|
139
|
+
while (buffer.length > 0) {
|
|
140
|
+
yield buffer.shift();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} finally {
|
|
144
|
+
reader.releaseLock();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new session and sends the initial message.
|
|
149
|
+
*
|
|
150
|
+
* @param message - The initial message text to start the session.
|
|
151
|
+
* @param options - Additional configuration options (model, temperature, etc.).
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* const response = await client.createSession("Hello, world!", { model: "gpt-4" });
|
|
155
|
+
* console.log(response.text);
|
|
156
|
+
*/
|
|
157
|
+
async createSession(message, options) {
|
|
158
|
+
const body = {
|
|
159
|
+
...options,
|
|
160
|
+
input: message
|
|
161
|
+
};
|
|
162
|
+
const { signal } = options || {};
|
|
163
|
+
const cleanBody = { ...body };
|
|
164
|
+
delete cleanBody.signal;
|
|
165
|
+
return this.request("/responses", cleanBody, { signal });
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Sends a message to an existing session or starts a new one if no previous_response_id is provided.
|
|
169
|
+
*
|
|
170
|
+
* @param message - The message text to send.
|
|
171
|
+
* @param options - Additional configuration options.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* const response = await client.sendMessage("What is the weather?", {
|
|
175
|
+
* previous_response_id: "resp_123"
|
|
176
|
+
* });
|
|
177
|
+
* console.log(response.text);
|
|
178
|
+
*/
|
|
179
|
+
async sendMessage(message, options) {
|
|
180
|
+
const body = {
|
|
181
|
+
...options,
|
|
182
|
+
input: message,
|
|
183
|
+
stream: false
|
|
184
|
+
};
|
|
185
|
+
const { signal } = options || {};
|
|
186
|
+
const cleanBody = { ...body };
|
|
187
|
+
delete cleanBody.signal;
|
|
188
|
+
return this.request("/responses", cleanBody, { signal });
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Sends a message and returns an asynchronous iterable of streaming events.
|
|
192
|
+
*/
|
|
193
|
+
async *sendMessageStream(message, options) {
|
|
194
|
+
const body = {
|
|
195
|
+
...options,
|
|
196
|
+
input: message,
|
|
197
|
+
stream: true
|
|
198
|
+
};
|
|
199
|
+
const { signal } = options || {};
|
|
200
|
+
const cleanBody = { ...body };
|
|
201
|
+
delete cleanBody.signal;
|
|
202
|
+
yield* this.requestStream("/responses", cleanBody, { signal });
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// src/providers/tekimax/index.ts
|
|
207
|
+
var TekimaxProvider = class {
|
|
208
|
+
constructor(options = {}) {
|
|
209
|
+
this.name = "tekimax";
|
|
210
|
+
this.client = new TekimaxClient(options);
|
|
211
|
+
}
|
|
212
|
+
async chat(options) {
|
|
213
|
+
const tools = options.tools?.map((t) => ({
|
|
214
|
+
type: "function",
|
|
215
|
+
name: t.function.name,
|
|
216
|
+
description: t.function.description ?? void 0,
|
|
217
|
+
parameters: t.function.parameters ?? void 0
|
|
218
|
+
}));
|
|
219
|
+
const response = await this.client.sendMessage(this.getLastUserMessage(options.messages), {
|
|
220
|
+
model: options.model,
|
|
221
|
+
temperature: options.temperature,
|
|
222
|
+
max_output_tokens: options.maxTokens,
|
|
223
|
+
tools,
|
|
224
|
+
signal: options.signal
|
|
225
|
+
});
|
|
226
|
+
if (response.raw.output) {
|
|
227
|
+
const toolCalls = [];
|
|
228
|
+
for (const item of response.raw.output) {
|
|
229
|
+
if (item.type === "function_call") {
|
|
230
|
+
toolCalls.push({
|
|
231
|
+
id: item.call_id,
|
|
232
|
+
type: "function",
|
|
233
|
+
function: {
|
|
234
|
+
name: item.name,
|
|
235
|
+
arguments: item.arguments
|
|
236
|
+
// Already a string in generated types
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (toolCalls.length > 0) {
|
|
242
|
+
return {
|
|
243
|
+
message: {
|
|
244
|
+
role: "assistant",
|
|
245
|
+
content: response.text || null,
|
|
246
|
+
toolCalls
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (!response.text) {
|
|
252
|
+
if (options.tools && options.tools.length > 0) {
|
|
253
|
+
return { message: { role: "assistant", content: null } };
|
|
254
|
+
}
|
|
255
|
+
throw new Error("No text content in response");
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
message: {
|
|
259
|
+
role: "assistant",
|
|
260
|
+
content: response.text
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
async *chatStream(options) {
|
|
265
|
+
const tools = options.tools?.map((t) => ({
|
|
266
|
+
type: "function",
|
|
267
|
+
name: t.function.name,
|
|
268
|
+
description: t.function.description ?? void 0,
|
|
269
|
+
parameters: t.function.parameters ?? void 0
|
|
270
|
+
}));
|
|
271
|
+
const stream = this.client.sendMessageStream(this.getLastUserMessage(options.messages), {
|
|
272
|
+
model: options.model,
|
|
273
|
+
temperature: options.temperature,
|
|
274
|
+
max_output_tokens: options.maxTokens,
|
|
275
|
+
tools,
|
|
276
|
+
signal: options.signal
|
|
277
|
+
});
|
|
278
|
+
for await (const event of stream) {
|
|
279
|
+
if (event.type === "response.output_text.delta" && event.delta) {
|
|
280
|
+
yield {
|
|
281
|
+
delta: event.delta
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
getLastUserMessage(messages) {
|
|
287
|
+
const lastUser = messages.slice().reverse().find((m) => m.role === "user");
|
|
288
|
+
return lastUser?.content || "";
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// src/gen/types.ts
|
|
293
|
+
var types_exports = {};
|
|
294
|
+
__export(types_exports, {
|
|
295
|
+
allowedToolChoiceTypeEnum: () => allowedToolChoiceTypeEnum,
|
|
296
|
+
allowedToolsParamTypeEnum: () => allowedToolsParamTypeEnum,
|
|
297
|
+
assistantMessageItemParamRoleEnum: () => assistantMessageItemParamRoleEnum,
|
|
298
|
+
assistantMessageItemParamTypeEnum: () => assistantMessageItemParamTypeEnum,
|
|
299
|
+
detailEnumEnum: () => detailEnumEnum,
|
|
300
|
+
developerMessageItemParamRoleEnum: () => developerMessageItemParamRoleEnum,
|
|
301
|
+
developerMessageItemParamTypeEnum: () => developerMessageItemParamTypeEnum,
|
|
302
|
+
errorStreamingEventTypeEnum: () => errorStreamingEventTypeEnum,
|
|
303
|
+
functionCallItemParamTypeEnum: () => functionCallItemParamTypeEnum,
|
|
304
|
+
functionCallItemStatusEnum: () => functionCallItemStatusEnum,
|
|
305
|
+
functionCallOutputItemParamTypeEnum: () => functionCallOutputItemParamTypeEnum,
|
|
306
|
+
functionCallOutputStatusEnumEnum: () => functionCallOutputStatusEnumEnum,
|
|
307
|
+
functionCallOutputTypeEnum: () => functionCallOutputTypeEnum,
|
|
308
|
+
functionCallStatusEnum: () => functionCallStatusEnum,
|
|
309
|
+
functionCallTypeEnum: () => functionCallTypeEnum,
|
|
310
|
+
functionToolChoiceTypeEnum: () => functionToolChoiceTypeEnum,
|
|
311
|
+
functionToolParamTypeEnum: () => functionToolParamTypeEnum,
|
|
312
|
+
functionToolTypeEnum: () => functionToolTypeEnum,
|
|
313
|
+
imageDetailEnum: () => imageDetailEnum,
|
|
314
|
+
includeEnumEnum: () => includeEnumEnum,
|
|
315
|
+
inputFileContentParamTypeEnum: () => inputFileContentParamTypeEnum,
|
|
316
|
+
inputFileContentTypeEnum: () => inputFileContentTypeEnum,
|
|
317
|
+
inputImageContentParamAutoParamTypeEnum: () => inputImageContentParamAutoParamTypeEnum,
|
|
318
|
+
inputImageContentTypeEnum: () => inputImageContentTypeEnum,
|
|
319
|
+
inputTextContentParamTypeEnum: () => inputTextContentParamTypeEnum,
|
|
320
|
+
inputTextContentTypeEnum: () => inputTextContentTypeEnum,
|
|
321
|
+
inputVideoContentTypeEnum: () => inputVideoContentTypeEnum,
|
|
322
|
+
itemReferenceParamTypeEnum: () => itemReferenceParamTypeEnum,
|
|
323
|
+
jsonObjectResponseFormatTypeEnum: () => jsonObjectResponseFormatTypeEnum,
|
|
324
|
+
jsonSchemaResponseFormatParamTypeEnum: () => jsonSchemaResponseFormatParamTypeEnum,
|
|
325
|
+
jsonSchemaResponseFormatTypeEnum: () => jsonSchemaResponseFormatTypeEnum,
|
|
326
|
+
messageRoleEnum: () => messageRoleEnum,
|
|
327
|
+
messageStatusEnum: () => messageStatusEnum,
|
|
328
|
+
messageTypeEnum: () => messageTypeEnum,
|
|
329
|
+
outputTextContentParamTypeEnum: () => outputTextContentParamTypeEnum,
|
|
330
|
+
outputTextContentTypeEnum: () => outputTextContentTypeEnum,
|
|
331
|
+
reasoningBodyTypeEnum: () => reasoningBodyTypeEnum,
|
|
332
|
+
reasoningEffortEnumEnum: () => reasoningEffortEnumEnum,
|
|
333
|
+
reasoningItemParamTypeEnum: () => reasoningItemParamTypeEnum,
|
|
334
|
+
reasoningSummaryContentParamTypeEnum: () => reasoningSummaryContentParamTypeEnum,
|
|
335
|
+
reasoningSummaryEnumEnum: () => reasoningSummaryEnumEnum,
|
|
336
|
+
reasoningTextContentTypeEnum: () => reasoningTextContentTypeEnum,
|
|
337
|
+
refusalContentParamTypeEnum: () => refusalContentParamTypeEnum,
|
|
338
|
+
refusalContentTypeEnum: () => refusalContentTypeEnum,
|
|
339
|
+
responseCompletedStreamingEventTypeEnum: () => responseCompletedStreamingEventTypeEnum,
|
|
340
|
+
responseContentPartAddedStreamingEventTypeEnum: () => responseContentPartAddedStreamingEventTypeEnum,
|
|
341
|
+
responseContentPartDoneStreamingEventTypeEnum: () => responseContentPartDoneStreamingEventTypeEnum,
|
|
342
|
+
responseCreatedStreamingEventTypeEnum: () => responseCreatedStreamingEventTypeEnum,
|
|
343
|
+
responseFailedStreamingEventTypeEnum: () => responseFailedStreamingEventTypeEnum,
|
|
344
|
+
responseFunctionCallArgumentsDeltaStreamingEventTypeEnum: () => responseFunctionCallArgumentsDeltaStreamingEventTypeEnum,
|
|
345
|
+
responseFunctionCallArgumentsDoneStreamingEventTypeEnum: () => responseFunctionCallArgumentsDoneStreamingEventTypeEnum,
|
|
346
|
+
responseInProgressStreamingEventTypeEnum: () => responseInProgressStreamingEventTypeEnum,
|
|
347
|
+
responseIncompleteStreamingEventTypeEnum: () => responseIncompleteStreamingEventTypeEnum,
|
|
348
|
+
responseOutputItemAddedStreamingEventTypeEnum: () => responseOutputItemAddedStreamingEventTypeEnum,
|
|
349
|
+
responseOutputItemDoneStreamingEventTypeEnum: () => responseOutputItemDoneStreamingEventTypeEnum,
|
|
350
|
+
responseOutputTextAnnotationAddedStreamingEventTypeEnum: () => responseOutputTextAnnotationAddedStreamingEventTypeEnum,
|
|
351
|
+
responseOutputTextDeltaStreamingEventTypeEnum: () => responseOutputTextDeltaStreamingEventTypeEnum,
|
|
352
|
+
responseOutputTextDoneStreamingEventTypeEnum: () => responseOutputTextDoneStreamingEventTypeEnum,
|
|
353
|
+
responseQueuedStreamingEventTypeEnum: () => responseQueuedStreamingEventTypeEnum,
|
|
354
|
+
responseReasoningDeltaStreamingEventTypeEnum: () => responseReasoningDeltaStreamingEventTypeEnum,
|
|
355
|
+
responseReasoningDoneStreamingEventTypeEnum: () => responseReasoningDoneStreamingEventTypeEnum,
|
|
356
|
+
responseReasoningSummaryDeltaStreamingEventTypeEnum: () => responseReasoningSummaryDeltaStreamingEventTypeEnum,
|
|
357
|
+
responseReasoningSummaryDoneStreamingEventTypeEnum: () => responseReasoningSummaryDoneStreamingEventTypeEnum,
|
|
358
|
+
responseReasoningSummaryPartAddedStreamingEventTypeEnum: () => responseReasoningSummaryPartAddedStreamingEventTypeEnum,
|
|
359
|
+
responseReasoningSummaryPartDoneStreamingEventTypeEnum: () => responseReasoningSummaryPartDoneStreamingEventTypeEnum,
|
|
360
|
+
responseRefusalDeltaStreamingEventTypeEnum: () => responseRefusalDeltaStreamingEventTypeEnum,
|
|
361
|
+
responseRefusalDoneStreamingEventTypeEnum: () => responseRefusalDoneStreamingEventTypeEnum,
|
|
362
|
+
responseResourceObjectEnum: () => responseResourceObjectEnum,
|
|
363
|
+
serviceTierEnumEnum: () => serviceTierEnumEnum,
|
|
364
|
+
specificFunctionParamTypeEnum: () => specificFunctionParamTypeEnum,
|
|
365
|
+
summaryTextContentTypeEnum: () => summaryTextContentTypeEnum,
|
|
366
|
+
systemMessageItemParamRoleEnum: () => systemMessageItemParamRoleEnum,
|
|
367
|
+
systemMessageItemParamTypeEnum: () => systemMessageItemParamTypeEnum,
|
|
368
|
+
textContentTypeEnum: () => textContentTypeEnum,
|
|
369
|
+
textResponseFormatTypeEnum: () => textResponseFormatTypeEnum,
|
|
370
|
+
toolChoiceValueEnumEnum: () => toolChoiceValueEnumEnum,
|
|
371
|
+
truncationEnumEnum: () => truncationEnumEnum,
|
|
372
|
+
urlCitationBodyTypeEnum: () => urlCitationBodyTypeEnum,
|
|
373
|
+
urlCitationParamTypeEnum: () => urlCitationParamTypeEnum,
|
|
374
|
+
userMessageItemParamRoleEnum: () => userMessageItemParamRoleEnum,
|
|
375
|
+
userMessageItemParamTypeEnum: () => userMessageItemParamTypeEnum,
|
|
376
|
+
verbosityEnumEnum: () => verbosityEnumEnum
|
|
377
|
+
});
|
|
378
|
+
var itemReferenceParamTypeEnum = {
|
|
379
|
+
item_reference: "item_reference"
|
|
380
|
+
};
|
|
381
|
+
var reasoningSummaryContentParamTypeEnum = {
|
|
382
|
+
summary_text: "summary_text"
|
|
383
|
+
};
|
|
384
|
+
var reasoningItemParamTypeEnum = {
|
|
385
|
+
reasoning: "reasoning"
|
|
386
|
+
};
|
|
387
|
+
var inputTextContentParamTypeEnum = {
|
|
388
|
+
input_text: "input_text"
|
|
389
|
+
};
|
|
390
|
+
var detailEnumEnum = {
|
|
391
|
+
low: "low",
|
|
392
|
+
high: "high",
|
|
393
|
+
auto: "auto"
|
|
394
|
+
};
|
|
395
|
+
var imageDetailEnum = {
|
|
396
|
+
low: "low",
|
|
397
|
+
high: "high",
|
|
398
|
+
auto: "auto"
|
|
399
|
+
};
|
|
400
|
+
var inputImageContentParamAutoParamTypeEnum = {
|
|
401
|
+
input_image: "input_image"
|
|
402
|
+
};
|
|
403
|
+
var inputFileContentParamTypeEnum = {
|
|
404
|
+
input_file: "input_file"
|
|
405
|
+
};
|
|
406
|
+
var userMessageItemParamTypeEnum = {
|
|
407
|
+
message: "message"
|
|
408
|
+
};
|
|
409
|
+
var userMessageItemParamRoleEnum = {
|
|
410
|
+
user: "user"
|
|
411
|
+
};
|
|
412
|
+
var systemMessageItemParamTypeEnum = {
|
|
413
|
+
message: "message"
|
|
414
|
+
};
|
|
415
|
+
var systemMessageItemParamRoleEnum = {
|
|
416
|
+
system: "system"
|
|
417
|
+
};
|
|
418
|
+
var developerMessageItemParamTypeEnum = {
|
|
419
|
+
message: "message"
|
|
420
|
+
};
|
|
421
|
+
var developerMessageItemParamRoleEnum = {
|
|
422
|
+
developer: "developer"
|
|
423
|
+
};
|
|
424
|
+
var urlCitationParamTypeEnum = {
|
|
425
|
+
url_citation: "url_citation"
|
|
426
|
+
};
|
|
427
|
+
var outputTextContentParamTypeEnum = {
|
|
428
|
+
output_text: "output_text"
|
|
429
|
+
};
|
|
430
|
+
var refusalContentParamTypeEnum = {
|
|
431
|
+
refusal: "refusal"
|
|
432
|
+
};
|
|
433
|
+
var assistantMessageItemParamTypeEnum = {
|
|
434
|
+
message: "message"
|
|
435
|
+
};
|
|
436
|
+
var assistantMessageItemParamRoleEnum = {
|
|
437
|
+
assistant: "assistant"
|
|
438
|
+
};
|
|
439
|
+
var functionCallItemStatusEnum = {
|
|
440
|
+
in_progress: "in_progress",
|
|
441
|
+
completed: "completed",
|
|
442
|
+
incomplete: "incomplete"
|
|
443
|
+
};
|
|
444
|
+
var functionCallStatusEnum = {
|
|
445
|
+
in_progress: "in_progress",
|
|
446
|
+
completed: "completed",
|
|
447
|
+
incomplete: "incomplete"
|
|
448
|
+
};
|
|
449
|
+
var functionCallItemParamTypeEnum = {
|
|
450
|
+
function_call: "function_call"
|
|
451
|
+
};
|
|
452
|
+
var inputVideoContentTypeEnum = {
|
|
453
|
+
input_video: "input_video"
|
|
454
|
+
};
|
|
455
|
+
var functionCallOutputItemParamTypeEnum = {
|
|
456
|
+
function_call_output: "function_call_output"
|
|
457
|
+
};
|
|
458
|
+
var includeEnumEnum = {
|
|
459
|
+
"reasoning.encrypted_content": "reasoning.encrypted_content",
|
|
460
|
+
"message.output_text.logprobs": "message.output_text.logprobs"
|
|
461
|
+
};
|
|
462
|
+
var functionToolParamTypeEnum = {
|
|
463
|
+
function: "function"
|
|
464
|
+
};
|
|
465
|
+
var specificFunctionParamTypeEnum = {
|
|
466
|
+
function: "function"
|
|
467
|
+
};
|
|
468
|
+
var toolChoiceValueEnumEnum = {
|
|
469
|
+
none: "none",
|
|
470
|
+
auto: "auto",
|
|
471
|
+
required: "required"
|
|
472
|
+
};
|
|
473
|
+
var allowedToolsParamTypeEnum = {
|
|
474
|
+
allowed_tools: "allowed_tools"
|
|
475
|
+
};
|
|
476
|
+
var verbosityEnumEnum = {
|
|
477
|
+
low: "low",
|
|
478
|
+
medium: "medium",
|
|
479
|
+
high: "high"
|
|
480
|
+
};
|
|
481
|
+
var textResponseFormatTypeEnum = {
|
|
482
|
+
text: "text"
|
|
483
|
+
};
|
|
484
|
+
var jsonSchemaResponseFormatParamTypeEnum = {
|
|
485
|
+
json_schema: "json_schema"
|
|
486
|
+
};
|
|
487
|
+
var reasoningEffortEnumEnum = {
|
|
488
|
+
none: "none",
|
|
489
|
+
low: "low",
|
|
490
|
+
medium: "medium",
|
|
491
|
+
high: "high",
|
|
492
|
+
xhigh: "xhigh"
|
|
493
|
+
};
|
|
494
|
+
var reasoningSummaryEnumEnum = {
|
|
495
|
+
concise: "concise",
|
|
496
|
+
detailed: "detailed",
|
|
497
|
+
auto: "auto"
|
|
498
|
+
};
|
|
499
|
+
var truncationEnumEnum = {
|
|
500
|
+
auto: "auto",
|
|
501
|
+
disabled: "disabled"
|
|
502
|
+
};
|
|
503
|
+
var serviceTierEnumEnum = {
|
|
504
|
+
auto: "auto",
|
|
505
|
+
default: "default",
|
|
506
|
+
flex: "flex",
|
|
507
|
+
priority: "priority"
|
|
508
|
+
};
|
|
509
|
+
var messageRoleEnum = {
|
|
510
|
+
user: "user",
|
|
511
|
+
assistant: "assistant",
|
|
512
|
+
system: "system",
|
|
513
|
+
developer: "developer"
|
|
514
|
+
};
|
|
515
|
+
var inputTextContentTypeEnum = {
|
|
516
|
+
input_text: "input_text"
|
|
517
|
+
};
|
|
518
|
+
var urlCitationBodyTypeEnum = {
|
|
519
|
+
url_citation: "url_citation"
|
|
520
|
+
};
|
|
521
|
+
var outputTextContentTypeEnum = {
|
|
522
|
+
output_text: "output_text"
|
|
523
|
+
};
|
|
524
|
+
var textContentTypeEnum = {
|
|
525
|
+
text: "text"
|
|
526
|
+
};
|
|
527
|
+
var summaryTextContentTypeEnum = {
|
|
528
|
+
summary_text: "summary_text"
|
|
529
|
+
};
|
|
530
|
+
var reasoningTextContentTypeEnum = {
|
|
531
|
+
reasoning_text: "reasoning_text"
|
|
532
|
+
};
|
|
533
|
+
var refusalContentTypeEnum = {
|
|
534
|
+
refusal: "refusal"
|
|
535
|
+
};
|
|
536
|
+
var inputImageContentTypeEnum = {
|
|
537
|
+
input_image: "input_image"
|
|
538
|
+
};
|
|
539
|
+
var inputFileContentTypeEnum = {
|
|
540
|
+
input_file: "input_file"
|
|
541
|
+
};
|
|
542
|
+
var messageStatusEnum = {
|
|
543
|
+
in_progress: "in_progress",
|
|
544
|
+
completed: "completed",
|
|
545
|
+
incomplete: "incomplete"
|
|
546
|
+
};
|
|
547
|
+
var messageTypeEnum = {
|
|
548
|
+
message: "message"
|
|
549
|
+
};
|
|
550
|
+
var functionCallTypeEnum = {
|
|
551
|
+
function_call: "function_call"
|
|
552
|
+
};
|
|
553
|
+
var functionCallOutputStatusEnumEnum = {
|
|
554
|
+
in_progress: "in_progress",
|
|
555
|
+
completed: "completed",
|
|
556
|
+
incomplete: "incomplete"
|
|
557
|
+
};
|
|
558
|
+
var functionCallOutputTypeEnum = {
|
|
559
|
+
function_call_output: "function_call_output"
|
|
560
|
+
};
|
|
561
|
+
var reasoningBodyTypeEnum = {
|
|
562
|
+
reasoning: "reasoning"
|
|
563
|
+
};
|
|
564
|
+
var functionToolTypeEnum = {
|
|
565
|
+
function: "function"
|
|
566
|
+
};
|
|
567
|
+
var functionToolChoiceTypeEnum = {
|
|
568
|
+
function: "function"
|
|
569
|
+
};
|
|
570
|
+
var allowedToolChoiceTypeEnum = {
|
|
571
|
+
allowed_tools: "allowed_tools"
|
|
572
|
+
};
|
|
573
|
+
var jsonObjectResponseFormatTypeEnum = {
|
|
574
|
+
json_object: "json_object"
|
|
575
|
+
};
|
|
576
|
+
var jsonSchemaResponseFormatTypeEnum = {
|
|
577
|
+
json_schema: "json_schema"
|
|
578
|
+
};
|
|
579
|
+
var responseResourceObjectEnum = {
|
|
580
|
+
response: "response"
|
|
581
|
+
};
|
|
582
|
+
var responseCreatedStreamingEventTypeEnum = {
|
|
583
|
+
"response.created": "response.created"
|
|
584
|
+
};
|
|
585
|
+
var responseQueuedStreamingEventTypeEnum = {
|
|
586
|
+
"response.queued": "response.queued"
|
|
587
|
+
};
|
|
588
|
+
var responseInProgressStreamingEventTypeEnum = {
|
|
589
|
+
"response.in_progress": "response.in_progress"
|
|
590
|
+
};
|
|
591
|
+
var responseCompletedStreamingEventTypeEnum = {
|
|
592
|
+
"response.completed": "response.completed"
|
|
593
|
+
};
|
|
594
|
+
var responseFailedStreamingEventTypeEnum = {
|
|
595
|
+
"response.failed": "response.failed"
|
|
596
|
+
};
|
|
597
|
+
var responseIncompleteStreamingEventTypeEnum = {
|
|
598
|
+
"response.incomplete": "response.incomplete"
|
|
599
|
+
};
|
|
600
|
+
var responseOutputItemAddedStreamingEventTypeEnum = {
|
|
601
|
+
"response.output_item.added": "response.output_item.added"
|
|
602
|
+
};
|
|
603
|
+
var responseOutputItemDoneStreamingEventTypeEnum = {
|
|
604
|
+
"response.output_item.done": "response.output_item.done"
|
|
605
|
+
};
|
|
606
|
+
var responseReasoningSummaryPartAddedStreamingEventTypeEnum = {
|
|
607
|
+
"response.reasoning_summary_part.added": "response.reasoning_summary_part.added"
|
|
608
|
+
};
|
|
609
|
+
var responseReasoningSummaryPartDoneStreamingEventTypeEnum = {
|
|
610
|
+
"response.reasoning_summary_part.done": "response.reasoning_summary_part.done"
|
|
611
|
+
};
|
|
612
|
+
var responseContentPartAddedStreamingEventTypeEnum = {
|
|
613
|
+
"response.content_part.added": "response.content_part.added"
|
|
614
|
+
};
|
|
615
|
+
var responseContentPartDoneStreamingEventTypeEnum = {
|
|
616
|
+
"response.content_part.done": "response.content_part.done"
|
|
617
|
+
};
|
|
618
|
+
var responseOutputTextDeltaStreamingEventTypeEnum = {
|
|
619
|
+
"response.output_text.delta": "response.output_text.delta"
|
|
620
|
+
};
|
|
621
|
+
var responseOutputTextDoneStreamingEventTypeEnum = {
|
|
622
|
+
"response.output_text.done": "response.output_text.done"
|
|
623
|
+
};
|
|
624
|
+
var responseRefusalDeltaStreamingEventTypeEnum = {
|
|
625
|
+
"response.refusal.delta": "response.refusal.delta"
|
|
626
|
+
};
|
|
627
|
+
var responseRefusalDoneStreamingEventTypeEnum = {
|
|
628
|
+
"response.refusal.done": "response.refusal.done"
|
|
629
|
+
};
|
|
630
|
+
var responseReasoningDeltaStreamingEventTypeEnum = {
|
|
631
|
+
"response.reasoning.delta": "response.reasoning.delta"
|
|
632
|
+
};
|
|
633
|
+
var responseReasoningDoneStreamingEventTypeEnum = {
|
|
634
|
+
"response.reasoning.done": "response.reasoning.done"
|
|
635
|
+
};
|
|
636
|
+
var responseReasoningSummaryDeltaStreamingEventTypeEnum = {
|
|
637
|
+
"response.reasoning_summary_text.delta": "response.reasoning_summary_text.delta"
|
|
638
|
+
};
|
|
639
|
+
var responseReasoningSummaryDoneStreamingEventTypeEnum = {
|
|
640
|
+
"response.reasoning_summary_text.done": "response.reasoning_summary_text.done"
|
|
641
|
+
};
|
|
642
|
+
var responseOutputTextAnnotationAddedStreamingEventTypeEnum = {
|
|
643
|
+
"response.output_text.annotation.added": "response.output_text.annotation.added"
|
|
644
|
+
};
|
|
645
|
+
var responseFunctionCallArgumentsDeltaStreamingEventTypeEnum = {
|
|
646
|
+
"response.function_call_arguments.delta": "response.function_call_arguments.delta"
|
|
647
|
+
};
|
|
648
|
+
var responseFunctionCallArgumentsDoneStreamingEventTypeEnum = {
|
|
649
|
+
"response.function_call_arguments.done": "response.function_call_arguments.done"
|
|
650
|
+
};
|
|
651
|
+
var errorStreamingEventTypeEnum = {
|
|
652
|
+
error: "error"
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
// src/core/tool.ts
|
|
656
|
+
function tool(def) {
|
|
657
|
+
return def;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// src/core/generate.ts
|
|
661
|
+
async function generateText({
|
|
662
|
+
adapter,
|
|
663
|
+
...options
|
|
664
|
+
}) {
|
|
665
|
+
const { model, tools, maxSteps = 1, temperature, maxTokens, signal } = options;
|
|
666
|
+
const currentMessages = [...options.messages];
|
|
667
|
+
let steps = 0;
|
|
668
|
+
const toolDefinitions = tools ? Object.values(tools) : void 0;
|
|
669
|
+
while (steps < maxSteps) {
|
|
670
|
+
steps++;
|
|
671
|
+
const result = await adapter.chat({
|
|
672
|
+
model,
|
|
673
|
+
messages: currentMessages,
|
|
674
|
+
tools: toolDefinitions,
|
|
675
|
+
temperature,
|
|
676
|
+
maxTokens,
|
|
677
|
+
signal
|
|
678
|
+
});
|
|
679
|
+
const { message } = result;
|
|
680
|
+
currentMessages.push(message);
|
|
681
|
+
if (!message.toolCalls || message.toolCalls.length === 0) {
|
|
682
|
+
return {
|
|
683
|
+
text: message.content || "",
|
|
684
|
+
toolCalls: [],
|
|
685
|
+
toolResults: [],
|
|
686
|
+
finishReason: "stop",
|
|
687
|
+
usage: result.usage || { promptTokens: 0, completionTokens: 0, totalTokens: 0 }
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
const toolResults = await Promise.all(
|
|
691
|
+
message.toolCalls.map(async (call) => {
|
|
692
|
+
const tool2 = tools?.[call.function.name];
|
|
693
|
+
if (!tool2) {
|
|
694
|
+
return {
|
|
695
|
+
id: call.id,
|
|
696
|
+
result: `Error: Tool ${call.function.name} not found`
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
try {
|
|
700
|
+
const args = JSON.parse(call.function.arguments);
|
|
701
|
+
const output = await tool2.execute(args);
|
|
702
|
+
return {
|
|
703
|
+
id: call.id,
|
|
704
|
+
result: output
|
|
705
|
+
};
|
|
706
|
+
} catch (error) {
|
|
707
|
+
return {
|
|
708
|
+
id: call.id,
|
|
709
|
+
result: `Error executing tool: ${error.message}`
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
})
|
|
713
|
+
);
|
|
714
|
+
for (const res of toolResults) {
|
|
715
|
+
currentMessages.push({
|
|
716
|
+
role: "tool",
|
|
717
|
+
content: JSON.stringify(res.result),
|
|
718
|
+
toolCallId: res.id,
|
|
719
|
+
name: message.toolCalls.find((c) => c.id === res.id)?.function.name
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return {
|
|
724
|
+
text: "",
|
|
725
|
+
toolCalls: [],
|
|
726
|
+
toolResults: [],
|
|
727
|
+
finishReason: "length",
|
|
728
|
+
// or 'tool_calls' if strictly ending on tools
|
|
729
|
+
usage: { promptTokens: 0, completionTokens: 0, totalTokens: 0 },
|
|
730
|
+
warnings: ["Max steps reached"]
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
734
|
+
0 && (module.exports = {
|
|
735
|
+
ApiTypes,
|
|
736
|
+
TekimaxClient,
|
|
737
|
+
TekimaxProvider,
|
|
738
|
+
generateText,
|
|
739
|
+
tool
|
|
740
|
+
});
|