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/README.md
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="
|
|
3
|
-
<h1>Tekimax
|
|
4
|
-
<p><strong>
|
|
2
|
+
<img src="https://raw.githubusercontent.com/TEKIMAX/tekimax-ts/main/apps/docs/public/tekimax-logo.png" alt="Tekimax SDK Logo" width="200" />
|
|
3
|
+
<h1>Tekimax TS</h1>
|
|
4
|
+
<p><strong>A type-safe, framework-agnostic AI SDK for building AI-powered apps.</strong></p>
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
## 📖 Overview
|
|
11
|
-
|
|
12
|
-
The **Tekimax TypeScript SDK** provides fully typed interfaces for the Tekimax API. Generated via [Kubb](https://kubb.dev/), it ensures your application stays in sync with the latest API definitions.
|
|
6
|
+
[](https://www.npmjs.com/package/tekimax-ts)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Full TypeScript Support**: strict typing for all API request/response bodies.
|
|
17
|
-
- **Runtime Validation**: Optional Zod schemas for validating data at runtime.
|
|
18
|
-
- **Universal**: Works in Node.js, React/Vite/Next.js, and Cloudflare Workers.
|
|
19
|
-
- **Tree-Shakeable**: Import only what you need.
|
|
9
|
+
</div>
|
|
20
10
|
|
|
21
11
|
## 📦 Installation
|
|
22
12
|
|
|
@@ -26,117 +16,190 @@ npm install tekimax-ts
|
|
|
26
16
|
|
|
27
17
|
## 💻 Usage
|
|
28
18
|
|
|
29
|
-
###
|
|
19
|
+
### Standard Provider Pattern (Recommended)
|
|
20
|
+
|
|
21
|
+
The SDK provides a `TekimaxProvider` that implements the standard `TekimaxAdapter` interface. This allows for interchangeable providers and consistent behavior.
|
|
30
22
|
|
|
31
23
|
```typescript
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
content:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
import { TekimaxProvider } from 'tekimax-ts'
|
|
25
|
+
|
|
26
|
+
const provider = new TekimaxProvider({
|
|
27
|
+
apiKey: process.env.TEKIMAX_API_KEY,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
// Standard Chat
|
|
31
|
+
const result = await provider.chat({
|
|
32
|
+
model: 'gpt-4',
|
|
33
|
+
messages: [{ role: 'user', content: 'Explain quantum computing' }]
|
|
34
|
+
})
|
|
35
|
+
console.log(result.message.content)
|
|
36
|
+
|
|
37
|
+
// Streaming Chat
|
|
38
|
+
for await (const chunk of provider.chatStream({
|
|
39
|
+
model: 'gpt-4',
|
|
40
|
+
messages: [{ role: 'user', content: 'Write a long poem' }]
|
|
41
|
+
})) {
|
|
42
|
+
process.stdout.write(chunk.delta)
|
|
43
|
+
}
|
|
48
44
|
```
|
|
49
45
|
|
|
50
|
-
###
|
|
46
|
+
### Agents & Tools
|
|
47
|
+
|
|
48
|
+
The SDK supports high-level "Agentic" workflows where the model can autonomously call tools.
|
|
51
49
|
|
|
52
50
|
```typescript
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
if (!response.ok) {
|
|
73
|
-
throw new Error(`API Error: ${response.status} ${response.statusText}`);
|
|
51
|
+
import { TekimaxProvider, generateText, tool } from 'tekimax-ts'
|
|
52
|
+
|
|
53
|
+
const provider = new TekimaxProvider({ apiKey: '...' })
|
|
54
|
+
|
|
55
|
+
const weatherTool = tool({
|
|
56
|
+
type: 'function', // optional, defaults to 'function' in helper
|
|
57
|
+
function: {
|
|
58
|
+
name: 'get_weather',
|
|
59
|
+
description: 'Get current weather',
|
|
60
|
+
parameters: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
location: { type: 'string' }
|
|
64
|
+
},
|
|
65
|
+
required: ['location']
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
execute: async ({ location }) => {
|
|
69
|
+
return { temperature: 72, condition: 'Sunny' }
|
|
74
70
|
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const result = await generateText({
|
|
74
|
+
adapter: provider,
|
|
75
|
+
model: 'gpt-4',
|
|
76
|
+
messages: [{ role: 'user', content: 'What is the weather in SF?' }],
|
|
77
|
+
tools: { weather: weatherTool },
|
|
78
|
+
maxSteps: 5 // Allow up to 5 steps (Model -> Tool -> Model loop)
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
console.log(result.text)
|
|
82
|
+
// "The weather in San Francisco is sunny with a temperature of 72°F."
|
|
83
|
+
```
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npm install react
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then import from `tekimax-ts/react`:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { TekimaxProvider } from 'tekimax-ts'
|
|
93
|
+
import { useChat } from 'tekimax-ts/react'
|
|
94
|
+
|
|
95
|
+
const provider = new TekimaxProvider({ apiKey: '...' })
|
|
96
|
+
|
|
97
|
+
function Chat() {
|
|
98
|
+
const { messages, input, handleInputChange, handleSubmit, isLoading, stop } = useChat({
|
|
99
|
+
adapter: provider,
|
|
100
|
+
model: 'gpt-4'
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div>
|
|
105
|
+
{messages.map((m, i) => (
|
|
106
|
+
<div key={i}><strong>{m.role}:</strong> {m.content}</div>
|
|
107
|
+
))}
|
|
108
|
+
|
|
109
|
+
<form onSubmit={handleSubmit}>
|
|
110
|
+
<input value={input} onChange={handleInputChange} disabled={isLoading} />
|
|
111
|
+
<button type="submit" disabled={isLoading}>Send</button>
|
|
112
|
+
<button type="button" onClick={stop} disabled={!isLoading}>Stop</button>
|
|
113
|
+
</form>
|
|
114
|
+
</div>
|
|
115
|
+
)
|
|
81
116
|
}
|
|
82
117
|
```
|
|
83
118
|
|
|
84
|
-
###
|
|
119
|
+
### Low-Level Client
|
|
85
120
|
|
|
86
|
-
You can
|
|
121
|
+
You can still use the direct `TekimaxClient` for raw API access if needed:
|
|
87
122
|
|
|
88
123
|
```typescript
|
|
89
|
-
import {
|
|
124
|
+
import { TekimaxClient } from 'tekimax-ts'
|
|
90
125
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
const client = new TekimaxClient({ apiKey: process.env.TEKIMAX_API_KEY })
|
|
127
|
+
const response = await client.sendMessage('Hello!')
|
|
128
|
+
console.log(response.text)
|
|
129
|
+
```
|
|
95
130
|
|
|
96
|
-
|
|
97
|
-
constructor(private config: TekimaxConfig) {}
|
|
131
|
+
## 🧠 Motivation and Overview
|
|
98
132
|
|
|
99
|
-
|
|
100
|
-
// Implementation...
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
133
|
+
Modern LLM systems have converged on similar primitives: messages, function calls, tool usage, and multimodal inputs but each provider encodes them differently. **Tekimax** standardizes these concepts, enabling:
|
|
104
134
|
|
|
105
|
-
|
|
135
|
+
- **One spec, many providers**: Describe inputs/outputs once; run on OpenAI, Anthropic, Gemini, or local models.
|
|
136
|
+
- **Composable agentic loops**: Unified streaming, tool invocation, and message orchestration.
|
|
137
|
+
- **Easier evaluation and routing**: Compare providers, route requests, and log results through a shared schema.
|
|
138
|
+
- **Blueprints for provider APIs**: Labs and model providers wanting to expose their APIs in a common format can easily do so.
|
|
106
139
|
|
|
107
|
-
|
|
140
|
+
## 🔑 Key Principles
|
|
108
141
|
|
|
109
|
-
###
|
|
142
|
+
### Agentic Loop
|
|
110
143
|
|
|
111
|
-
|
|
144
|
+
All models, to some extent, exhibit agency: the ability to perceive input, reason, act through tools, and reflect on outcomes.
|
|
112
145
|
|
|
113
|
-
|
|
114
|
-
npm run generate
|
|
115
|
-
```
|
|
146
|
+
The **Tekimax Standard** at its core is designed to expose the power of this agentic loop to developers, making requests that allow the model to do multiple things and yield back a result, whether this is developer-hosted tool calls where control is yielded back to the user, or provider-hosted tools where control is held by the model provider until the model signals an exit criteria.
|
|
116
147
|
|
|
117
|
-
|
|
148
|
+
Tekimax defines a common pattern for defining control flow in the agent loop, a set of item definitions for developer-controlled tools, and pattern for defining provider and router-hosted tools.
|
|
118
149
|
|
|
119
|
-
|
|
120
|
-
npm run build
|
|
121
|
-
```
|
|
150
|
+
### Items → Items
|
|
122
151
|
|
|
123
|
-
|
|
152
|
+
Items are the fundamental unit of context in Tekimax: they represent an atomic unit of model output, tool invocation, or reasoning state. Items are bidirectional, they can be provided as inputs to the model, or as outputs from the model.
|
|
124
153
|
|
|
125
|
-
|
|
154
|
+
Each item type has a defined schema that binds it and contains properties specific to its unique purpose.
|
|
126
155
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
Tekimax defines a common set of items supported by a quorum of model providers, and defines how provider-specific item types can be defined.
|
|
157
|
+
|
|
158
|
+
### Semantic Events
|
|
159
|
+
|
|
160
|
+
Streaming is modeled as a series of semantic events, not raw text or object deltas.
|
|
161
|
+
|
|
162
|
+
Events describe meaningful transitions. They are either state transitions (e.g., `response.in_progress`, `response.completed`) or they can represent a delta from a previous state (e.g., `response.output_item.added`, `response.output_text.delta`).
|
|
163
|
+
|
|
164
|
+
Tekimax defines a common set of streaming events supported by a quorum of model providers, and defines how provider-specific streaming events can be defined.
|
|
165
|
+
|
|
166
|
+
### State Machines
|
|
167
|
+
|
|
168
|
+
Objects in Tekimax are state machines, that is, they can live in one of a finite number of states, such as `in_progress`, `completed`, or `failed`. The spec defines the set of valid states for each state machine in the API.
|
|
169
|
+
|
|
170
|
+
## 🛡️ Security & Trust
|
|
171
|
+
|
|
172
|
+
At **Tekimax**, we believe security is a feature, not an afterthought.
|
|
173
|
+
|
|
174
|
+
- **Zero Vulnerabilities**: We enforce a strict **Zero CVE** policy. Our SDK is audited daily.
|
|
175
|
+
- **Minimal Surface Area**: By optimizing our dependency tree, we identified and **removed 159 unnecessary packages**, drastically reducing the attack surface.
|
|
176
|
+
- **Secured by Chainguard**: Our build pipeline and artifacts rely on [Chainguard Images](https://www.chainguard.dev/chainguard-images)—hardened, minimal container images designed to secure the software supply chain. Chainguard images are stripped of shells, package managers, and other unnecessary tools that attackers often exploit.
|
|
177
|
+
|
|
178
|
+
Supply chain attacks on the Node.js/npm ecosystem are increasingly common. By building on Chainguard, we ensure that the Tekimax SDK meets the highest standards of integrity and safety for enterprise and production use.
|
|
179
|
+
|
|
180
|
+
## Get Involved
|
|
181
|
+
|
|
182
|
+
- We welcome issues and pull requests!
|
|
183
|
+
- Participate in **GitHub Discussions**.
|
|
184
|
+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions.
|
|
185
|
+
|
|
186
|
+
## Partners
|
|
187
|
+
|
|
188
|
+
We're looking for Tekimax Partners to join our mission! Partner with us to push the boundaries of Tekimax and build amazing things together.
|
|
189
|
+
|
|
190
|
+
[LET'S CHAT](mailto:info@tekimax.com?subject=Tekimax%20Partnership)
|
|
131
191
|
|
|
132
|
-
|
|
192
|
+
## Code of Conduct
|
|
133
193
|
|
|
134
|
-
|
|
135
|
-
* **Date**: 2026-01-31
|
|
136
|
-
* **Result**: ✅ **0 Vulnerabilities** (Clean)
|
|
137
|
-
* **Base Image**: `cgr.dev/chainguard/node:latest-dev`
|
|
194
|
+
## Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
|
138
195
|
|
|
139
|
-
---
|
|
140
196
|
<div align="center">
|
|
197
|
+
<p>
|
|
198
|
+
<strong>Secured by <a href="https://www.chainguard.dev">Chainguard</a></strong><br>
|
|
199
|
+
Zero-CVE Images for a Safe Supply Chain
|
|
200
|
+
</p>
|
|
201
|
+
<p>
|
|
202
|
+
Built on the <a href="https://openresponses.org">OpenResponses Standard</a> • Generated with <a href="https://kubb.dev">Kubb</a>
|
|
203
|
+
</p>
|
|
141
204
|
<sub>Built with ❤️ by the Tekimax Team</sub>
|
|
142
205
|
</div>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'function';
|
|
5
|
+
function: {
|
|
6
|
+
name: string;
|
|
7
|
+
arguments: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface ToolDefinition {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
parameters?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface Tool<T = any> extends ToolDefinition {
|
|
19
|
+
execute: (args: T) => Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
interface GenerateTextResult {
|
|
22
|
+
text: string;
|
|
23
|
+
toolCalls: Array<ToolCall>;
|
|
24
|
+
toolResults: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
result: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
finishReason: 'stop' | 'length' | 'tool_calls' | 'error' | 'unknown';
|
|
29
|
+
usage: {
|
|
30
|
+
promptTokens: number;
|
|
31
|
+
completionTokens: number;
|
|
32
|
+
totalTokens: number;
|
|
33
|
+
};
|
|
34
|
+
warnings?: Array<string>;
|
|
35
|
+
}
|
|
36
|
+
interface Message {
|
|
37
|
+
role: MessageRole;
|
|
38
|
+
content: string | null;
|
|
39
|
+
toolCalls?: Array<ToolCall>;
|
|
40
|
+
toolCallId?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
}
|
|
43
|
+
interface ChatOptions {
|
|
44
|
+
model: string;
|
|
45
|
+
messages: Array<Message>;
|
|
46
|
+
tools?: Array<ToolDefinition>;
|
|
47
|
+
temperature?: number;
|
|
48
|
+
maxTokens?: number;
|
|
49
|
+
stream?: boolean;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
interface ChatResult {
|
|
53
|
+
message: Message;
|
|
54
|
+
usage?: {
|
|
55
|
+
promptTokens: number;
|
|
56
|
+
completionTokens: number;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface StreamChunk {
|
|
61
|
+
delta: string;
|
|
62
|
+
usage?: {
|
|
63
|
+
promptTokens: number;
|
|
64
|
+
completionTokens: number;
|
|
65
|
+
totalTokens: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface TekimaxAdapter {
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Send a chat completion request.
|
|
73
|
+
*/
|
|
74
|
+
chat: (options: ChatOptions) => Promise<ChatResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Stream a chat completion.
|
|
77
|
+
*/
|
|
78
|
+
chatStream: (options: ChatOptions) => AsyncIterable<StreamChunk>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { ChatOptions as C, GenerateTextResult as G, Message as M, StreamChunk as S, TekimaxAdapter as T, ChatResult as a, Tool as b, MessageRole as c, ToolCall as d, ToolDefinition as e };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'function';
|
|
5
|
+
function: {
|
|
6
|
+
name: string;
|
|
7
|
+
arguments: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface ToolDefinition {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
parameters?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface Tool<T = any> extends ToolDefinition {
|
|
19
|
+
execute: (args: T) => Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
interface GenerateTextResult {
|
|
22
|
+
text: string;
|
|
23
|
+
toolCalls: Array<ToolCall>;
|
|
24
|
+
toolResults: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
result: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
finishReason: 'stop' | 'length' | 'tool_calls' | 'error' | 'unknown';
|
|
29
|
+
usage: {
|
|
30
|
+
promptTokens: number;
|
|
31
|
+
completionTokens: number;
|
|
32
|
+
totalTokens: number;
|
|
33
|
+
};
|
|
34
|
+
warnings?: Array<string>;
|
|
35
|
+
}
|
|
36
|
+
interface Message {
|
|
37
|
+
role: MessageRole;
|
|
38
|
+
content: string | null;
|
|
39
|
+
toolCalls?: Array<ToolCall>;
|
|
40
|
+
toolCallId?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
}
|
|
43
|
+
interface ChatOptions {
|
|
44
|
+
model: string;
|
|
45
|
+
messages: Array<Message>;
|
|
46
|
+
tools?: Array<ToolDefinition>;
|
|
47
|
+
temperature?: number;
|
|
48
|
+
maxTokens?: number;
|
|
49
|
+
stream?: boolean;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
interface ChatResult {
|
|
53
|
+
message: Message;
|
|
54
|
+
usage?: {
|
|
55
|
+
promptTokens: number;
|
|
56
|
+
completionTokens: number;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface StreamChunk {
|
|
61
|
+
delta: string;
|
|
62
|
+
usage?: {
|
|
63
|
+
promptTokens: number;
|
|
64
|
+
completionTokens: number;
|
|
65
|
+
totalTokens: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface TekimaxAdapter {
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Send a chat completion request.
|
|
73
|
+
*/
|
|
74
|
+
chat: (options: ChatOptions) => Promise<ChatResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Stream a chat completion.
|
|
77
|
+
*/
|
|
78
|
+
chatStream: (options: ChatOptions) => AsyncIterable<StreamChunk>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { ChatOptions as C, GenerateTextResult as G, Message as M, StreamChunk as S, TekimaxAdapter as T, ChatResult as a, Tool as b, MessageRole as c, ToolCall as d, ToolDefinition as e };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'function';
|
|
5
|
+
function: {
|
|
6
|
+
name: string;
|
|
7
|
+
arguments: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface ToolDefinition {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
parameters?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface Tool<T = any> extends ToolDefinition {
|
|
19
|
+
execute: (args: T) => Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
interface GenerateTextResult {
|
|
22
|
+
text: string;
|
|
23
|
+
toolCalls: Array<ToolCall>;
|
|
24
|
+
toolResults: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
result: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
finishReason: 'stop' | 'length' | 'tool_calls' | 'error' | 'unknown';
|
|
29
|
+
usage: {
|
|
30
|
+
promptTokens: number;
|
|
31
|
+
completionTokens: number;
|
|
32
|
+
totalTokens: number;
|
|
33
|
+
};
|
|
34
|
+
warnings?: string[];
|
|
35
|
+
}
|
|
36
|
+
interface Message {
|
|
37
|
+
role: MessageRole;
|
|
38
|
+
content: string | null;
|
|
39
|
+
toolCalls?: Array<ToolCall>;
|
|
40
|
+
toolCallId?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
}
|
|
43
|
+
interface ChatOptions {
|
|
44
|
+
model: string;
|
|
45
|
+
messages: Array<Message>;
|
|
46
|
+
tools?: Array<ToolDefinition>;
|
|
47
|
+
temperature?: number;
|
|
48
|
+
maxTokens?: number;
|
|
49
|
+
stream?: boolean;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
interface ChatResult {
|
|
53
|
+
message: Message;
|
|
54
|
+
usage?: {
|
|
55
|
+
promptTokens: number;
|
|
56
|
+
completionTokens: number;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface StreamChunk {
|
|
61
|
+
delta: string;
|
|
62
|
+
usage?: {
|
|
63
|
+
promptTokens: number;
|
|
64
|
+
completionTokens: number;
|
|
65
|
+
totalTokens: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface TekimaxAdapter {
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Send a chat completion request.
|
|
73
|
+
*/
|
|
74
|
+
chat: (options: ChatOptions) => Promise<ChatResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Stream a chat completion.
|
|
77
|
+
*/
|
|
78
|
+
chatStream: (options: ChatOptions) => AsyncIterable<StreamChunk>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { ChatOptions as C, GenerateTextResult as G, Message as M, StreamChunk as S, TekimaxAdapter as T, ChatResult as a, MessageRole as b, Tool as c, ToolCall as d, ToolDefinition as e };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'function';
|
|
5
|
+
function: {
|
|
6
|
+
name: string;
|
|
7
|
+
arguments: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface ToolDefinition {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
parameters?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface Tool<T = any> extends ToolDefinition {
|
|
19
|
+
execute: (args: T) => Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
interface GenerateTextResult {
|
|
22
|
+
text: string;
|
|
23
|
+
toolCalls: Array<ToolCall>;
|
|
24
|
+
toolResults: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
result: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
finishReason: 'stop' | 'length' | 'tool_calls' | 'error' | 'unknown';
|
|
29
|
+
usage: {
|
|
30
|
+
promptTokens: number;
|
|
31
|
+
completionTokens: number;
|
|
32
|
+
totalTokens: number;
|
|
33
|
+
};
|
|
34
|
+
warnings?: string[];
|
|
35
|
+
}
|
|
36
|
+
interface Message {
|
|
37
|
+
role: MessageRole;
|
|
38
|
+
content: string | null;
|
|
39
|
+
toolCalls?: Array<ToolCall>;
|
|
40
|
+
toolCallId?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
}
|
|
43
|
+
interface ChatOptions {
|
|
44
|
+
model: string;
|
|
45
|
+
messages: Array<Message>;
|
|
46
|
+
tools?: Array<ToolDefinition>;
|
|
47
|
+
temperature?: number;
|
|
48
|
+
maxTokens?: number;
|
|
49
|
+
stream?: boolean;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
interface ChatResult {
|
|
53
|
+
message: Message;
|
|
54
|
+
usage?: {
|
|
55
|
+
promptTokens: number;
|
|
56
|
+
completionTokens: number;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface StreamChunk {
|
|
61
|
+
delta: string;
|
|
62
|
+
usage?: {
|
|
63
|
+
promptTokens: number;
|
|
64
|
+
completionTokens: number;
|
|
65
|
+
totalTokens: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface TekimaxAdapter {
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Send a chat completion request.
|
|
73
|
+
*/
|
|
74
|
+
chat: (options: ChatOptions) => Promise<ChatResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Stream a chat completion.
|
|
77
|
+
*/
|
|
78
|
+
chatStream: (options: ChatOptions) => AsyncIterable<StreamChunk>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { ChatOptions as C, GenerateTextResult as G, Message as M, StreamChunk as S, TekimaxAdapter as T, ChatResult as a, MessageRole as b, Tool as c, ToolCall as d, ToolDefinition as e };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
type MessageRole = 'system' | 'user' | 'assistant';
|
|
2
|
+
interface Message {
|
|
3
|
+
role: MessageRole;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
interface ChatOptions {
|
|
7
|
+
model: string;
|
|
8
|
+
messages: Array<Message>;
|
|
9
|
+
temperature?: number;
|
|
10
|
+
maxTokens?: number;
|
|
11
|
+
stream?: boolean;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
interface ChatResult {
|
|
15
|
+
message: Message;
|
|
16
|
+
usage?: {
|
|
17
|
+
promptTokens: number;
|
|
18
|
+
completionTokens: number;
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface StreamChunk {
|
|
23
|
+
delta: string;
|
|
24
|
+
usage?: {
|
|
25
|
+
promptTokens: number;
|
|
26
|
+
completionTokens: number;
|
|
27
|
+
totalTokens: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface TekimaxAdapter {
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* Send a chat completion request.
|
|
35
|
+
*/
|
|
36
|
+
chat: (options: ChatOptions) => Promise<ChatResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Stream a chat completion.
|
|
39
|
+
*/
|
|
40
|
+
chatStream: (options: ChatOptions) => AsyncIterable<StreamChunk>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type { ChatOptions as C, Message as M, StreamChunk as S, TekimaxAdapter as T, ChatResult as a, MessageRole as b };
|