tekimax-ts 0.1.1 → 0.1.3
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/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +102 -1
- package/dist/index.mjs +100 -0
- package/package.json +2 -2
- package/src/client.ts +126 -0
- package/src/index.ts +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -31633,4 +31633,16 @@ declare const userMessageItemParamSchema: z.ZodObject<{
|
|
|
31633
31633
|
|
|
31634
31634
|
declare const verbosityEnumSchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
31635
31635
|
|
|
31636
|
-
export { type AllowedToolChoice, type AllowedToolChoiceTypeEnumKey, type AllowedToolsParam, type AllowedToolsParamTypeEnumKey, type Annotation, type AssistantMessageItemParam, type AssistantMessageItemParamRoleEnumKey, type AssistantMessageItemParamTypeEnumKey, type CreateResponseBody, type Createresponse200, type CreateresponseMutation, type CreateresponseMutationRequest, type CreateresponseMutationResponse, type DetailEnum, type DetailEnumEnumKey, type DeveloperMessageItemParam, type DeveloperMessageItemParamRoleEnumKey, type DeveloperMessageItemParamTypeEnumKey, type EmptyModelParam, type Error, type ErrorPayload, type ErrorStreamingEvent, type ErrorStreamingEventTypeEnumKey, type FunctionCall, type FunctionCallItemParam, type FunctionCallItemParamTypeEnumKey, type FunctionCallItemStatus, type FunctionCallItemStatusEnumKey, type FunctionCallOutput, type FunctionCallOutputItemParam, type FunctionCallOutputItemParamTypeEnumKey, type FunctionCallOutputStatusEnum, type FunctionCallOutputStatusEnumEnumKey, type FunctionCallOutputTypeEnumKey, type FunctionCallStatus, type FunctionCallStatusEnumKey, type FunctionCallTypeEnumKey, type FunctionTool, type FunctionToolChoice, type FunctionToolChoiceTypeEnumKey, type FunctionToolParam, type FunctionToolParamTypeEnumKey, type FunctionToolTypeEnumKey, type ImageDetail, type ImageDetailEnumKey, type IncludeEnum, type IncludeEnumEnumKey, type IncompleteDetails, type InputFileContent, type InputFileContentParam, type InputFileContentParamTypeEnumKey, type InputFileContentTypeEnumKey, type InputImageContent, type InputImageContentParamAutoParam, type InputImageContentParamAutoParamTypeEnumKey, type InputImageContentTypeEnumKey, type InputTextContent, type InputTextContentParam, type InputTextContentParamTypeEnumKey, type InputTextContentTypeEnumKey, type InputTokensDetails, type InputVideoContent, type InputVideoContentTypeEnumKey, type ItemField, type ItemParam, type ItemReferenceParam, type ItemReferenceParamTypeEnumKey, type JsonObjectResponseFormat, type JsonObjectResponseFormatTypeEnumKey, type JsonSchemaResponseFormat, type JsonSchemaResponseFormatParam, type JsonSchemaResponseFormatParamTypeEnumKey, type JsonSchemaResponseFormatTypeEnumKey, type LogProb, type Message, type MessageRole, type MessageRoleEnumKey, type MessageStatus, type MessageStatusEnumKey, type MessageTypeEnumKey, type MetadataParam, type OutputTextContent, type OutputTextContentParam, type OutputTextContentParamTypeEnumKey, type OutputTextContentTypeEnumKey, type OutputTokensDetails, type Reasoning, type ReasoningBody, type ReasoningBodyTypeEnumKey, type ReasoningEffortEnum, type ReasoningEffortEnumEnumKey, type ReasoningItemParam, type ReasoningItemParamTypeEnumKey, type ReasoningParam, type ReasoningSummaryContentParam, type ReasoningSummaryContentParamTypeEnumKey, type ReasoningSummaryEnum, type ReasoningSummaryEnumEnumKey, type ReasoningTextContent, type ReasoningTextContentTypeEnumKey, type RefusalContent, type RefusalContentParam, type RefusalContentParamTypeEnumKey, type RefusalContentTypeEnumKey, type ResponseCompletedStreamingEvent, type ResponseCompletedStreamingEventTypeEnumKey, type ResponseContentPartAddedStreamingEvent, type ResponseContentPartAddedStreamingEventTypeEnumKey, type ResponseContentPartDoneStreamingEvent, type ResponseContentPartDoneStreamingEventTypeEnumKey, type ResponseCreatedStreamingEvent, type ResponseCreatedStreamingEventTypeEnumKey, type ResponseFailedStreamingEvent, type ResponseFailedStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDeltaStreamingEvent, type ResponseFunctionCallArgumentsDeltaStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDoneStreamingEvent, type ResponseFunctionCallArgumentsDoneStreamingEventTypeEnumKey, type ResponseInProgressStreamingEvent, type ResponseInProgressStreamingEventTypeEnumKey, type ResponseIncompleteStreamingEvent, type ResponseIncompleteStreamingEventTypeEnumKey, type ResponseOutputItemAddedStreamingEvent, type ResponseOutputItemAddedStreamingEventTypeEnumKey, type ResponseOutputItemDoneStreamingEvent, type ResponseOutputItemDoneStreamingEventTypeEnumKey, type ResponseOutputTextAnnotationAddedStreamingEvent, type ResponseOutputTextAnnotationAddedStreamingEventTypeEnumKey, type ResponseOutputTextDeltaStreamingEvent, type ResponseOutputTextDeltaStreamingEventTypeEnumKey, type ResponseOutputTextDoneStreamingEvent, type ResponseOutputTextDoneStreamingEventTypeEnumKey, type ResponseQueuedStreamingEvent, type ResponseQueuedStreamingEventTypeEnumKey, type ResponseReasoningDeltaStreamingEvent, type ResponseReasoningDeltaStreamingEventTypeEnumKey, type ResponseReasoningDoneStreamingEvent, type ResponseReasoningDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryDeltaStreamingEvent, type ResponseReasoningSummaryDeltaStreamingEventTypeEnumKey, type ResponseReasoningSummaryDoneStreamingEvent, type ResponseReasoningSummaryDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartAddedStreamingEvent, type ResponseReasoningSummaryPartAddedStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartDoneStreamingEvent, type ResponseReasoningSummaryPartDoneStreamingEventTypeEnumKey, type ResponseRefusalDeltaStreamingEvent, type ResponseRefusalDeltaStreamingEventTypeEnumKey, type ResponseRefusalDoneStreamingEvent, type ResponseRefusalDoneStreamingEventTypeEnumKey, type ResponseResource, type ResponseResourceObjectEnumKey, type ResponsesToolParam, type ServiceTierEnum, type ServiceTierEnumEnumKey, type SpecificFunctionParam, type SpecificFunctionParamTypeEnumKey, type SpecificToolChoiceParam, type StreamOptionsParam, type SummaryTextContent, type SummaryTextContentTypeEnumKey, type SystemMessageItemParam, type SystemMessageItemParamRoleEnumKey, type SystemMessageItemParamTypeEnumKey, type TextContent, type TextContentTypeEnumKey, type TextField, type TextFormatParam, type TextParam, type TextResponseFormat, type TextResponseFormatTypeEnumKey, type Tool, type ToolChoiceParam, type ToolChoiceValueEnum, type ToolChoiceValueEnumEnumKey, type TopLogProb, type TruncationEnum, type TruncationEnumEnumKey, type UrlCitationBody, type UrlCitationBodyTypeEnumKey, type UrlCitationParam, type UrlCitationParamTypeEnumKey, type Usage, type UserMessageItemParam, type UserMessageItemParamRoleEnumKey, type UserMessageItemParamTypeEnumKey, type VerbosityEnum, type VerbosityEnumEnumKey, allowedToolChoiceSchema, allowedToolChoiceTypeEnum, allowedToolsParamSchema, allowedToolsParamTypeEnum, annotationSchema, assistantMessageItemParamRoleEnum, assistantMessageItemParamSchema, assistantMessageItemParamTypeEnum, createResponseBodySchema, createresponse200Schema, createresponseMutationRequestSchema, createresponseMutationResponseSchema, detailEnumEnum, detailEnumSchema, developerMessageItemParamRoleEnum, developerMessageItemParamSchema, developerMessageItemParamTypeEnum, emptyModelParamSchema, errorPayloadSchema, errorSchema, errorStreamingEventSchema, errorStreamingEventTypeEnum, functionCallItemParamSchema, functionCallItemParamTypeEnum, functionCallItemStatusEnum, functionCallItemStatusSchema, functionCallOutputItemParamSchema, functionCallOutputItemParamTypeEnum, functionCallOutputSchema, functionCallOutputStatusEnumEnum, functionCallOutputStatusEnumSchema, functionCallOutputTypeEnum, functionCallSchema, functionCallStatusEnum, functionCallStatusSchema, functionCallTypeEnum, functionToolChoiceSchema, functionToolChoiceTypeEnum, functionToolParamSchema, functionToolParamTypeEnum, functionToolSchema, functionToolTypeEnum, imageDetailEnum, imageDetailSchema, includeEnumEnum, includeEnumSchema, incompleteDetailsSchema, inputFileContentParamSchema, inputFileContentParamTypeEnum, inputFileContentSchema, inputFileContentTypeEnum, inputImageContentParamAutoParamSchema, inputImageContentParamAutoParamTypeEnum, inputImageContentSchema, inputImageContentTypeEnum, inputTextContentParamSchema, inputTextContentParamTypeEnum, inputTextContentSchema, inputTextContentTypeEnum, inputTokensDetailsSchema, inputVideoContentSchema, inputVideoContentTypeEnum, itemFieldSchema, itemParamSchema, itemReferenceParamSchema, itemReferenceParamTypeEnum, jsonObjectResponseFormatSchema, jsonObjectResponseFormatTypeEnum, jsonSchemaResponseFormatParamSchema, jsonSchemaResponseFormatParamTypeEnum, jsonSchemaResponseFormatSchema, jsonSchemaResponseFormatTypeEnum, logProbSchema, messageRoleEnum, messageRoleSchema, messageSchema, messageStatusEnum, messageStatusSchema, messageTypeEnum, metadataParamSchema, outputTextContentParamSchema, outputTextContentParamTypeEnum, outputTextContentSchema, outputTextContentTypeEnum, outputTokensDetailsSchema, reasoningBodySchema, reasoningBodyTypeEnum, reasoningEffortEnumEnum, reasoningEffortEnumSchema, reasoningItemParamSchema, reasoningItemParamTypeEnum, reasoningParamSchema, reasoningSchema, reasoningSummaryContentParamSchema, reasoningSummaryContentParamTypeEnum, reasoningSummaryEnumEnum, reasoningSummaryEnumSchema, reasoningTextContentSchema, reasoningTextContentTypeEnum, refusalContentParamSchema, refusalContentParamTypeEnum, refusalContentSchema, refusalContentTypeEnum, responseCompletedStreamingEventSchema, responseCompletedStreamingEventTypeEnum, responseContentPartAddedStreamingEventSchema, responseContentPartAddedStreamingEventTypeEnum, responseContentPartDoneStreamingEventSchema, responseContentPartDoneStreamingEventTypeEnum, responseCreatedStreamingEventSchema, responseCreatedStreamingEventTypeEnum, responseFailedStreamingEventSchema, responseFailedStreamingEventTypeEnum, responseFunctionCallArgumentsDeltaStreamingEventSchema, responseFunctionCallArgumentsDeltaStreamingEventTypeEnum, responseFunctionCallArgumentsDoneStreamingEventSchema, responseFunctionCallArgumentsDoneStreamingEventTypeEnum, responseInProgressStreamingEventSchema, responseInProgressStreamingEventTypeEnum, responseIncompleteStreamingEventSchema, responseIncompleteStreamingEventTypeEnum, responseOutputItemAddedStreamingEventSchema, responseOutputItemAddedStreamingEventTypeEnum, responseOutputItemDoneStreamingEventSchema, responseOutputItemDoneStreamingEventTypeEnum, responseOutputTextAnnotationAddedStreamingEventSchema, responseOutputTextAnnotationAddedStreamingEventTypeEnum, responseOutputTextDeltaStreamingEventSchema, responseOutputTextDeltaStreamingEventTypeEnum, responseOutputTextDoneStreamingEventSchema, responseOutputTextDoneStreamingEventTypeEnum, responseQueuedStreamingEventSchema, responseQueuedStreamingEventTypeEnum, responseReasoningDeltaStreamingEventSchema, responseReasoningDeltaStreamingEventTypeEnum, responseReasoningDoneStreamingEventSchema, responseReasoningDoneStreamingEventTypeEnum, responseReasoningSummaryDeltaStreamingEventSchema, responseReasoningSummaryDeltaStreamingEventTypeEnum, responseReasoningSummaryDoneStreamingEventSchema, responseReasoningSummaryDoneStreamingEventTypeEnum, responseReasoningSummaryPartAddedStreamingEventSchema, responseReasoningSummaryPartAddedStreamingEventTypeEnum, responseReasoningSummaryPartDoneStreamingEventSchema, responseReasoningSummaryPartDoneStreamingEventTypeEnum, responseRefusalDeltaStreamingEventSchema, responseRefusalDeltaStreamingEventTypeEnum, responseRefusalDoneStreamingEventSchema, responseRefusalDoneStreamingEventTypeEnum, responseResourceObjectEnum, responseResourceSchema, responsesToolParamSchema, serviceTierEnumEnum, serviceTierEnumSchema, specificFunctionParamSchema, specificFunctionParamTypeEnum, specificToolChoiceParamSchema, streamOptionsParamSchema, summaryTextContentSchema, summaryTextContentTypeEnum, systemMessageItemParamRoleEnum, systemMessageItemParamSchema, systemMessageItemParamTypeEnum, textContentSchema, textContentTypeEnum, textFieldSchema, textFormatParamSchema, textParamSchema, textResponseFormatSchema, textResponseFormatTypeEnum, toolChoiceParamSchema, toolChoiceValueEnumEnum, toolChoiceValueEnumSchema, toolSchema, topLogProbSchema, truncationEnumEnum, truncationEnumSchema, urlCitationBodySchema, urlCitationBodyTypeEnum, urlCitationParamSchema, urlCitationParamTypeEnum, usageSchema, userMessageItemParamRoleEnum, userMessageItemParamSchema, userMessageItemParamTypeEnum, verbosityEnumEnum, verbosityEnumSchema };
|
|
31636
|
+
declare class TekimaxClient {
|
|
31637
|
+
private baseUrl;
|
|
31638
|
+
private headers;
|
|
31639
|
+
constructor(options?: {
|
|
31640
|
+
baseUrl?: string;
|
|
31641
|
+
apiKey?: string;
|
|
31642
|
+
});
|
|
31643
|
+
private request;
|
|
31644
|
+
createSession(body: CreateResponseBody): Promise<ResponseResource>;
|
|
31645
|
+
sendMessage(body: CreateResponseBody): Promise<ResponseResource>;
|
|
31646
|
+
}
|
|
31647
|
+
|
|
31648
|
+
export { type AllowedToolChoice, type AllowedToolChoiceTypeEnumKey, type AllowedToolsParam, type AllowedToolsParamTypeEnumKey, type Annotation, type AssistantMessageItemParam, type AssistantMessageItemParamRoleEnumKey, type AssistantMessageItemParamTypeEnumKey, type CreateResponseBody, type Createresponse200, type CreateresponseMutation, type CreateresponseMutationRequest, type CreateresponseMutationResponse, type DetailEnum, type DetailEnumEnumKey, type DeveloperMessageItemParam, type DeveloperMessageItemParamRoleEnumKey, type DeveloperMessageItemParamTypeEnumKey, type EmptyModelParam, type Error, type ErrorPayload, type ErrorStreamingEvent, type ErrorStreamingEventTypeEnumKey, type FunctionCall, type FunctionCallItemParam, type FunctionCallItemParamTypeEnumKey, type FunctionCallItemStatus, type FunctionCallItemStatusEnumKey, type FunctionCallOutput, type FunctionCallOutputItemParam, type FunctionCallOutputItemParamTypeEnumKey, type FunctionCallOutputStatusEnum, type FunctionCallOutputStatusEnumEnumKey, type FunctionCallOutputTypeEnumKey, type FunctionCallStatus, type FunctionCallStatusEnumKey, type FunctionCallTypeEnumKey, type FunctionTool, type FunctionToolChoice, type FunctionToolChoiceTypeEnumKey, type FunctionToolParam, type FunctionToolParamTypeEnumKey, type FunctionToolTypeEnumKey, type ImageDetail, type ImageDetailEnumKey, type IncludeEnum, type IncludeEnumEnumKey, type IncompleteDetails, type InputFileContent, type InputFileContentParam, type InputFileContentParamTypeEnumKey, type InputFileContentTypeEnumKey, type InputImageContent, type InputImageContentParamAutoParam, type InputImageContentParamAutoParamTypeEnumKey, type InputImageContentTypeEnumKey, type InputTextContent, type InputTextContentParam, type InputTextContentParamTypeEnumKey, type InputTextContentTypeEnumKey, type InputTokensDetails, type InputVideoContent, type InputVideoContentTypeEnumKey, type ItemField, type ItemParam, type ItemReferenceParam, type ItemReferenceParamTypeEnumKey, type JsonObjectResponseFormat, type JsonObjectResponseFormatTypeEnumKey, type JsonSchemaResponseFormat, type JsonSchemaResponseFormatParam, type JsonSchemaResponseFormatParamTypeEnumKey, type JsonSchemaResponseFormatTypeEnumKey, type LogProb, type Message, type MessageRole, type MessageRoleEnumKey, type MessageStatus, type MessageStatusEnumKey, type MessageTypeEnumKey, type MetadataParam, type OutputTextContent, type OutputTextContentParam, type OutputTextContentParamTypeEnumKey, type OutputTextContentTypeEnumKey, type OutputTokensDetails, type Reasoning, type ReasoningBody, type ReasoningBodyTypeEnumKey, type ReasoningEffortEnum, type ReasoningEffortEnumEnumKey, type ReasoningItemParam, type ReasoningItemParamTypeEnumKey, type ReasoningParam, type ReasoningSummaryContentParam, type ReasoningSummaryContentParamTypeEnumKey, type ReasoningSummaryEnum, type ReasoningSummaryEnumEnumKey, type ReasoningTextContent, type ReasoningTextContentTypeEnumKey, type RefusalContent, type RefusalContentParam, type RefusalContentParamTypeEnumKey, type RefusalContentTypeEnumKey, type ResponseCompletedStreamingEvent, type ResponseCompletedStreamingEventTypeEnumKey, type ResponseContentPartAddedStreamingEvent, type ResponseContentPartAddedStreamingEventTypeEnumKey, type ResponseContentPartDoneStreamingEvent, type ResponseContentPartDoneStreamingEventTypeEnumKey, type ResponseCreatedStreamingEvent, type ResponseCreatedStreamingEventTypeEnumKey, type ResponseFailedStreamingEvent, type ResponseFailedStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDeltaStreamingEvent, type ResponseFunctionCallArgumentsDeltaStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDoneStreamingEvent, type ResponseFunctionCallArgumentsDoneStreamingEventTypeEnumKey, type ResponseInProgressStreamingEvent, type ResponseInProgressStreamingEventTypeEnumKey, type ResponseIncompleteStreamingEvent, type ResponseIncompleteStreamingEventTypeEnumKey, type ResponseOutputItemAddedStreamingEvent, type ResponseOutputItemAddedStreamingEventTypeEnumKey, type ResponseOutputItemDoneStreamingEvent, type ResponseOutputItemDoneStreamingEventTypeEnumKey, type ResponseOutputTextAnnotationAddedStreamingEvent, type ResponseOutputTextAnnotationAddedStreamingEventTypeEnumKey, type ResponseOutputTextDeltaStreamingEvent, type ResponseOutputTextDeltaStreamingEventTypeEnumKey, type ResponseOutputTextDoneStreamingEvent, type ResponseOutputTextDoneStreamingEventTypeEnumKey, type ResponseQueuedStreamingEvent, type ResponseQueuedStreamingEventTypeEnumKey, type ResponseReasoningDeltaStreamingEvent, type ResponseReasoningDeltaStreamingEventTypeEnumKey, type ResponseReasoningDoneStreamingEvent, type ResponseReasoningDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryDeltaStreamingEvent, type ResponseReasoningSummaryDeltaStreamingEventTypeEnumKey, type ResponseReasoningSummaryDoneStreamingEvent, type ResponseReasoningSummaryDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartAddedStreamingEvent, type ResponseReasoningSummaryPartAddedStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartDoneStreamingEvent, type ResponseReasoningSummaryPartDoneStreamingEventTypeEnumKey, type ResponseRefusalDeltaStreamingEvent, type ResponseRefusalDeltaStreamingEventTypeEnumKey, type ResponseRefusalDoneStreamingEvent, type ResponseRefusalDoneStreamingEventTypeEnumKey, type ResponseResource, type ResponseResourceObjectEnumKey, type ResponsesToolParam, type ServiceTierEnum, type ServiceTierEnumEnumKey, type SpecificFunctionParam, type SpecificFunctionParamTypeEnumKey, type SpecificToolChoiceParam, type StreamOptionsParam, type SummaryTextContent, type SummaryTextContentTypeEnumKey, type SystemMessageItemParam, type SystemMessageItemParamRoleEnumKey, type SystemMessageItemParamTypeEnumKey, TekimaxClient, type TextContent, type TextContentTypeEnumKey, type TextField, type TextFormatParam, type TextParam, type TextResponseFormat, type TextResponseFormatTypeEnumKey, type Tool, type ToolChoiceParam, type ToolChoiceValueEnum, type ToolChoiceValueEnumEnumKey, type TopLogProb, type TruncationEnum, type TruncationEnumEnumKey, type UrlCitationBody, type UrlCitationBodyTypeEnumKey, type UrlCitationParam, type UrlCitationParamTypeEnumKey, type Usage, type UserMessageItemParam, type UserMessageItemParamRoleEnumKey, type UserMessageItemParamTypeEnumKey, type VerbosityEnum, type VerbosityEnumEnumKey, allowedToolChoiceSchema, allowedToolChoiceTypeEnum, allowedToolsParamSchema, allowedToolsParamTypeEnum, annotationSchema, assistantMessageItemParamRoleEnum, assistantMessageItemParamSchema, assistantMessageItemParamTypeEnum, createResponseBodySchema, createresponse200Schema, createresponseMutationRequestSchema, createresponseMutationResponseSchema, detailEnumEnum, detailEnumSchema, developerMessageItemParamRoleEnum, developerMessageItemParamSchema, developerMessageItemParamTypeEnum, emptyModelParamSchema, errorPayloadSchema, errorSchema, errorStreamingEventSchema, errorStreamingEventTypeEnum, functionCallItemParamSchema, functionCallItemParamTypeEnum, functionCallItemStatusEnum, functionCallItemStatusSchema, functionCallOutputItemParamSchema, functionCallOutputItemParamTypeEnum, functionCallOutputSchema, functionCallOutputStatusEnumEnum, functionCallOutputStatusEnumSchema, functionCallOutputTypeEnum, functionCallSchema, functionCallStatusEnum, functionCallStatusSchema, functionCallTypeEnum, functionToolChoiceSchema, functionToolChoiceTypeEnum, functionToolParamSchema, functionToolParamTypeEnum, functionToolSchema, functionToolTypeEnum, imageDetailEnum, imageDetailSchema, includeEnumEnum, includeEnumSchema, incompleteDetailsSchema, inputFileContentParamSchema, inputFileContentParamTypeEnum, inputFileContentSchema, inputFileContentTypeEnum, inputImageContentParamAutoParamSchema, inputImageContentParamAutoParamTypeEnum, inputImageContentSchema, inputImageContentTypeEnum, inputTextContentParamSchema, inputTextContentParamTypeEnum, inputTextContentSchema, inputTextContentTypeEnum, inputTokensDetailsSchema, inputVideoContentSchema, inputVideoContentTypeEnum, itemFieldSchema, itemParamSchema, itemReferenceParamSchema, itemReferenceParamTypeEnum, jsonObjectResponseFormatSchema, jsonObjectResponseFormatTypeEnum, jsonSchemaResponseFormatParamSchema, jsonSchemaResponseFormatParamTypeEnum, jsonSchemaResponseFormatSchema, jsonSchemaResponseFormatTypeEnum, logProbSchema, messageRoleEnum, messageRoleSchema, messageSchema, messageStatusEnum, messageStatusSchema, messageTypeEnum, metadataParamSchema, outputTextContentParamSchema, outputTextContentParamTypeEnum, outputTextContentSchema, outputTextContentTypeEnum, outputTokensDetailsSchema, reasoningBodySchema, reasoningBodyTypeEnum, reasoningEffortEnumEnum, reasoningEffortEnumSchema, reasoningItemParamSchema, reasoningItemParamTypeEnum, reasoningParamSchema, reasoningSchema, reasoningSummaryContentParamSchema, reasoningSummaryContentParamTypeEnum, reasoningSummaryEnumEnum, reasoningSummaryEnumSchema, reasoningTextContentSchema, reasoningTextContentTypeEnum, refusalContentParamSchema, refusalContentParamTypeEnum, refusalContentSchema, refusalContentTypeEnum, responseCompletedStreamingEventSchema, responseCompletedStreamingEventTypeEnum, responseContentPartAddedStreamingEventSchema, responseContentPartAddedStreamingEventTypeEnum, responseContentPartDoneStreamingEventSchema, responseContentPartDoneStreamingEventTypeEnum, responseCreatedStreamingEventSchema, responseCreatedStreamingEventTypeEnum, responseFailedStreamingEventSchema, responseFailedStreamingEventTypeEnum, responseFunctionCallArgumentsDeltaStreamingEventSchema, responseFunctionCallArgumentsDeltaStreamingEventTypeEnum, responseFunctionCallArgumentsDoneStreamingEventSchema, responseFunctionCallArgumentsDoneStreamingEventTypeEnum, responseInProgressStreamingEventSchema, responseInProgressStreamingEventTypeEnum, responseIncompleteStreamingEventSchema, responseIncompleteStreamingEventTypeEnum, responseOutputItemAddedStreamingEventSchema, responseOutputItemAddedStreamingEventTypeEnum, responseOutputItemDoneStreamingEventSchema, responseOutputItemDoneStreamingEventTypeEnum, responseOutputTextAnnotationAddedStreamingEventSchema, responseOutputTextAnnotationAddedStreamingEventTypeEnum, responseOutputTextDeltaStreamingEventSchema, responseOutputTextDeltaStreamingEventTypeEnum, responseOutputTextDoneStreamingEventSchema, responseOutputTextDoneStreamingEventTypeEnum, responseQueuedStreamingEventSchema, responseQueuedStreamingEventTypeEnum, responseReasoningDeltaStreamingEventSchema, responseReasoningDeltaStreamingEventTypeEnum, responseReasoningDoneStreamingEventSchema, responseReasoningDoneStreamingEventTypeEnum, responseReasoningSummaryDeltaStreamingEventSchema, responseReasoningSummaryDeltaStreamingEventTypeEnum, responseReasoningSummaryDoneStreamingEventSchema, responseReasoningSummaryDoneStreamingEventTypeEnum, responseReasoningSummaryPartAddedStreamingEventSchema, responseReasoningSummaryPartAddedStreamingEventTypeEnum, responseReasoningSummaryPartDoneStreamingEventSchema, responseReasoningSummaryPartDoneStreamingEventTypeEnum, responseRefusalDeltaStreamingEventSchema, responseRefusalDeltaStreamingEventTypeEnum, responseRefusalDoneStreamingEventSchema, responseRefusalDoneStreamingEventTypeEnum, responseResourceObjectEnum, responseResourceSchema, responsesToolParamSchema, serviceTierEnumEnum, serviceTierEnumSchema, specificFunctionParamSchema, specificFunctionParamTypeEnum, specificToolChoiceParamSchema, streamOptionsParamSchema, summaryTextContentSchema, summaryTextContentTypeEnum, systemMessageItemParamRoleEnum, systemMessageItemParamSchema, systemMessageItemParamTypeEnum, textContentSchema, textContentTypeEnum, textFieldSchema, textFormatParamSchema, textParamSchema, textResponseFormatSchema, textResponseFormatTypeEnum, toolChoiceParamSchema, toolChoiceValueEnumEnum, toolChoiceValueEnumSchema, toolSchema, topLogProbSchema, truncationEnumEnum, truncationEnumSchema, urlCitationBodySchema, urlCitationBodyTypeEnum, urlCitationParamSchema, urlCitationParamTypeEnum, usageSchema, userMessageItemParamRoleEnum, userMessageItemParamSchema, userMessageItemParamTypeEnum, verbosityEnumEnum, verbosityEnumSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -31633,4 +31633,16 @@ declare const userMessageItemParamSchema: z.ZodObject<{
|
|
|
31633
31633
|
|
|
31634
31634
|
declare const verbosityEnumSchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
31635
31635
|
|
|
31636
|
-
export { type AllowedToolChoice, type AllowedToolChoiceTypeEnumKey, type AllowedToolsParam, type AllowedToolsParamTypeEnumKey, type Annotation, type AssistantMessageItemParam, type AssistantMessageItemParamRoleEnumKey, type AssistantMessageItemParamTypeEnumKey, type CreateResponseBody, type Createresponse200, type CreateresponseMutation, type CreateresponseMutationRequest, type CreateresponseMutationResponse, type DetailEnum, type DetailEnumEnumKey, type DeveloperMessageItemParam, type DeveloperMessageItemParamRoleEnumKey, type DeveloperMessageItemParamTypeEnumKey, type EmptyModelParam, type Error, type ErrorPayload, type ErrorStreamingEvent, type ErrorStreamingEventTypeEnumKey, type FunctionCall, type FunctionCallItemParam, type FunctionCallItemParamTypeEnumKey, type FunctionCallItemStatus, type FunctionCallItemStatusEnumKey, type FunctionCallOutput, type FunctionCallOutputItemParam, type FunctionCallOutputItemParamTypeEnumKey, type FunctionCallOutputStatusEnum, type FunctionCallOutputStatusEnumEnumKey, type FunctionCallOutputTypeEnumKey, type FunctionCallStatus, type FunctionCallStatusEnumKey, type FunctionCallTypeEnumKey, type FunctionTool, type FunctionToolChoice, type FunctionToolChoiceTypeEnumKey, type FunctionToolParam, type FunctionToolParamTypeEnumKey, type FunctionToolTypeEnumKey, type ImageDetail, type ImageDetailEnumKey, type IncludeEnum, type IncludeEnumEnumKey, type IncompleteDetails, type InputFileContent, type InputFileContentParam, type InputFileContentParamTypeEnumKey, type InputFileContentTypeEnumKey, type InputImageContent, type InputImageContentParamAutoParam, type InputImageContentParamAutoParamTypeEnumKey, type InputImageContentTypeEnumKey, type InputTextContent, type InputTextContentParam, type InputTextContentParamTypeEnumKey, type InputTextContentTypeEnumKey, type InputTokensDetails, type InputVideoContent, type InputVideoContentTypeEnumKey, type ItemField, type ItemParam, type ItemReferenceParam, type ItemReferenceParamTypeEnumKey, type JsonObjectResponseFormat, type JsonObjectResponseFormatTypeEnumKey, type JsonSchemaResponseFormat, type JsonSchemaResponseFormatParam, type JsonSchemaResponseFormatParamTypeEnumKey, type JsonSchemaResponseFormatTypeEnumKey, type LogProb, type Message, type MessageRole, type MessageRoleEnumKey, type MessageStatus, type MessageStatusEnumKey, type MessageTypeEnumKey, type MetadataParam, type OutputTextContent, type OutputTextContentParam, type OutputTextContentParamTypeEnumKey, type OutputTextContentTypeEnumKey, type OutputTokensDetails, type Reasoning, type ReasoningBody, type ReasoningBodyTypeEnumKey, type ReasoningEffortEnum, type ReasoningEffortEnumEnumKey, type ReasoningItemParam, type ReasoningItemParamTypeEnumKey, type ReasoningParam, type ReasoningSummaryContentParam, type ReasoningSummaryContentParamTypeEnumKey, type ReasoningSummaryEnum, type ReasoningSummaryEnumEnumKey, type ReasoningTextContent, type ReasoningTextContentTypeEnumKey, type RefusalContent, type RefusalContentParam, type RefusalContentParamTypeEnumKey, type RefusalContentTypeEnumKey, type ResponseCompletedStreamingEvent, type ResponseCompletedStreamingEventTypeEnumKey, type ResponseContentPartAddedStreamingEvent, type ResponseContentPartAddedStreamingEventTypeEnumKey, type ResponseContentPartDoneStreamingEvent, type ResponseContentPartDoneStreamingEventTypeEnumKey, type ResponseCreatedStreamingEvent, type ResponseCreatedStreamingEventTypeEnumKey, type ResponseFailedStreamingEvent, type ResponseFailedStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDeltaStreamingEvent, type ResponseFunctionCallArgumentsDeltaStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDoneStreamingEvent, type ResponseFunctionCallArgumentsDoneStreamingEventTypeEnumKey, type ResponseInProgressStreamingEvent, type ResponseInProgressStreamingEventTypeEnumKey, type ResponseIncompleteStreamingEvent, type ResponseIncompleteStreamingEventTypeEnumKey, type ResponseOutputItemAddedStreamingEvent, type ResponseOutputItemAddedStreamingEventTypeEnumKey, type ResponseOutputItemDoneStreamingEvent, type ResponseOutputItemDoneStreamingEventTypeEnumKey, type ResponseOutputTextAnnotationAddedStreamingEvent, type ResponseOutputTextAnnotationAddedStreamingEventTypeEnumKey, type ResponseOutputTextDeltaStreamingEvent, type ResponseOutputTextDeltaStreamingEventTypeEnumKey, type ResponseOutputTextDoneStreamingEvent, type ResponseOutputTextDoneStreamingEventTypeEnumKey, type ResponseQueuedStreamingEvent, type ResponseQueuedStreamingEventTypeEnumKey, type ResponseReasoningDeltaStreamingEvent, type ResponseReasoningDeltaStreamingEventTypeEnumKey, type ResponseReasoningDoneStreamingEvent, type ResponseReasoningDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryDeltaStreamingEvent, type ResponseReasoningSummaryDeltaStreamingEventTypeEnumKey, type ResponseReasoningSummaryDoneStreamingEvent, type ResponseReasoningSummaryDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartAddedStreamingEvent, type ResponseReasoningSummaryPartAddedStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartDoneStreamingEvent, type ResponseReasoningSummaryPartDoneStreamingEventTypeEnumKey, type ResponseRefusalDeltaStreamingEvent, type ResponseRefusalDeltaStreamingEventTypeEnumKey, type ResponseRefusalDoneStreamingEvent, type ResponseRefusalDoneStreamingEventTypeEnumKey, type ResponseResource, type ResponseResourceObjectEnumKey, type ResponsesToolParam, type ServiceTierEnum, type ServiceTierEnumEnumKey, type SpecificFunctionParam, type SpecificFunctionParamTypeEnumKey, type SpecificToolChoiceParam, type StreamOptionsParam, type SummaryTextContent, type SummaryTextContentTypeEnumKey, type SystemMessageItemParam, type SystemMessageItemParamRoleEnumKey, type SystemMessageItemParamTypeEnumKey, type TextContent, type TextContentTypeEnumKey, type TextField, type TextFormatParam, type TextParam, type TextResponseFormat, type TextResponseFormatTypeEnumKey, type Tool, type ToolChoiceParam, type ToolChoiceValueEnum, type ToolChoiceValueEnumEnumKey, type TopLogProb, type TruncationEnum, type TruncationEnumEnumKey, type UrlCitationBody, type UrlCitationBodyTypeEnumKey, type UrlCitationParam, type UrlCitationParamTypeEnumKey, type Usage, type UserMessageItemParam, type UserMessageItemParamRoleEnumKey, type UserMessageItemParamTypeEnumKey, type VerbosityEnum, type VerbosityEnumEnumKey, allowedToolChoiceSchema, allowedToolChoiceTypeEnum, allowedToolsParamSchema, allowedToolsParamTypeEnum, annotationSchema, assistantMessageItemParamRoleEnum, assistantMessageItemParamSchema, assistantMessageItemParamTypeEnum, createResponseBodySchema, createresponse200Schema, createresponseMutationRequestSchema, createresponseMutationResponseSchema, detailEnumEnum, detailEnumSchema, developerMessageItemParamRoleEnum, developerMessageItemParamSchema, developerMessageItemParamTypeEnum, emptyModelParamSchema, errorPayloadSchema, errorSchema, errorStreamingEventSchema, errorStreamingEventTypeEnum, functionCallItemParamSchema, functionCallItemParamTypeEnum, functionCallItemStatusEnum, functionCallItemStatusSchema, functionCallOutputItemParamSchema, functionCallOutputItemParamTypeEnum, functionCallOutputSchema, functionCallOutputStatusEnumEnum, functionCallOutputStatusEnumSchema, functionCallOutputTypeEnum, functionCallSchema, functionCallStatusEnum, functionCallStatusSchema, functionCallTypeEnum, functionToolChoiceSchema, functionToolChoiceTypeEnum, functionToolParamSchema, functionToolParamTypeEnum, functionToolSchema, functionToolTypeEnum, imageDetailEnum, imageDetailSchema, includeEnumEnum, includeEnumSchema, incompleteDetailsSchema, inputFileContentParamSchema, inputFileContentParamTypeEnum, inputFileContentSchema, inputFileContentTypeEnum, inputImageContentParamAutoParamSchema, inputImageContentParamAutoParamTypeEnum, inputImageContentSchema, inputImageContentTypeEnum, inputTextContentParamSchema, inputTextContentParamTypeEnum, inputTextContentSchema, inputTextContentTypeEnum, inputTokensDetailsSchema, inputVideoContentSchema, inputVideoContentTypeEnum, itemFieldSchema, itemParamSchema, itemReferenceParamSchema, itemReferenceParamTypeEnum, jsonObjectResponseFormatSchema, jsonObjectResponseFormatTypeEnum, jsonSchemaResponseFormatParamSchema, jsonSchemaResponseFormatParamTypeEnum, jsonSchemaResponseFormatSchema, jsonSchemaResponseFormatTypeEnum, logProbSchema, messageRoleEnum, messageRoleSchema, messageSchema, messageStatusEnum, messageStatusSchema, messageTypeEnum, metadataParamSchema, outputTextContentParamSchema, outputTextContentParamTypeEnum, outputTextContentSchema, outputTextContentTypeEnum, outputTokensDetailsSchema, reasoningBodySchema, reasoningBodyTypeEnum, reasoningEffortEnumEnum, reasoningEffortEnumSchema, reasoningItemParamSchema, reasoningItemParamTypeEnum, reasoningParamSchema, reasoningSchema, reasoningSummaryContentParamSchema, reasoningSummaryContentParamTypeEnum, reasoningSummaryEnumEnum, reasoningSummaryEnumSchema, reasoningTextContentSchema, reasoningTextContentTypeEnum, refusalContentParamSchema, refusalContentParamTypeEnum, refusalContentSchema, refusalContentTypeEnum, responseCompletedStreamingEventSchema, responseCompletedStreamingEventTypeEnum, responseContentPartAddedStreamingEventSchema, responseContentPartAddedStreamingEventTypeEnum, responseContentPartDoneStreamingEventSchema, responseContentPartDoneStreamingEventTypeEnum, responseCreatedStreamingEventSchema, responseCreatedStreamingEventTypeEnum, responseFailedStreamingEventSchema, responseFailedStreamingEventTypeEnum, responseFunctionCallArgumentsDeltaStreamingEventSchema, responseFunctionCallArgumentsDeltaStreamingEventTypeEnum, responseFunctionCallArgumentsDoneStreamingEventSchema, responseFunctionCallArgumentsDoneStreamingEventTypeEnum, responseInProgressStreamingEventSchema, responseInProgressStreamingEventTypeEnum, responseIncompleteStreamingEventSchema, responseIncompleteStreamingEventTypeEnum, responseOutputItemAddedStreamingEventSchema, responseOutputItemAddedStreamingEventTypeEnum, responseOutputItemDoneStreamingEventSchema, responseOutputItemDoneStreamingEventTypeEnum, responseOutputTextAnnotationAddedStreamingEventSchema, responseOutputTextAnnotationAddedStreamingEventTypeEnum, responseOutputTextDeltaStreamingEventSchema, responseOutputTextDeltaStreamingEventTypeEnum, responseOutputTextDoneStreamingEventSchema, responseOutputTextDoneStreamingEventTypeEnum, responseQueuedStreamingEventSchema, responseQueuedStreamingEventTypeEnum, responseReasoningDeltaStreamingEventSchema, responseReasoningDeltaStreamingEventTypeEnum, responseReasoningDoneStreamingEventSchema, responseReasoningDoneStreamingEventTypeEnum, responseReasoningSummaryDeltaStreamingEventSchema, responseReasoningSummaryDeltaStreamingEventTypeEnum, responseReasoningSummaryDoneStreamingEventSchema, responseReasoningSummaryDoneStreamingEventTypeEnum, responseReasoningSummaryPartAddedStreamingEventSchema, responseReasoningSummaryPartAddedStreamingEventTypeEnum, responseReasoningSummaryPartDoneStreamingEventSchema, responseReasoningSummaryPartDoneStreamingEventTypeEnum, responseRefusalDeltaStreamingEventSchema, responseRefusalDeltaStreamingEventTypeEnum, responseRefusalDoneStreamingEventSchema, responseRefusalDoneStreamingEventTypeEnum, responseResourceObjectEnum, responseResourceSchema, responsesToolParamSchema, serviceTierEnumEnum, serviceTierEnumSchema, specificFunctionParamSchema, specificFunctionParamTypeEnum, specificToolChoiceParamSchema, streamOptionsParamSchema, summaryTextContentSchema, summaryTextContentTypeEnum, systemMessageItemParamRoleEnum, systemMessageItemParamSchema, systemMessageItemParamTypeEnum, textContentSchema, textContentTypeEnum, textFieldSchema, textFormatParamSchema, textParamSchema, textResponseFormatSchema, textResponseFormatTypeEnum, toolChoiceParamSchema, toolChoiceValueEnumEnum, toolChoiceValueEnumSchema, toolSchema, topLogProbSchema, truncationEnumEnum, truncationEnumSchema, urlCitationBodySchema, urlCitationBodyTypeEnum, urlCitationParamSchema, urlCitationParamTypeEnum, usageSchema, userMessageItemParamRoleEnum, userMessageItemParamSchema, userMessageItemParamTypeEnum, verbosityEnumEnum, verbosityEnumSchema };
|
|
31636
|
+
declare class TekimaxClient {
|
|
31637
|
+
private baseUrl;
|
|
31638
|
+
private headers;
|
|
31639
|
+
constructor(options?: {
|
|
31640
|
+
baseUrl?: string;
|
|
31641
|
+
apiKey?: string;
|
|
31642
|
+
});
|
|
31643
|
+
private request;
|
|
31644
|
+
createSession(body: CreateResponseBody): Promise<ResponseResource>;
|
|
31645
|
+
sendMessage(body: CreateResponseBody): Promise<ResponseResource>;
|
|
31646
|
+
}
|
|
31647
|
+
|
|
31648
|
+
export { type AllowedToolChoice, type AllowedToolChoiceTypeEnumKey, type AllowedToolsParam, type AllowedToolsParamTypeEnumKey, type Annotation, type AssistantMessageItemParam, type AssistantMessageItemParamRoleEnumKey, type AssistantMessageItemParamTypeEnumKey, type CreateResponseBody, type Createresponse200, type CreateresponseMutation, type CreateresponseMutationRequest, type CreateresponseMutationResponse, type DetailEnum, type DetailEnumEnumKey, type DeveloperMessageItemParam, type DeveloperMessageItemParamRoleEnumKey, type DeveloperMessageItemParamTypeEnumKey, type EmptyModelParam, type Error, type ErrorPayload, type ErrorStreamingEvent, type ErrorStreamingEventTypeEnumKey, type FunctionCall, type FunctionCallItemParam, type FunctionCallItemParamTypeEnumKey, type FunctionCallItemStatus, type FunctionCallItemStatusEnumKey, type FunctionCallOutput, type FunctionCallOutputItemParam, type FunctionCallOutputItemParamTypeEnumKey, type FunctionCallOutputStatusEnum, type FunctionCallOutputStatusEnumEnumKey, type FunctionCallOutputTypeEnumKey, type FunctionCallStatus, type FunctionCallStatusEnumKey, type FunctionCallTypeEnumKey, type FunctionTool, type FunctionToolChoice, type FunctionToolChoiceTypeEnumKey, type FunctionToolParam, type FunctionToolParamTypeEnumKey, type FunctionToolTypeEnumKey, type ImageDetail, type ImageDetailEnumKey, type IncludeEnum, type IncludeEnumEnumKey, type IncompleteDetails, type InputFileContent, type InputFileContentParam, type InputFileContentParamTypeEnumKey, type InputFileContentTypeEnumKey, type InputImageContent, type InputImageContentParamAutoParam, type InputImageContentParamAutoParamTypeEnumKey, type InputImageContentTypeEnumKey, type InputTextContent, type InputTextContentParam, type InputTextContentParamTypeEnumKey, type InputTextContentTypeEnumKey, type InputTokensDetails, type InputVideoContent, type InputVideoContentTypeEnumKey, type ItemField, type ItemParam, type ItemReferenceParam, type ItemReferenceParamTypeEnumKey, type JsonObjectResponseFormat, type JsonObjectResponseFormatTypeEnumKey, type JsonSchemaResponseFormat, type JsonSchemaResponseFormatParam, type JsonSchemaResponseFormatParamTypeEnumKey, type JsonSchemaResponseFormatTypeEnumKey, type LogProb, type Message, type MessageRole, type MessageRoleEnumKey, type MessageStatus, type MessageStatusEnumKey, type MessageTypeEnumKey, type MetadataParam, type OutputTextContent, type OutputTextContentParam, type OutputTextContentParamTypeEnumKey, type OutputTextContentTypeEnumKey, type OutputTokensDetails, type Reasoning, type ReasoningBody, type ReasoningBodyTypeEnumKey, type ReasoningEffortEnum, type ReasoningEffortEnumEnumKey, type ReasoningItemParam, type ReasoningItemParamTypeEnumKey, type ReasoningParam, type ReasoningSummaryContentParam, type ReasoningSummaryContentParamTypeEnumKey, type ReasoningSummaryEnum, type ReasoningSummaryEnumEnumKey, type ReasoningTextContent, type ReasoningTextContentTypeEnumKey, type RefusalContent, type RefusalContentParam, type RefusalContentParamTypeEnumKey, type RefusalContentTypeEnumKey, type ResponseCompletedStreamingEvent, type ResponseCompletedStreamingEventTypeEnumKey, type ResponseContentPartAddedStreamingEvent, type ResponseContentPartAddedStreamingEventTypeEnumKey, type ResponseContentPartDoneStreamingEvent, type ResponseContentPartDoneStreamingEventTypeEnumKey, type ResponseCreatedStreamingEvent, type ResponseCreatedStreamingEventTypeEnumKey, type ResponseFailedStreamingEvent, type ResponseFailedStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDeltaStreamingEvent, type ResponseFunctionCallArgumentsDeltaStreamingEventTypeEnumKey, type ResponseFunctionCallArgumentsDoneStreamingEvent, type ResponseFunctionCallArgumentsDoneStreamingEventTypeEnumKey, type ResponseInProgressStreamingEvent, type ResponseInProgressStreamingEventTypeEnumKey, type ResponseIncompleteStreamingEvent, type ResponseIncompleteStreamingEventTypeEnumKey, type ResponseOutputItemAddedStreamingEvent, type ResponseOutputItemAddedStreamingEventTypeEnumKey, type ResponseOutputItemDoneStreamingEvent, type ResponseOutputItemDoneStreamingEventTypeEnumKey, type ResponseOutputTextAnnotationAddedStreamingEvent, type ResponseOutputTextAnnotationAddedStreamingEventTypeEnumKey, type ResponseOutputTextDeltaStreamingEvent, type ResponseOutputTextDeltaStreamingEventTypeEnumKey, type ResponseOutputTextDoneStreamingEvent, type ResponseOutputTextDoneStreamingEventTypeEnumKey, type ResponseQueuedStreamingEvent, type ResponseQueuedStreamingEventTypeEnumKey, type ResponseReasoningDeltaStreamingEvent, type ResponseReasoningDeltaStreamingEventTypeEnumKey, type ResponseReasoningDoneStreamingEvent, type ResponseReasoningDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryDeltaStreamingEvent, type ResponseReasoningSummaryDeltaStreamingEventTypeEnumKey, type ResponseReasoningSummaryDoneStreamingEvent, type ResponseReasoningSummaryDoneStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartAddedStreamingEvent, type ResponseReasoningSummaryPartAddedStreamingEventTypeEnumKey, type ResponseReasoningSummaryPartDoneStreamingEvent, type ResponseReasoningSummaryPartDoneStreamingEventTypeEnumKey, type ResponseRefusalDeltaStreamingEvent, type ResponseRefusalDeltaStreamingEventTypeEnumKey, type ResponseRefusalDoneStreamingEvent, type ResponseRefusalDoneStreamingEventTypeEnumKey, type ResponseResource, type ResponseResourceObjectEnumKey, type ResponsesToolParam, type ServiceTierEnum, type ServiceTierEnumEnumKey, type SpecificFunctionParam, type SpecificFunctionParamTypeEnumKey, type SpecificToolChoiceParam, type StreamOptionsParam, type SummaryTextContent, type SummaryTextContentTypeEnumKey, type SystemMessageItemParam, type SystemMessageItemParamRoleEnumKey, type SystemMessageItemParamTypeEnumKey, TekimaxClient, type TextContent, type TextContentTypeEnumKey, type TextField, type TextFormatParam, type TextParam, type TextResponseFormat, type TextResponseFormatTypeEnumKey, type Tool, type ToolChoiceParam, type ToolChoiceValueEnum, type ToolChoiceValueEnumEnumKey, type TopLogProb, type TruncationEnum, type TruncationEnumEnumKey, type UrlCitationBody, type UrlCitationBodyTypeEnumKey, type UrlCitationParam, type UrlCitationParamTypeEnumKey, type Usage, type UserMessageItemParam, type UserMessageItemParamRoleEnumKey, type UserMessageItemParamTypeEnumKey, type VerbosityEnum, type VerbosityEnumEnumKey, allowedToolChoiceSchema, allowedToolChoiceTypeEnum, allowedToolsParamSchema, allowedToolsParamTypeEnum, annotationSchema, assistantMessageItemParamRoleEnum, assistantMessageItemParamSchema, assistantMessageItemParamTypeEnum, createResponseBodySchema, createresponse200Schema, createresponseMutationRequestSchema, createresponseMutationResponseSchema, detailEnumEnum, detailEnumSchema, developerMessageItemParamRoleEnum, developerMessageItemParamSchema, developerMessageItemParamTypeEnum, emptyModelParamSchema, errorPayloadSchema, errorSchema, errorStreamingEventSchema, errorStreamingEventTypeEnum, functionCallItemParamSchema, functionCallItemParamTypeEnum, functionCallItemStatusEnum, functionCallItemStatusSchema, functionCallOutputItemParamSchema, functionCallOutputItemParamTypeEnum, functionCallOutputSchema, functionCallOutputStatusEnumEnum, functionCallOutputStatusEnumSchema, functionCallOutputTypeEnum, functionCallSchema, functionCallStatusEnum, functionCallStatusSchema, functionCallTypeEnum, functionToolChoiceSchema, functionToolChoiceTypeEnum, functionToolParamSchema, functionToolParamTypeEnum, functionToolSchema, functionToolTypeEnum, imageDetailEnum, imageDetailSchema, includeEnumEnum, includeEnumSchema, incompleteDetailsSchema, inputFileContentParamSchema, inputFileContentParamTypeEnum, inputFileContentSchema, inputFileContentTypeEnum, inputImageContentParamAutoParamSchema, inputImageContentParamAutoParamTypeEnum, inputImageContentSchema, inputImageContentTypeEnum, inputTextContentParamSchema, inputTextContentParamTypeEnum, inputTextContentSchema, inputTextContentTypeEnum, inputTokensDetailsSchema, inputVideoContentSchema, inputVideoContentTypeEnum, itemFieldSchema, itemParamSchema, itemReferenceParamSchema, itemReferenceParamTypeEnum, jsonObjectResponseFormatSchema, jsonObjectResponseFormatTypeEnum, jsonSchemaResponseFormatParamSchema, jsonSchemaResponseFormatParamTypeEnum, jsonSchemaResponseFormatSchema, jsonSchemaResponseFormatTypeEnum, logProbSchema, messageRoleEnum, messageRoleSchema, messageSchema, messageStatusEnum, messageStatusSchema, messageTypeEnum, metadataParamSchema, outputTextContentParamSchema, outputTextContentParamTypeEnum, outputTextContentSchema, outputTextContentTypeEnum, outputTokensDetailsSchema, reasoningBodySchema, reasoningBodyTypeEnum, reasoningEffortEnumEnum, reasoningEffortEnumSchema, reasoningItemParamSchema, reasoningItemParamTypeEnum, reasoningParamSchema, reasoningSchema, reasoningSummaryContentParamSchema, reasoningSummaryContentParamTypeEnum, reasoningSummaryEnumEnum, reasoningSummaryEnumSchema, reasoningTextContentSchema, reasoningTextContentTypeEnum, refusalContentParamSchema, refusalContentParamTypeEnum, refusalContentSchema, refusalContentTypeEnum, responseCompletedStreamingEventSchema, responseCompletedStreamingEventTypeEnum, responseContentPartAddedStreamingEventSchema, responseContentPartAddedStreamingEventTypeEnum, responseContentPartDoneStreamingEventSchema, responseContentPartDoneStreamingEventTypeEnum, responseCreatedStreamingEventSchema, responseCreatedStreamingEventTypeEnum, responseFailedStreamingEventSchema, responseFailedStreamingEventTypeEnum, responseFunctionCallArgumentsDeltaStreamingEventSchema, responseFunctionCallArgumentsDeltaStreamingEventTypeEnum, responseFunctionCallArgumentsDoneStreamingEventSchema, responseFunctionCallArgumentsDoneStreamingEventTypeEnum, responseInProgressStreamingEventSchema, responseInProgressStreamingEventTypeEnum, responseIncompleteStreamingEventSchema, responseIncompleteStreamingEventTypeEnum, responseOutputItemAddedStreamingEventSchema, responseOutputItemAddedStreamingEventTypeEnum, responseOutputItemDoneStreamingEventSchema, responseOutputItemDoneStreamingEventTypeEnum, responseOutputTextAnnotationAddedStreamingEventSchema, responseOutputTextAnnotationAddedStreamingEventTypeEnum, responseOutputTextDeltaStreamingEventSchema, responseOutputTextDeltaStreamingEventTypeEnum, responseOutputTextDoneStreamingEventSchema, responseOutputTextDoneStreamingEventTypeEnum, responseQueuedStreamingEventSchema, responseQueuedStreamingEventTypeEnum, responseReasoningDeltaStreamingEventSchema, responseReasoningDeltaStreamingEventTypeEnum, responseReasoningDoneStreamingEventSchema, responseReasoningDoneStreamingEventTypeEnum, responseReasoningSummaryDeltaStreamingEventSchema, responseReasoningSummaryDeltaStreamingEventTypeEnum, responseReasoningSummaryDoneStreamingEventSchema, responseReasoningSummaryDoneStreamingEventTypeEnum, responseReasoningSummaryPartAddedStreamingEventSchema, responseReasoningSummaryPartAddedStreamingEventTypeEnum, responseReasoningSummaryPartDoneStreamingEventSchema, responseReasoningSummaryPartDoneStreamingEventTypeEnum, responseRefusalDeltaStreamingEventSchema, responseRefusalDeltaStreamingEventTypeEnum, responseRefusalDoneStreamingEventSchema, responseRefusalDoneStreamingEventTypeEnum, responseResourceObjectEnum, responseResourceSchema, responsesToolParamSchema, serviceTierEnumEnum, serviceTierEnumSchema, specificFunctionParamSchema, specificFunctionParamTypeEnum, specificToolChoiceParamSchema, streamOptionsParamSchema, summaryTextContentSchema, summaryTextContentTypeEnum, systemMessageItemParamRoleEnum, systemMessageItemParamSchema, systemMessageItemParamTypeEnum, textContentSchema, textContentTypeEnum, textFieldSchema, textFormatParamSchema, textParamSchema, textResponseFormatSchema, textResponseFormatTypeEnum, toolChoiceParamSchema, toolChoiceValueEnumEnum, toolChoiceValueEnumSchema, toolSchema, topLogProbSchema, truncationEnumEnum, truncationEnumSchema, urlCitationBodySchema, urlCitationBodyTypeEnum, urlCitationParamSchema, urlCitationParamTypeEnum, usageSchema, userMessageItemParamRoleEnum, userMessageItemParamSchema, userMessageItemParamTypeEnum, verbosityEnumEnum, verbosityEnumSchema };
|
package/dist/index.js
CHANGED
|
@@ -17,9 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/
|
|
20
|
+
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
TekimaxClient: () => TekimaxClient,
|
|
23
24
|
allowedToolChoiceSchema: () => allowedToolChoiceSchema,
|
|
24
25
|
allowedToolChoiceTypeEnum: () => allowedToolChoiceTypeEnum,
|
|
25
26
|
allowedToolsParamSchema: () => allowedToolsParamSchema,
|
|
@@ -1496,8 +1497,108 @@ var userMessageItemParamSchema = import_zod103.z.object({
|
|
|
1496
1497
|
}))]).describe("A piece of message content, such as text, an image, or a file.")), import_zod103.z.string()]).describe("The message content, as an array of content parts."),
|
|
1497
1498
|
"status": import_zod103.z.optional(import_zod103.z.union([import_zod103.z.string(), import_zod103.z.null()]))
|
|
1498
1499
|
});
|
|
1500
|
+
|
|
1501
|
+
// src/client.ts
|
|
1502
|
+
var TekimaxResponse = class {
|
|
1503
|
+
constructor(_raw) {
|
|
1504
|
+
this._raw = _raw;
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* Access the raw response object returned by the API.
|
|
1508
|
+
*/
|
|
1509
|
+
get raw() {
|
|
1510
|
+
return this._raw;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Automatically extracts the text content from the response.
|
|
1514
|
+
* It looks for the first "output_text" item in the response content.
|
|
1515
|
+
*/
|
|
1516
|
+
get text() {
|
|
1517
|
+
if (!this._raw.output) return void 0;
|
|
1518
|
+
const textItem = this._raw.output.find(
|
|
1519
|
+
(item) => item.type === "output_text"
|
|
1520
|
+
);
|
|
1521
|
+
return textItem?.text;
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* The ID of the response.
|
|
1525
|
+
*/
|
|
1526
|
+
get id() {
|
|
1527
|
+
return this._raw.id ?? void 0;
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* The model used to generate the response.
|
|
1531
|
+
*/
|
|
1532
|
+
get model() {
|
|
1533
|
+
return this._raw.model ?? void 0;
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
var TekimaxClient = class {
|
|
1537
|
+
/**
|
|
1538
|
+
* Creates a new TekimaxClient.
|
|
1539
|
+
*
|
|
1540
|
+
* @param options - Configuration options for the client.
|
|
1541
|
+
* @param options.baseUrl - The base URL of the API (default: "https://api.tekimax.com").
|
|
1542
|
+
* @param options.apiKey - Your Tekimax API key.
|
|
1543
|
+
*
|
|
1544
|
+
* @example
|
|
1545
|
+
* const client = new TekimaxClient({ apiKey: "tm_..." });
|
|
1546
|
+
*/
|
|
1547
|
+
constructor(options = {}) {
|
|
1548
|
+
this.baseUrl = options.baseUrl || "https://api.tekimax.com";
|
|
1549
|
+
this.headers = {
|
|
1550
|
+
"Content-Type": "application/json",
|
|
1551
|
+
...options.apiKey ? { "Authorization": `Bearer ${options.apiKey}` } : {}
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
async request(path, body) {
|
|
1555
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
1556
|
+
method: "POST",
|
|
1557
|
+
headers: this.headers,
|
|
1558
|
+
body: JSON.stringify(body)
|
|
1559
|
+
});
|
|
1560
|
+
if (!response.ok) {
|
|
1561
|
+
throw new Error(`Tekimax API Error: ${response.status} ${response.statusText}`);
|
|
1562
|
+
}
|
|
1563
|
+
const data = await response.json();
|
|
1564
|
+
return new TekimaxResponse(data);
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Creates a new session and sends the initial message.
|
|
1568
|
+
*
|
|
1569
|
+
* @param message - The initial message text to start the session.
|
|
1570
|
+
* @param options - Additional configuration options (model, temperature, etc.).
|
|
1571
|
+
*
|
|
1572
|
+
* @example
|
|
1573
|
+
* const response = await client.createSession("Hello, world!", { model: "gpt-4" });
|
|
1574
|
+
* console.log(response.text);
|
|
1575
|
+
*/
|
|
1576
|
+
async createSession(message, options) {
|
|
1577
|
+
const body = {
|
|
1578
|
+
...options,
|
|
1579
|
+
input: message
|
|
1580
|
+
};
|
|
1581
|
+
return this.request("/responses", body);
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Sends a message to an existing session or starts a new one if no previous_response_id is provided.
|
|
1585
|
+
*
|
|
1586
|
+
* @param message - The message text to send.
|
|
1587
|
+
* @param options - Additional configuration options.
|
|
1588
|
+
*
|
|
1589
|
+
* @example
|
|
1590
|
+
* const response = await client.sendMessage("What is the weather?", {
|
|
1591
|
+
* previous_response_id: "resp_123"
|
|
1592
|
+
* });
|
|
1593
|
+
* console.log(response.text);
|
|
1594
|
+
*/
|
|
1595
|
+
async sendMessage(message, options) {
|
|
1596
|
+
return this.createSession(message, options);
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1499
1599
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1500
1600
|
0 && (module.exports = {
|
|
1601
|
+
TekimaxClient,
|
|
1501
1602
|
allowedToolChoiceSchema,
|
|
1502
1603
|
allowedToolChoiceTypeEnum,
|
|
1503
1604
|
allowedToolsParamSchema,
|
package/dist/index.mjs
CHANGED
|
@@ -1284,7 +1284,107 @@ var userMessageItemParamSchema = z103.object({
|
|
|
1284
1284
|
}))]).describe("A piece of message content, such as text, an image, or a file.")), z103.string()]).describe("The message content, as an array of content parts."),
|
|
1285
1285
|
"status": z103.optional(z103.union([z103.string(), z103.null()]))
|
|
1286
1286
|
});
|
|
1287
|
+
|
|
1288
|
+
// src/client.ts
|
|
1289
|
+
var TekimaxResponse = class {
|
|
1290
|
+
constructor(_raw) {
|
|
1291
|
+
this._raw = _raw;
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Access the raw response object returned by the API.
|
|
1295
|
+
*/
|
|
1296
|
+
get raw() {
|
|
1297
|
+
return this._raw;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Automatically extracts the text content from the response.
|
|
1301
|
+
* It looks for the first "output_text" item in the response content.
|
|
1302
|
+
*/
|
|
1303
|
+
get text() {
|
|
1304
|
+
if (!this._raw.output) return void 0;
|
|
1305
|
+
const textItem = this._raw.output.find(
|
|
1306
|
+
(item) => item.type === "output_text"
|
|
1307
|
+
);
|
|
1308
|
+
return textItem?.text;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* The ID of the response.
|
|
1312
|
+
*/
|
|
1313
|
+
get id() {
|
|
1314
|
+
return this._raw.id ?? void 0;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* The model used to generate the response.
|
|
1318
|
+
*/
|
|
1319
|
+
get model() {
|
|
1320
|
+
return this._raw.model ?? void 0;
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
var TekimaxClient = class {
|
|
1324
|
+
/**
|
|
1325
|
+
* Creates a new TekimaxClient.
|
|
1326
|
+
*
|
|
1327
|
+
* @param options - Configuration options for the client.
|
|
1328
|
+
* @param options.baseUrl - The base URL of the API (default: "https://api.tekimax.com").
|
|
1329
|
+
* @param options.apiKey - Your Tekimax API key.
|
|
1330
|
+
*
|
|
1331
|
+
* @example
|
|
1332
|
+
* const client = new TekimaxClient({ apiKey: "tm_..." });
|
|
1333
|
+
*/
|
|
1334
|
+
constructor(options = {}) {
|
|
1335
|
+
this.baseUrl = options.baseUrl || "https://api.tekimax.com";
|
|
1336
|
+
this.headers = {
|
|
1337
|
+
"Content-Type": "application/json",
|
|
1338
|
+
...options.apiKey ? { "Authorization": `Bearer ${options.apiKey}` } : {}
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
async request(path, body) {
|
|
1342
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
1343
|
+
method: "POST",
|
|
1344
|
+
headers: this.headers,
|
|
1345
|
+
body: JSON.stringify(body)
|
|
1346
|
+
});
|
|
1347
|
+
if (!response.ok) {
|
|
1348
|
+
throw new Error(`Tekimax API Error: ${response.status} ${response.statusText}`);
|
|
1349
|
+
}
|
|
1350
|
+
const data = await response.json();
|
|
1351
|
+
return new TekimaxResponse(data);
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Creates a new session and sends the initial message.
|
|
1355
|
+
*
|
|
1356
|
+
* @param message - The initial message text to start the session.
|
|
1357
|
+
* @param options - Additional configuration options (model, temperature, etc.).
|
|
1358
|
+
*
|
|
1359
|
+
* @example
|
|
1360
|
+
* const response = await client.createSession("Hello, world!", { model: "gpt-4" });
|
|
1361
|
+
* console.log(response.text);
|
|
1362
|
+
*/
|
|
1363
|
+
async createSession(message, options) {
|
|
1364
|
+
const body = {
|
|
1365
|
+
...options,
|
|
1366
|
+
input: message
|
|
1367
|
+
};
|
|
1368
|
+
return this.request("/responses", body);
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Sends a message to an existing session or starts a new one if no previous_response_id is provided.
|
|
1372
|
+
*
|
|
1373
|
+
* @param message - The message text to send.
|
|
1374
|
+
* @param options - Additional configuration options.
|
|
1375
|
+
*
|
|
1376
|
+
* @example
|
|
1377
|
+
* const response = await client.sendMessage("What is the weather?", {
|
|
1378
|
+
* previous_response_id: "resp_123"
|
|
1379
|
+
* });
|
|
1380
|
+
* console.log(response.text);
|
|
1381
|
+
*/
|
|
1382
|
+
async sendMessage(message, options) {
|
|
1383
|
+
return this.createSession(message, options);
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1287
1386
|
export {
|
|
1387
|
+
TekimaxClient,
|
|
1288
1388
|
allowedToolChoiceSchema,
|
|
1289
1389
|
allowedToolChoiceTypeEnum,
|
|
1290
1390
|
allowedToolsParamSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tekimax-ts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Tekimax TypeScript SDK generated with Kubb",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"generate": "kubb generate",
|
|
17
|
-
"build": "tsup src/
|
|
17
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
18
18
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
package/src/client.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { CreateResponseBody, ResponseResource, OutputTextContentParam } from "./gen/types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper around the raw API response that provides helper methods
|
|
5
|
+
* for common tasks like extracting text content.
|
|
6
|
+
*/
|
|
7
|
+
export class TekimaxResponse {
|
|
8
|
+
constructor(private readonly _raw: ResponseResource) { }
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Access the raw response object returned by the API.
|
|
12
|
+
*/
|
|
13
|
+
get raw(): ResponseResource {
|
|
14
|
+
return this._raw;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Automatically extracts the text content from the response.
|
|
19
|
+
* It looks for the first "output_text" item in the response content.
|
|
20
|
+
*/
|
|
21
|
+
get text(): string | undefined {
|
|
22
|
+
if (!this._raw.output) return undefined;
|
|
23
|
+
|
|
24
|
+
// Find the first output item that is of type 'output_text'
|
|
25
|
+
const textItem = this._raw.output.find(
|
|
26
|
+
(item): item is Extract<typeof item, { type: "output_text" }> =>
|
|
27
|
+
item.type === "output_text"
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return textItem?.text;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the response.
|
|
35
|
+
*/
|
|
36
|
+
get id(): string | undefined {
|
|
37
|
+
return this._raw.id ?? undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The model used to generate the response.
|
|
42
|
+
*/
|
|
43
|
+
get model(): string | undefined {
|
|
44
|
+
return this._raw.model ?? undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Options for sending a message or creating a session.
|
|
50
|
+
*/
|
|
51
|
+
export type MessageOptions = Omit<CreateResponseBody, "input" | "stream">;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The main client for interacting with the Tekimax API.
|
|
55
|
+
*/
|
|
56
|
+
export class TekimaxClient {
|
|
57
|
+
private baseUrl: string;
|
|
58
|
+
private headers: HeadersInit;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new TekimaxClient.
|
|
62
|
+
*
|
|
63
|
+
* @param options - Configuration options for the client.
|
|
64
|
+
* @param options.baseUrl - The base URL of the API (default: "https://api.tekimax.com").
|
|
65
|
+
* @param options.apiKey - Your Tekimax API key.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const client = new TekimaxClient({ apiKey: "tm_..." });
|
|
69
|
+
*/
|
|
70
|
+
constructor(options: { baseUrl?: string; apiKey?: string } = {}) {
|
|
71
|
+
this.baseUrl = options.baseUrl || "https://api.tekimax.com";
|
|
72
|
+
this.headers = {
|
|
73
|
+
"Content-Type": "application/json",
|
|
74
|
+
...(options.apiKey ? { "Authorization": `Bearer ${options.apiKey}` } : {}),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private async request(path: string, body: any): Promise<TekimaxResponse> {
|
|
79
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
80
|
+
method: "POST",
|
|
81
|
+
headers: this.headers,
|
|
82
|
+
body: JSON.stringify(body),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
if (!response.ok) {
|
|
86
|
+
throw new Error(`Tekimax API Error: ${response.status} ${response.statusText}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const data = await response.json() as ResponseResource;
|
|
90
|
+
return new TekimaxResponse(data);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Creates a new session and sends the initial message.
|
|
95
|
+
*
|
|
96
|
+
* @param message - The initial message text to start the session.
|
|
97
|
+
* @param options - Additional configuration options (model, temperature, etc.).
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const response = await client.createSession("Hello, world!", { model: "gpt-4" });
|
|
101
|
+
* console.log(response.text);
|
|
102
|
+
*/
|
|
103
|
+
async createSession(message: string, options?: MessageOptions): Promise<TekimaxResponse> {
|
|
104
|
+
const body: CreateResponseBody = {
|
|
105
|
+
...options,
|
|
106
|
+
input: message,
|
|
107
|
+
};
|
|
108
|
+
return this.request("/responses", body);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Sends a message to an existing session or starts a new one if no previous_response_id is provided.
|
|
113
|
+
*
|
|
114
|
+
* @param message - The message text to send.
|
|
115
|
+
* @param options - Additional configuration options.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* const response = await client.sendMessage("What is the weather?", {
|
|
119
|
+
* previous_response_id: "resp_123"
|
|
120
|
+
* });
|
|
121
|
+
* console.log(response.text);
|
|
122
|
+
*/
|
|
123
|
+
async sendMessage(message: string, options?: MessageOptions): Promise<TekimaxResponse> {
|
|
124
|
+
return this.createSession(message, options);
|
|
125
|
+
}
|
|
126
|
+
}
|
package/src/index.ts
ADDED