@openrouter/sdk 0.3.2 → 0.3.7
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/esm/core.js +1 -0
- package/esm/funcs/analyticsGetUserActivity.js +1 -0
- package/esm/funcs/apiKeysCreate.js +1 -0
- package/esm/funcs/apiKeysDelete.js +1 -0
- package/esm/funcs/apiKeysGet.js +1 -0
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +1 -0
- package/esm/funcs/apiKeysList.js +1 -0
- package/esm/funcs/apiKeysUpdate.js +1 -0
- package/esm/funcs/betaResponsesSend.js +1 -0
- package/esm/funcs/call-model.d.ts +33 -0
- package/esm/funcs/call-model.js +155 -0
- package/esm/funcs/chatSend.js +1 -0
- package/esm/funcs/completionsGenerate.js +1 -0
- package/esm/funcs/creditsCreateCoinbaseCharge.js +1 -0
- package/esm/funcs/creditsGetCredits.js +1 -0
- package/esm/funcs/embeddingsGenerate.js +1 -0
- package/esm/funcs/embeddingsListModels.js +1 -0
- package/esm/funcs/endpointsList.js +1 -0
- package/esm/funcs/endpointsListZdrEndpoints.js +1 -0
- package/esm/funcs/generationsGetGeneration.js +1 -0
- package/esm/funcs/modelsCount.js +1 -0
- package/esm/funcs/modelsList.js +1 -0
- package/esm/funcs/modelsListForUser.js +1 -0
- package/esm/funcs/oAuthCreateAuthCode.js +1 -0
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +1 -0
- package/esm/funcs/parametersGetParameters.js +1 -0
- package/esm/funcs/providersList.js +1 -0
- package/esm/hooks/hooks.js +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/types.js +1 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +4 -0
- package/esm/lib/anthropic-compat.d.ts +46 -0
- package/esm/lib/anthropic-compat.js +204 -0
- package/esm/lib/anthropic-compat.test.d.ts +2 -0
- package/esm/lib/anthropic-compat.test.js +479 -0
- package/esm/lib/base64.js +1 -0
- package/esm/lib/chat-compat.d.ts +46 -0
- package/esm/lib/chat-compat.js +108 -0
- package/esm/lib/chat-compat.test.d.ts +2 -0
- package/esm/lib/chat-compat.test.js +282 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +3 -2
- package/esm/lib/dlv.js +1 -0
- package/esm/lib/encodings.js +1 -0
- package/esm/lib/env.js +1 -0
- package/esm/lib/event-streams.js +1 -0
- package/esm/lib/files.js +1 -0
- package/esm/lib/http.js +1 -0
- package/esm/lib/is-plain-object.js +1 -0
- package/esm/lib/logger.js +1 -0
- package/esm/lib/matchers.js +1 -0
- package/esm/lib/{response-wrapper.d.ts → model-result.d.ts} +19 -26
- package/esm/lib/{response-wrapper.js → model-result.js} +93 -83
- package/esm/lib/primitives.js +1 -0
- package/esm/lib/retries.js +1 -0
- package/esm/lib/schemas.js +1 -0
- package/esm/lib/sdks.js +1 -0
- package/esm/lib/security.js +1 -0
- package/esm/lib/stream-transformers.d.ts +27 -1
- package/esm/lib/stream-transformers.js +319 -1
- package/esm/lib/tool-types.d.ts +3 -3
- package/esm/lib/url.js +1 -0
- package/esm/models/activityitem.js +1 -0
- package/esm/models/assistantmessage.js +1 -0
- package/esm/models/badgatewayresponseerrordata.js +1 -0
- package/esm/models/badrequestresponseerrordata.js +1 -0
- package/esm/models/chatcompletionfinishreason.js +1 -0
- package/esm/models/chaterror.js +1 -0
- package/esm/models/chatgenerationparams.js +1 -0
- package/esm/models/chatgenerationtokenusage.js +1 -0
- package/esm/models/chatmessagecontentitem.js +1 -0
- package/esm/models/chatmessagecontentitemaudio.js +1 -0
- package/esm/models/chatmessagecontentitemcachecontrol.js +1 -0
- package/esm/models/chatmessagecontentitemimage.js +1 -0
- package/esm/models/chatmessagecontentitemtext.js +1 -0
- package/esm/models/chatmessagecontentitemvideo.js +1 -0
- package/esm/models/chatmessagetokenlogprob.js +1 -0
- package/esm/models/chatmessagetokenlogprobs.js +1 -0
- package/esm/models/chatmessagetoolcall.js +1 -0
- package/esm/models/chatresponse.js +1 -0
- package/esm/models/chatresponsechoice.js +1 -0
- package/esm/models/chatstreamingchoice.js +1 -0
- package/esm/models/chatstreamingmessagechunk.js +1 -0
- package/esm/models/chatstreamingmessagetoolcall.js +1 -0
- package/esm/models/chatstreamingresponsechunk.js +1 -0
- package/esm/models/chatstreamoptions.js +1 -0
- package/esm/models/claude-message.d.ts +218 -0
- package/esm/models/claude-message.js +6 -0
- package/esm/models/completionchoice.js +1 -0
- package/esm/models/completioncreateparams.js +1 -0
- package/esm/models/completionlogprobs.js +1 -0
- package/esm/models/completionresponse.js +1 -0
- package/esm/models/completionusage.js +1 -0
- package/esm/models/createchargerequest.js +1 -0
- package/esm/models/datacollection.js +1 -0
- package/esm/models/defaultparameters.js +1 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.js +1 -0
- package/esm/models/endpointstatus.js +1 -0
- package/esm/models/errors/badgatewayresponseerror.js +1 -0
- package/esm/models/errors/badrequestresponseerror.js +1 -0
- package/esm/models/errors/chaterror.js +1 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +1 -0
- package/esm/models/errors/forbiddenresponseerror.js +1 -0
- package/esm/models/errors/httpclienterrors.js +1 -0
- package/esm/models/errors/index.js +1 -0
- package/esm/models/errors/internalserverresponseerror.js +1 -0
- package/esm/models/errors/notfoundresponseerror.js +1 -0
- package/esm/models/errors/openrouterdefaulterror.js +1 -0
- package/esm/models/errors/openroutererror.js +1 -0
- package/esm/models/errors/payloadtoolargeresponseerror.js +1 -0
- package/esm/models/errors/paymentrequiredresponseerror.js +1 -0
- package/esm/models/errors/provideroverloadedresponseerror.js +1 -0
- package/esm/models/errors/requesttimeoutresponseerror.js +1 -0
- package/esm/models/errors/responsevalidationerror.js +1 -0
- package/esm/models/errors/sdkvalidationerror.js +1 -0
- package/esm/models/errors/serviceunavailableresponseerror.js +1 -0
- package/esm/models/errors/toomanyrequestsresponseerror.js +1 -0
- package/esm/models/errors/unauthorizedresponseerror.js +1 -0
- package/esm/models/errors/unprocessableentityresponseerror.js +1 -0
- package/esm/models/filecitation.js +1 -0
- package/esm/models/filepath.js +1 -0
- package/esm/models/forbiddenresponseerrordata.js +1 -0
- package/esm/models/imagegenerationstatus.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +2 -0
- package/esm/models/inputmodality.js +1 -0
- package/esm/models/instructtype.js +1 -0
- package/esm/models/internalserverresponseerrordata.js +1 -0
- package/esm/models/jsonschemaconfig.js +1 -0
- package/esm/models/listendpointsresponse.js +1 -0
- package/esm/models/message.js +1 -0
- package/esm/models/model.js +1 -0
- package/esm/models/modelarchitecture.js +1 -0
- package/esm/models/modelgroup.js +1 -0
- package/esm/models/modelscountresponse.js +1 -0
- package/esm/models/modelslistresponse.js +1 -0
- package/esm/models/namedtoolchoice.js +1 -0
- package/esm/models/notfoundresponseerrordata.js +1 -0
- package/esm/models/openairesponsesannotation.js +1 -0
- package/esm/models/openairesponsesincludable.js +1 -0
- package/esm/models/openairesponsesincompletedetails.js +1 -0
- package/esm/models/openairesponsesinputunion.js +1 -0
- package/esm/models/openairesponsesprompt.js +1 -0
- package/esm/models/openairesponsesreasoningconfig.js +1 -0
- package/esm/models/openairesponsesreasoningeffort.js +1 -0
- package/esm/models/openairesponsesrefusalcontent.js +1 -0
- package/esm/models/openairesponsesresponsestatus.js +1 -0
- package/esm/models/openairesponsesservicetier.js +1 -0
- package/esm/models/openairesponsestoolchoiceunion.js +1 -0
- package/esm/models/openairesponsestruncation.js +1 -0
- package/esm/models/openresponseseasyinputmessage.js +1 -0
- package/esm/models/openresponseserrorevent.js +1 -0
- package/esm/models/openresponsesfunctioncalloutput.js +1 -0
- package/esm/models/openresponsesfunctiontoolcall.js +1 -0
- package/esm/models/openresponsesimagegencallcompleted.js +1 -0
- package/esm/models/openresponsesimagegencallgenerating.js +1 -0
- package/esm/models/openresponsesimagegencallinprogress.js +1 -0
- package/esm/models/openresponsesimagegencallpartialimage.js +1 -0
- package/esm/models/openresponsesinput.js +1 -0
- package/esm/models/openresponsesinputmessageitem.js +1 -0
- package/esm/models/openresponseslogprobs.js +1 -0
- package/esm/models/openresponsesnonstreamingresponse.js +1 -0
- package/esm/models/openresponsesreasoning.js +1 -0
- package/esm/models/openresponsesreasoningconfig.js +1 -0
- package/esm/models/openresponsesreasoningdeltaevent.js +1 -0
- package/esm/models/openresponsesreasoningdoneevent.js +1 -0
- package/esm/models/openresponsesreasoningsummarypartaddedevent.js +1 -0
- package/esm/models/openresponsesreasoningsummarytextdeltaevent.js +1 -0
- package/esm/models/openresponsesreasoningsummarytextdoneevent.js +1 -0
- package/esm/models/openresponsesrequest.js +1 -0
- package/esm/models/openresponsesresponsetext.js +1 -0
- package/esm/models/openresponsesstreamevent.js +1 -0
- package/esm/models/openresponsestoplogprobs.js +1 -0
- package/esm/models/openresponsesusage.js +1 -0
- package/esm/models/openresponseswebsearch20250826tool.js +1 -0
- package/esm/models/openresponseswebsearchpreview20250311tool.js +1 -0
- package/esm/models/openresponseswebsearchpreviewtool.js +1 -0
- package/esm/models/openresponseswebsearchtool.js +1 -0
- package/esm/models/operations/createauthkeyscode.js +1 -0
- package/esm/models/operations/createcoinbasecharge.js +1 -0
- package/esm/models/operations/createembeddings.js +1 -0
- package/esm/models/operations/createkeys.js +1 -0
- package/esm/models/operations/createresponses.js +1 -0
- package/esm/models/operations/deletekeys.js +1 -0
- package/esm/models/operations/exchangeauthcodeforapikey.js +1 -0
- package/esm/models/operations/getcredits.js +1 -0
- package/esm/models/operations/getcurrentkey.js +1 -0
- package/esm/models/operations/getgeneration.js +1 -0
- package/esm/models/operations/getkey.js +1 -0
- package/esm/models/operations/getmodels.js +1 -0
- package/esm/models/operations/getparameters.js +1 -0
- package/esm/models/operations/getuseractivity.js +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/list.js +1 -0
- package/esm/models/operations/listendpoints.js +1 -0
- package/esm/models/operations/listendpointszdr.js +1 -0
- package/esm/models/operations/listmodelsuser.js +1 -0
- package/esm/models/operations/listproviders.js +1 -0
- package/esm/models/operations/sendchatcompletionrequest.js +1 -0
- package/esm/models/operations/updatekeys.js +1 -0
- package/esm/models/outputitemimagegenerationcall.js +1 -0
- package/esm/models/outputmessage.js +1 -0
- package/esm/models/outputmodality.js +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/payloadtoolargeresponseerrordata.js +1 -0
- package/esm/models/paymentrequiredresponseerrordata.js +1 -0
- package/esm/models/pdfparserengine.js +1 -0
- package/esm/models/pdfparseroptions.js +1 -0
- package/esm/models/perrequestlimits.js +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroverloadedresponseerrordata.js +1 -0
- package/esm/models/providerpreferences.js +1 -0
- package/esm/models/providersort.js +1 -0
- package/esm/models/providersortconfig.js +1 -0
- package/esm/models/providersortunion.js +1 -0
- package/esm/models/publicendpoint.js +1 -0
- package/esm/models/publicpricing.js +1 -0
- package/esm/models/quantization.js +1 -0
- package/esm/models/reasoningsummarytext.js +1 -0
- package/esm/models/reasoningsummaryverbosity.js +1 -0
- package/esm/models/reasoningtextcontent.js +1 -0
- package/esm/models/requesttimeoutresponseerrordata.js +1 -0
- package/esm/models/responseformatjsonschema.js +1 -0
- package/esm/models/responseformattextconfig.js +1 -0
- package/esm/models/responseformattextgrammar.js +1 -0
- package/esm/models/responseinputaudio.js +1 -0
- package/esm/models/responseinputfile.js +1 -0
- package/esm/models/responseinputimage.js +1 -0
- package/esm/models/responseinputtext.js +1 -0
- package/esm/models/responseoutputtext.js +1 -0
- package/esm/models/responseserrorfield.js +1 -0
- package/esm/models/responsesformatjsonobject.js +1 -0
- package/esm/models/responsesformattext.js +1 -0
- package/esm/models/responsesformattextjsonschemaconfig.js +1 -0
- package/esm/models/responsesimagegenerationcall.js +1 -0
- package/esm/models/responsesoutputitem.js +1 -0
- package/esm/models/responsesoutputitemfilesearchcall.js +1 -0
- package/esm/models/responsesoutputitemfunctioncall.js +1 -0
- package/esm/models/responsesoutputitemreasoning.js +1 -0
- package/esm/models/responsesoutputmessage.js +1 -0
- package/esm/models/responsessearchcontextsize.js +1 -0
- package/esm/models/responseswebsearchcalloutput.js +1 -0
- package/esm/models/responseswebsearchuserlocation.js +1 -0
- package/esm/models/responsetextconfig.js +1 -0
- package/esm/models/schema0.js +1 -0
- package/esm/models/schema3.js +1 -0
- package/esm/models/security.js +1 -0
- package/esm/models/serviceunavailableresponseerrordata.js +1 -0
- package/esm/models/systemmessage.js +1 -0
- package/esm/models/toolcallstatus.js +1 -0
- package/esm/models/tooldefinitionjson.js +1 -0
- package/esm/models/toolresponsemessage.js +1 -0
- package/esm/models/toomanyrequestsresponseerrordata.js +1 -0
- package/esm/models/topproviderinfo.js +1 -0
- package/esm/models/unauthorizedresponseerrordata.js +1 -0
- package/esm/models/unprocessableentityresponseerrordata.js +1 -0
- package/esm/models/urlcitation.js +1 -0
- package/esm/models/usermessage.js +1 -0
- package/esm/models/websearchengine.js +1 -0
- package/esm/models/websearchpreviewtooluserlocation.js +1 -0
- package/esm/models/websearchstatus.js +1 -0
- package/esm/sdk/analytics.js +1 -0
- package/esm/sdk/apikeys.js +1 -0
- package/esm/sdk/beta.js +1 -0
- package/esm/sdk/chat.js +1 -0
- package/esm/sdk/completions.js +1 -0
- package/esm/sdk/credits.js +1 -0
- package/esm/sdk/embeddings.js +1 -0
- package/esm/sdk/endpoints.js +1 -0
- package/esm/sdk/generations.js +1 -0
- package/esm/sdk/index.js +1 -0
- package/esm/sdk/models.js +1 -0
- package/esm/sdk/oauth.js +1 -0
- package/esm/sdk/parameters.js +1 -0
- package/esm/sdk/providers.js +1 -0
- package/esm/sdk/responses.js +1 -0
- package/esm/sdk/sdk.d.ts +3 -3
- package/esm/sdk/sdk.js +2 -1
- package/esm/types/async.js +1 -0
- package/esm/types/blobs.js +1 -0
- package/esm/types/constdatetime.js +1 -0
- package/esm/types/discriminatedUnion.js +1 -0
- package/esm/types/enums.js +1 -0
- package/esm/types/fp.js +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/operations.js +1 -0
- package/esm/types/rfcdate.js +1 -0
- package/esm/types/streams.js +1 -0
- package/esm/types/unrecognized.js +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/esm/funcs/callModel.d.ts +0 -87
- package/esm/funcs/callModel.js +0 -215
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reason why the model stopped generating.
|
|
3
|
+
*/
|
|
4
|
+
export type ClaudeStopReason = "end_turn" | "max_tokens" | "stop_sequence" | "tool_use" | "pause_turn" | "refusal";
|
|
5
|
+
/**
|
|
6
|
+
* Character-level citation location within a document.
|
|
7
|
+
*/
|
|
8
|
+
export type ClaudeCitationCharLocation = {
|
|
9
|
+
type: "char_location";
|
|
10
|
+
cited_text: string;
|
|
11
|
+
document_index: number;
|
|
12
|
+
document_title: string;
|
|
13
|
+
file_id: string;
|
|
14
|
+
start_char_index: number;
|
|
15
|
+
end_char_index: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Page-level citation location within a document.
|
|
19
|
+
*/
|
|
20
|
+
export type ClaudeCitationPageLocation = {
|
|
21
|
+
type: "page_location";
|
|
22
|
+
cited_text: string;
|
|
23
|
+
document_index: number;
|
|
24
|
+
document_title: string;
|
|
25
|
+
file_id: string;
|
|
26
|
+
start_page_number: number;
|
|
27
|
+
end_page_number: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Content block citation location within a document.
|
|
31
|
+
*/
|
|
32
|
+
export type ClaudeCitationContentBlockLocation = {
|
|
33
|
+
type: "content_block_location";
|
|
34
|
+
cited_text: string;
|
|
35
|
+
document_index: number;
|
|
36
|
+
document_title: string;
|
|
37
|
+
file_id: string;
|
|
38
|
+
start_block_index: number;
|
|
39
|
+
end_block_index: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Web search result citation location.
|
|
43
|
+
*/
|
|
44
|
+
export type ClaudeCitationWebSearchResultLocation = {
|
|
45
|
+
type: "web_search_result_location";
|
|
46
|
+
cited_text: string;
|
|
47
|
+
title: string;
|
|
48
|
+
url: string;
|
|
49
|
+
encrypted_index: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Search result citation location.
|
|
53
|
+
*/
|
|
54
|
+
export type ClaudeCitationSearchResultLocation = {
|
|
55
|
+
type: "search_result_location";
|
|
56
|
+
cited_text: string;
|
|
57
|
+
title: string;
|
|
58
|
+
source: string;
|
|
59
|
+
start_block_index: number;
|
|
60
|
+
end_block_index: number;
|
|
61
|
+
search_result_index: number;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Union of all text citation types.
|
|
65
|
+
*/
|
|
66
|
+
export type ClaudeTextCitation = ClaudeCitationCharLocation | ClaudeCitationPageLocation | ClaudeCitationContentBlockLocation | ClaudeCitationWebSearchResultLocation | ClaudeCitationSearchResultLocation;
|
|
67
|
+
/**
|
|
68
|
+
* Text content block.
|
|
69
|
+
*/
|
|
70
|
+
export type ClaudeTextBlock = {
|
|
71
|
+
type: "text";
|
|
72
|
+
text: string;
|
|
73
|
+
citations?: ClaudeTextCitation[];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Extended thinking content block.
|
|
77
|
+
*/
|
|
78
|
+
export type ClaudeThinkingBlock = {
|
|
79
|
+
type: "thinking";
|
|
80
|
+
thinking: string;
|
|
81
|
+
signature: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Redacted thinking content block.
|
|
85
|
+
*/
|
|
86
|
+
export type ClaudeRedactedThinkingBlock = {
|
|
87
|
+
type: "redacted_thinking";
|
|
88
|
+
data: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Tool use content block.
|
|
92
|
+
*/
|
|
93
|
+
export type ClaudeToolUseBlock = {
|
|
94
|
+
type: "tool_use";
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
input: Record<string, unknown>;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Server-side tool use content block (e.g., web_search).
|
|
101
|
+
*/
|
|
102
|
+
export type ClaudeServerToolUseBlock = {
|
|
103
|
+
type: "server_tool_use";
|
|
104
|
+
id: string;
|
|
105
|
+
name: "web_search";
|
|
106
|
+
input: Record<string, unknown>;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Union of all content block types.
|
|
110
|
+
*/
|
|
111
|
+
export type ClaudeContentBlock = ClaudeTextBlock | ClaudeThinkingBlock | ClaudeRedactedThinkingBlock | ClaudeToolUseBlock | ClaudeServerToolUseBlock;
|
|
112
|
+
/**
|
|
113
|
+
* Token usage information.
|
|
114
|
+
*/
|
|
115
|
+
export type ClaudeUsage = {
|
|
116
|
+
input_tokens: number;
|
|
117
|
+
output_tokens: number;
|
|
118
|
+
cache_creation_input_tokens?: number;
|
|
119
|
+
cache_read_input_tokens?: number;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Claude Message response format compatible with the Anthropic SDK.
|
|
123
|
+
* This represents a complete assistant response from the Claude API.
|
|
124
|
+
*/
|
|
125
|
+
export type ClaudeMessage = {
|
|
126
|
+
id: string;
|
|
127
|
+
type: "message";
|
|
128
|
+
role: "assistant";
|
|
129
|
+
model: string;
|
|
130
|
+
content: ClaudeContentBlock[];
|
|
131
|
+
stop_reason: ClaudeStopReason | null;
|
|
132
|
+
stop_sequence?: string | null;
|
|
133
|
+
usage: ClaudeUsage;
|
|
134
|
+
/** Unmappable content preserved for lossless round-trips */
|
|
135
|
+
unsupported_content?: UnsupportedContent[];
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Cache control for prompt caching.
|
|
139
|
+
*/
|
|
140
|
+
export type ClaudeCacheControl = {
|
|
141
|
+
type: "ephemeral";
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Text content block parameter for input.
|
|
145
|
+
*/
|
|
146
|
+
export type ClaudeTextBlockParam = {
|
|
147
|
+
type: "text";
|
|
148
|
+
text: string;
|
|
149
|
+
cache_control?: ClaudeCacheControl | null;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Base64-encoded image source.
|
|
153
|
+
*/
|
|
154
|
+
export type ClaudeBase64ImageSource = {
|
|
155
|
+
type: "base64";
|
|
156
|
+
media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
|
|
157
|
+
data: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* URL-based image source.
|
|
161
|
+
*/
|
|
162
|
+
export type ClaudeURLImageSource = {
|
|
163
|
+
type: "url";
|
|
164
|
+
url: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Image content block parameter for input.
|
|
168
|
+
*/
|
|
169
|
+
export type ClaudeImageBlockParam = {
|
|
170
|
+
type: "image";
|
|
171
|
+
source: ClaudeBase64ImageSource | ClaudeURLImageSource;
|
|
172
|
+
cache_control?: ClaudeCacheControl | null;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Tool use content block parameter for input (when passing assistant's tool use back).
|
|
176
|
+
*/
|
|
177
|
+
export type ClaudeToolUseBlockParam = {
|
|
178
|
+
type: "tool_use";
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
input: Record<string, unknown>;
|
|
182
|
+
cache_control?: ClaudeCacheControl | null;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Tool result content block parameter for input.
|
|
186
|
+
*/
|
|
187
|
+
export type ClaudeToolResultBlockParam = {
|
|
188
|
+
type: "tool_result";
|
|
189
|
+
tool_use_id: string;
|
|
190
|
+
content: string | Array<ClaudeTextBlockParam | ClaudeImageBlockParam>;
|
|
191
|
+
is_error?: boolean;
|
|
192
|
+
cache_control?: ClaudeCacheControl | null;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Union of all input content block types.
|
|
196
|
+
*/
|
|
197
|
+
export type ClaudeContentBlockParam = ClaudeTextBlockParam | ClaudeImageBlockParam | ClaudeToolUseBlockParam | ClaudeToolResultBlockParam;
|
|
198
|
+
/**
|
|
199
|
+
* Claude MessageParam input format compatible with the Anthropic SDK.
|
|
200
|
+
* This represents a message in a conversation for the Claude API.
|
|
201
|
+
*/
|
|
202
|
+
export type ClaudeMessageParam = {
|
|
203
|
+
role: "user" | "assistant";
|
|
204
|
+
content: string | Array<ClaudeContentBlockParam>;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Container for content that cannot be mapped to Claude's native format.
|
|
208
|
+
* Preserves information for round-trip conversions.
|
|
209
|
+
*/
|
|
210
|
+
export type UnsupportedContent = {
|
|
211
|
+
/** Original type from source format (e.g., "image_generation_call", "refusal") */
|
|
212
|
+
original_type: string;
|
|
213
|
+
/** Complete original data structure */
|
|
214
|
+
data: Record<string, unknown>;
|
|
215
|
+
/** Optional explanation of why this couldn't be mapped */
|
|
216
|
+
reason?: string;
|
|
217
|
+
};
|
|
218
|
+
//# sourceMappingURL=claude-message.d.ts.map
|
package/esm/models/filepath.js
CHANGED
package/esm/models/index.d.ts
CHANGED
package/esm/models/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f93644b0f37e
|
|
3
4
|
*/
|
|
4
5
|
export * from "./activityitem.js";
|
|
5
6
|
export * from "./assistantmessage.js";
|
|
@@ -153,4 +154,5 @@ export * from "./usermessage.js";
|
|
|
153
154
|
export * from "./websearchengine.js";
|
|
154
155
|
export * from "./websearchpreviewtooluserlocation.js";
|
|
155
156
|
export * from "./websearchstatus.js";
|
|
157
|
+
export * from "./claude-message.js";
|
|
156
158
|
//# sourceMappingURL=index.js.map
|
package/esm/models/message.js
CHANGED
package/esm/models/model.js
CHANGED
package/esm/models/modelgroup.js
CHANGED