@keystrokehq/openrouter 0.1.2 → 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/actions/create-chat-completion.cjs +11 -11
- package/dist/actions/create-chat-completion.cjs.map +1 -1
- package/dist/actions/create-chat-completion.d.cts +15 -13
- package/dist/actions/create-chat-completion.d.mts +15 -13
- package/dist/actions/create-chat-completion.mjs +11 -11
- package/dist/actions/create-chat-completion.mjs.map +1 -1
- package/dist/actions/create-coinbase-charge.cjs +3 -3
- package/dist/actions/create-coinbase-charge.cjs.map +1 -1
- package/dist/actions/create-coinbase-charge.d.cts +3 -3
- package/dist/actions/create-coinbase-charge.d.mts +3 -3
- package/dist/actions/create-coinbase-charge.mjs +3 -3
- package/dist/actions/create-coinbase-charge.mjs.map +1 -1
- package/dist/actions/create-message.cjs +7 -7
- package/dist/actions/create-message.cjs.map +1 -1
- package/dist/actions/create-message.d.cts +11 -7
- package/dist/actions/create-message.d.mts +11 -7
- package/dist/actions/create-message.mjs +7 -7
- package/dist/actions/create-message.mjs.map +1 -1
- package/dist/actions/get-credits.cjs +2 -2
- package/dist/actions/get-credits.cjs.map +1 -1
- package/dist/actions/get-credits.d.cts +2 -2
- package/dist/actions/get-credits.d.mts +2 -2
- package/dist/actions/get-credits.mjs +2 -2
- package/dist/actions/get-credits.mjs.map +1 -1
- package/dist/actions/get-current-key.cjs +3 -3
- package/dist/actions/get-current-key.cjs.map +1 -1
- package/dist/actions/get-current-key.d.cts +3 -3
- package/dist/actions/get-current-key.d.mts +3 -3
- package/dist/actions/get-current-key.mjs +3 -3
- package/dist/actions/get-current-key.mjs.map +1 -1
- package/dist/actions/get-generation.cjs +2 -2
- package/dist/actions/get-generation.cjs.map +1 -1
- package/dist/actions/get-generation.d.cts +2 -2
- package/dist/actions/get-generation.d.mts +2 -2
- package/dist/actions/get-generation.mjs +2 -2
- package/dist/actions/get-generation.mjs.map +1 -1
- package/dist/actions/get-models-count.cjs +2 -2
- package/dist/actions/get-models-count.cjs.map +1 -1
- package/dist/actions/get-models-count.d.cts +2 -2
- package/dist/actions/get-models-count.d.mts +2 -2
- package/dist/actions/get-models-count.mjs +2 -2
- package/dist/actions/get-models-count.mjs.map +1 -1
- package/dist/actions/list-available-models.cjs +7 -7
- package/dist/actions/list-available-models.cjs.map +1 -1
- package/dist/actions/list-available-models.d.cts +7 -7
- package/dist/actions/list-available-models.d.mts +7 -7
- package/dist/actions/list-available-models.mjs +7 -7
- package/dist/actions/list-available-models.mjs.map +1 -1
- package/dist/actions/list-embedding-models.cjs +7 -7
- package/dist/actions/list-embedding-models.cjs.map +1 -1
- package/dist/actions/list-embedding-models.d.cts +7 -7
- package/dist/actions/list-embedding-models.d.mts +7 -7
- package/dist/actions/list-embedding-models.mjs +7 -7
- package/dist/actions/list-embedding-models.mjs.map +1 -1
- package/dist/actions/list-model-endpoints.cjs +5 -5
- package/dist/actions/list-model-endpoints.cjs.map +1 -1
- package/dist/actions/list-model-endpoints.d.cts +5 -5
- package/dist/actions/list-model-endpoints.d.mts +5 -5
- package/dist/actions/list-model-endpoints.mjs +5 -5
- package/dist/actions/list-model-endpoints.mjs.map +1 -1
- package/dist/actions/list-providers.cjs +1 -1
- package/dist/actions/list-providers.cjs.map +1 -1
- package/dist/actions/list-providers.d.cts +1 -1
- package/dist/actions/list-providers.d.mts +1 -1
- package/dist/actions/list-providers.mjs +1 -1
- package/dist/actions/list-providers.mjs.map +1 -1
- package/dist/actions/list-user-models.cjs +7 -7
- package/dist/actions/list-user-models.cjs.map +1 -1
- package/dist/actions/list-user-models.d.cts +7 -7
- package/dist/actions/list-user-models.d.mts +7 -7
- package/dist/actions/list-user-models.mjs +7 -7
- package/dist/actions/list-user-models.mjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.cjs +5 -5
- package/dist/actions/list-zdr-endpoints.cjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.d.cts +5 -5
- package/dist/actions/list-zdr-endpoints.d.mts +5 -5
- package/dist/actions/list-zdr-endpoints.mjs +5 -5
- package/dist/actions/list-zdr-endpoints.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -16,16 +16,16 @@ const OpenrouterCreateChatCompletionInput = zod.z.object({
|
|
|
16
16
|
"tool"
|
|
17
17
|
]).describe("Role of the message sender."),
|
|
18
18
|
content: zod.z.string().describe("Content of the message.")
|
|
19
|
-
})).describe("List of conversation messages to provide as context."),
|
|
19
|
+
}).passthrough()).describe("List of conversation messages to provide as context."),
|
|
20
20
|
functions: zod.z.array(zod.z.object({
|
|
21
21
|
name: zod.z.string().describe("Name of the function to be called by the model."),
|
|
22
22
|
parameters: zod.z.record(zod.z.string(), zod.z.unknown()).describe("JSON schema describing function parameters."),
|
|
23
23
|
description: zod.z.string().describe("Description of the function purpose.").optional()
|
|
24
|
-
})).describe("List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.").optional(),
|
|
25
|
-
logit_bias: zod.z.
|
|
24
|
+
}).passthrough()).describe("List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.").optional(),
|
|
25
|
+
logit_bias: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Adjust the likelihood of specified tokens.").optional(),
|
|
26
26
|
max_tokens: zod.z.number().int().describe("Maximum number of tokens to generate.").optional(),
|
|
27
27
|
temperature: zod.z.number().describe("Sampling temperature to use, between 0 and 2.").optional(),
|
|
28
|
-
function_call: zod.z.union([zod.z.enum(["none", "auto"]), zod.z.
|
|
28
|
+
function_call: zod.z.union([zod.z.enum(["none", "auto"]), zod.z.record(zod.z.string(), zod.z.unknown())]).optional(),
|
|
29
29
|
presence_penalty: zod.z.number().describe("Penalty for new tokens based on presence in the text so far.").optional(),
|
|
30
30
|
frequency_penalty: zod.z.number().describe("Penalty for new tokens based on frequency in the text so far.").optional()
|
|
31
31
|
});
|
|
@@ -33,32 +33,32 @@ const OpenrouterCreateChatCompletion_UsageSchema = zod.z.object({
|
|
|
33
33
|
total_tokens: zod.z.number().int().describe("Total number of tokens used.").nullable(),
|
|
34
34
|
prompt_tokens: zod.z.number().int().describe("Number of tokens in the prompt.").nullable(),
|
|
35
35
|
completion_tokens: zod.z.number().int().describe("Number of tokens generated in the completion.").nullable()
|
|
36
|
-
});
|
|
36
|
+
}).passthrough();
|
|
37
37
|
const OpenrouterCreateChatCompletion_ErrorResponseSchema = zod.z.object({
|
|
38
38
|
code: zod.z.number().int().describe("Error code from the provider.").nullable(),
|
|
39
39
|
message: zod.z.string().describe("Error message from the provider.").nullable(),
|
|
40
40
|
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Additional error information.").nullable().optional()
|
|
41
|
-
});
|
|
41
|
+
}).passthrough();
|
|
42
42
|
const OpenrouterCreateChatCompletion_FunctionCallSchema = zod.z.object({
|
|
43
43
|
name: zod.z.string().describe("Name of the function called by the model.").nullable(),
|
|
44
44
|
arguments: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Arguments provided to the function call.")
|
|
45
|
-
});
|
|
45
|
+
}).passthrough();
|
|
46
46
|
const OpenrouterCreateChatCompletion_ToolCallSchema = zod.z.object({
|
|
47
47
|
id: zod.z.string().describe("Unique identifier for this tool call.").nullable(),
|
|
48
48
|
type: zod.z.string().describe("Type of the call (function).").nullable(),
|
|
49
49
|
"function": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable()
|
|
50
|
-
});
|
|
50
|
+
}).passthrough();
|
|
51
51
|
const OpenrouterCreateChatCompletion_ChoiceMessageSchema = zod.z.object({
|
|
52
52
|
role: zod.z.string().describe("Role of the generated message content.").nullable(),
|
|
53
53
|
content: zod.z.string().describe("Content of the generated message.").nullable().optional(),
|
|
54
54
|
tool_calls: zod.z.array(OpenrouterCreateChatCompletion_ToolCallSchema).describe("Tool calls triggered by the model.").nullable().optional()
|
|
55
|
-
});
|
|
55
|
+
}).passthrough();
|
|
56
56
|
const OpenrouterCreateChatCompletion_CreateChoiceSchema = zod.z.object({
|
|
57
57
|
error: OpenrouterCreateChatCompletion_ErrorResponseSchema.nullable().optional(),
|
|
58
58
|
message: OpenrouterCreateChatCompletion_ChoiceMessageSchema.nullable(),
|
|
59
59
|
finish_reason: zod.z.string().describe("The reason why the completion finished.").nullable().optional(),
|
|
60
60
|
native_finish_reason: zod.z.string().describe("Provider-specific finish reason.").nullable().optional()
|
|
61
|
-
});
|
|
61
|
+
}).passthrough();
|
|
62
62
|
const OpenrouterCreateChatCompletionOutput = zod.z.object({
|
|
63
63
|
id: zod.z.string().describe("Unique identifier for the completion.").nullable(),
|
|
64
64
|
model: zod.z.string().describe("Model ID used for the completion.").nullable(),
|
|
@@ -67,7 +67,7 @@ const OpenrouterCreateChatCompletionOutput = zod.z.object({
|
|
|
67
67
|
choices: zod.z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe("List of generated completion choices."),
|
|
68
68
|
created: zod.z.number().int().describe("Unix timestamp when the completion was created.").nullable(),
|
|
69
69
|
system_fingerprint: zod.z.string().describe("Provider fingerprint if supported.").nullable().optional()
|
|
70
|
-
});
|
|
70
|
+
}).passthrough();
|
|
71
71
|
const openrouterCreateChatCompletion = require_action.action("OPENROUTER_CREATE_CHAT_COMPLETION", {
|
|
72
72
|
slug: "openrouter-create-chat-completion",
|
|
73
73
|
name: "Create Chat Completion",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-chat-completion.cjs","names":["z","action"],"sources":["../../src/actions/create-chat-completion.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateChatCompletionInput = z.object({\n n: z.number().int().describe(\"Number of completion choices to generate.\").optional(),\n stop: z.union([z.string(), z.array(z.string())]).optional(),\n user: z.string().describe(\"A unique identifier for the end-user to help detect abuse.\").optional(),\n model: z.string().describe(\"ID of the model to use for the chat completion. Must exactly match an ID returned by OPENROUTER_LIST_AVAILABLE_MODELS; typos or approximate names cause request failures.\"),\n top_p: z.number().describe(\"Nucleus sampling probability, between 0 and 1.\").optional(),\n stream: z.boolean().default(false).describe(\"Whether to stream back partial message deltas.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"system\", \"user\", \"assistant\", \"tool\"]).describe(\"Role of the message sender.\"),\n content: z.string().describe(\"Content of the message.\"),\n})).describe(\"List of conversation messages to provide as context.\"),\n functions: z.array(z.object({\n name: z.string().describe(\"Name of the function to be called by the model.\"),\n parameters: z.record(z.string(), z.unknown()).describe(\"JSON schema describing function parameters.\"),\n description: z.string().describe(\"Description of the function purpose.\").optional(),\n})).describe(\"List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.\").optional(),\n logit_bias: z.object({}).describe(\"Adjust the likelihood of specified tokens.\").optional(),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate.\").optional(),\n temperature: z.number().describe(\"Sampling temperature to use, between 0 and 2.\").optional(),\n function_call: z.union([z.enum([\"none\", \"auto\"]), z.object({})]).optional(),\n presence_penalty: z.number().describe(\"Penalty for new tokens based on presence in the text so far.\").optional(),\n frequency_penalty: z.number().describe(\"Penalty for new tokens based on frequency in the text so far.\").optional(),\n});\nconst OpenrouterCreateChatCompletion_UsageSchema = z.object({\n total_tokens: z.number().int().describe(\"Total number of tokens used.\").nullable(),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the prompt.\").nullable(),\n completion_tokens: z.number().int().describe(\"Number of tokens generated in the completion.\").nullable(),\n});\nconst OpenrouterCreateChatCompletion_ErrorResponseSchema = z.object({\n code: z.number().int().describe(\"Error code from the provider.\").nullable(),\n message: z.string().describe(\"Error message from the provider.\").nullable(),\n metadata: z.record(z.string(), z.unknown()).describe(\"Additional error information.\").nullable().optional(),\n});\nconst OpenrouterCreateChatCompletion_FunctionCallSchema = z.object({\n name: z.string().describe(\"Name of the function called by the model.\").nullable(),\n arguments: z.record(z.string(), z.unknown()).describe(\"Arguments provided to the function call.\"),\n});\nconst OpenrouterCreateChatCompletion_ToolCallSchema = z.object({\n id: z.string().describe(\"Unique identifier for this tool call.\").nullable(),\n type: z.string().describe(\"Type of the call (function).\").nullable(),\n \"function\": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable(),\n});\nconst OpenrouterCreateChatCompletion_ChoiceMessageSchema = z.object({\n role: z.string().describe(\"Role of the generated message content.\").nullable(),\n content: z.string().describe(\"Content of the generated message.\").nullable().optional(),\n tool_calls: z.array(OpenrouterCreateChatCompletion_ToolCallSchema).describe(\"Tool calls triggered by the model.\").nullable().optional(),\n});\nconst OpenrouterCreateChatCompletion_CreateChoiceSchema = z.object({\n error: OpenrouterCreateChatCompletion_ErrorResponseSchema.nullable().optional(),\n message: OpenrouterCreateChatCompletion_ChoiceMessageSchema.nullable(),\n finish_reason: z.string().describe(\"The reason why the completion finished.\").nullable().optional(),\n native_finish_reason: z.string().describe(\"Provider-specific finish reason.\").nullable().optional(),\n});\nexport const OpenrouterCreateChatCompletionOutput = z.object({\n id: z.string().describe(\"Unique identifier for the completion.\").nullable(),\n model: z.string().describe(\"Model ID used for the completion.\").nullable(),\n usage: OpenrouterCreateChatCompletion_UsageSchema.nullable().optional(),\n object: z.enum([\"chat.completion\", \"chat.completion.chunk\"]).describe(\"Object type returned.\").nullable(),\n choices: z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe(\"List of generated completion choices.\"),\n created: z.number().int().describe(\"Unix timestamp when the completion was created.\").nullable(),\n system_fingerprint: z.string().describe(\"Provider fingerprint if supported.\").nullable().optional(),\n});\n\nexport const openrouterCreateChatCompletion = action(\"OPENROUTER_CREATE_CHAT_COMPLETION\", {\n slug: \"openrouter-create-chat-completion\",\n name: \"Create Chat Completion\",\n description: \"Tool to generate a chat-style completion. Use after assembling messages and selecting a model. Supports streaming and function calls. Response format varies across models; use explicit prompt instructions to standardize output. Provider-level rate limits and moderation policies differ per model.\",\n input: OpenrouterCreateChatCompletionInput,\n output: OpenrouterCreateChatCompletionOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsCA,IAAAA,EAAE,OAAO;CAC1D,GAAGA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,2CAA2C,CAAC,CAAC,SAAS;CACnF,MAAMA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;CAC1D,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4DAA4D,CAAC,CAAC,SAAS;CACjG,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,2KAA2K;CACtM,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CACtF,QAAQA,IAAAA,EAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CACvG,UAAUA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO;EAC3B,MAAMA,IAAAA,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAa;EAAM,CAAC,CAAC,CAAC,SAAS,6BAA6B;EAC5F,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CACxD,CAAC,CAAC,CAAC,CAAC,SAAS,sDAAsD;CACjE,WAAWA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO;EAC5B,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iDAAiD;EAC3E,YAAYA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,6CAA6C;EACpG,aAAaA,IAAAA,EAAE,O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C,CAAC,SAAS,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC;AACD,MAAa,uCAAuCA,IAAAA,EAAE,OAAO;CAC3D,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;CAC1E,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;CACzE,OAAO,2CAA2C,SAAS,CAAC,CAAC,SAAS;CACtE,QAAQA,IAAAA,EAAE,KAAK,CAAC,mBAAmB,uBAAuB,CAAC,CAAC,CAAC,SAAS,uBAAuB,CAAC,CAAC,SAAS;CACxG,SAASA,IAAAA,EAAE,MAAM,iDAAiD,CAAC,CAAC,SAAS,uCAAuC;CACpH,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,iDAAiD,CAAC,CAAC,SAAS;CAC/F,oBAAoBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC;AAED,MAAa,iCAAiCC,eAAAA,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"create-chat-completion.cjs","names":["z","action"],"sources":["../../src/actions/create-chat-completion.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateChatCompletionInput = z.object({\n n: z.number().int().describe(\"Number of completion choices to generate.\").optional(),\n stop: z.union([z.string(), z.array(z.string())]).optional(),\n user: z.string().describe(\"A unique identifier for the end-user to help detect abuse.\").optional(),\n model: z.string().describe(\"ID of the model to use for the chat completion. Must exactly match an ID returned by OPENROUTER_LIST_AVAILABLE_MODELS; typos or approximate names cause request failures.\"),\n top_p: z.number().describe(\"Nucleus sampling probability, between 0 and 1.\").optional(),\n stream: z.boolean().default(false).describe(\"Whether to stream back partial message deltas.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"system\", \"user\", \"assistant\", \"tool\"]).describe(\"Role of the message sender.\"),\n content: z.string().describe(\"Content of the message.\"),\n}).passthrough()).describe(\"List of conversation messages to provide as context.\"),\n functions: z.array(z.object({\n name: z.string().describe(\"Name of the function to be called by the model.\"),\n parameters: z.record(z.string(), z.unknown()).describe(\"JSON schema describing function parameters.\"),\n description: z.string().describe(\"Description of the function purpose.\").optional(),\n}).passthrough()).describe(\"List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.\").optional(),\n logit_bias: z.record(z.string(), z.unknown()).describe(\"Adjust the likelihood of specified tokens.\").optional(),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate.\").optional(),\n temperature: z.number().describe(\"Sampling temperature to use, between 0 and 2.\").optional(),\n function_call: z.union([z.enum([\"none\", \"auto\"]), z.record(z.string(), z.unknown())]).optional(),\n presence_penalty: z.number().describe(\"Penalty for new tokens based on presence in the text so far.\").optional(),\n frequency_penalty: z.number().describe(\"Penalty for new tokens based on frequency in the text so far.\").optional(),\n});\nconst OpenrouterCreateChatCompletion_UsageSchema = z.object({\n total_tokens: z.number().int().describe(\"Total number of tokens used.\").nullable(),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the prompt.\").nullable(),\n completion_tokens: z.number().int().describe(\"Number of tokens generated in the completion.\").nullable(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ErrorResponseSchema = z.object({\n code: z.number().int().describe(\"Error code from the provider.\").nullable(),\n message: z.string().describe(\"Error message from the provider.\").nullable(),\n metadata: z.record(z.string(), z.unknown()).describe(\"Additional error information.\").nullable().optional(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_FunctionCallSchema = z.object({\n name: z.string().describe(\"Name of the function called by the model.\").nullable(),\n arguments: z.record(z.string(), z.unknown()).describe(\"Arguments provided to the function call.\"),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ToolCallSchema = z.object({\n id: z.string().describe(\"Unique identifier for this tool call.\").nullable(),\n type: z.string().describe(\"Type of the call (function).\").nullable(),\n \"function\": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ChoiceMessageSchema = z.object({\n role: z.string().describe(\"Role of the generated message content.\").nullable(),\n content: z.string().describe(\"Content of the generated message.\").nullable().optional(),\n tool_calls: z.array(OpenrouterCreateChatCompletion_ToolCallSchema).describe(\"Tool calls triggered by the model.\").nullable().optional(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_CreateChoiceSchema = z.object({\n error: OpenrouterCreateChatCompletion_ErrorResponseSchema.nullable().optional(),\n message: OpenrouterCreateChatCompletion_ChoiceMessageSchema.nullable(),\n finish_reason: z.string().describe(\"The reason why the completion finished.\").nullable().optional(),\n native_finish_reason: z.string().describe(\"Provider-specific finish reason.\").nullable().optional(),\n}).passthrough();\nexport const OpenrouterCreateChatCompletionOutput = z.object({\n id: z.string().describe(\"Unique identifier for the completion.\").nullable(),\n model: z.string().describe(\"Model ID used for the completion.\").nullable(),\n usage: OpenrouterCreateChatCompletion_UsageSchema.nullable().optional(),\n object: z.enum([\"chat.completion\", \"chat.completion.chunk\"]).describe(\"Object type returned.\").nullable(),\n choices: z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe(\"List of generated completion choices.\"),\n created: z.number().int().describe(\"Unix timestamp when the completion was created.\").nullable(),\n system_fingerprint: z.string().describe(\"Provider fingerprint if supported.\").nullable().optional(),\n}).passthrough();\n\nexport const openrouterCreateChatCompletion = action(\"OPENROUTER_CREATE_CHAT_COMPLETION\", {\n slug: \"openrouter-create-chat-completion\",\n name: \"Create Chat Completion\",\n description: \"Tool to generate a chat-style completion. Use after assembling messages and selecting a model. Supports streaming and function calls. Response format varies across models; use explicit prompt instructions to standardize output. Provider-level rate limits and moderation policies differ per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;CAC9E,SAAS,mDAAmD,SAAS;CACrE,eAAeA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yCAAyC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClG,sBAAsBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC,CAAC,CAAC,YAAY;AACf,MAAa,uCAAuCA,IAAAA,EAAE,OAAO;CAC3D,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;CAC1E,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;CACzE,OAAO,2CAA2C,SAAS,CAAC,CAAC,SAAS;CACtE,QAAQA,IAAAA,EAAE,KAAK,CAAC,mBAAmB,uBAAuB,CAAC,CAAC,CAAC,SAAS,uBAAuB,CAAC,CAAC,SAAS;CACxG,SAASA,IAAAA,EAAE,MAAM,iDAAiD,CAAC,CAAC,SAAS,uCAAuC;CACpH,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,iDAAiD,CAAC,CAAC,SAAS;CAC/F,oBAAoBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC,CAAC,CAAC,YAAY;AAEf,MAAa,iCAAiCC,eAAAA,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -16,19 +16,19 @@ declare const OpenrouterCreateChatCompletionInput: z.ZodObject<{
|
|
|
16
16
|
tool: "tool";
|
|
17
17
|
}>;
|
|
18
18
|
content: z.ZodString;
|
|
19
|
-
}, z.core.$
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
20
|
functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
21
|
name: z.ZodString;
|
|
22
22
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
23
|
description: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$
|
|
25
|
-
logit_bias: z.ZodOptional<z.
|
|
24
|
+
}, z.core.$loose>>>;
|
|
25
|
+
logit_bias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
26
|
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
27
27
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
28
28
|
function_call: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
29
29
|
none: "none";
|
|
30
30
|
auto: "auto";
|
|
31
|
-
}>, z.
|
|
31
|
+
}>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
32
32
|
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
}, z.core.$strip>;
|
|
@@ -39,7 +39,7 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
39
39
|
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
40
40
|
prompt_tokens: z.ZodNullable<z.ZodNumber>;
|
|
41
41
|
completion_tokens: z.ZodNullable<z.ZodNumber>;
|
|
42
|
-
}, z.core.$
|
|
42
|
+
}, z.core.$loose>>>;
|
|
43
43
|
object: z.ZodNullable<z.ZodEnum<{
|
|
44
44
|
"chat.completion": "chat.completion";
|
|
45
45
|
"chat.completion.chunk": "chat.completion.chunk";
|
|
@@ -49,7 +49,7 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
49
49
|
code: z.ZodNullable<z.ZodNumber>;
|
|
50
50
|
message: z.ZodNullable<z.ZodString>;
|
|
51
51
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
-
}, z.core.$
|
|
52
|
+
}, z.core.$loose>>>;
|
|
53
53
|
message: z.ZodNullable<z.ZodObject<{
|
|
54
54
|
role: z.ZodNullable<z.ZodString>;
|
|
55
55
|
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -59,18 +59,19 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
59
59
|
function: z.ZodNullable<z.ZodObject<{
|
|
60
60
|
name: z.ZodNullable<z.ZodString>;
|
|
61
61
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
-
}, z.core.$
|
|
63
|
-
}, z.core.$
|
|
64
|
-
}, z.core.$
|
|
62
|
+
}, z.core.$loose>>;
|
|
63
|
+
}, z.core.$loose>>>>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
65
65
|
finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
66
|
native_finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
-
}, z.core.$
|
|
67
|
+
}, z.core.$loose>>;
|
|
68
68
|
created: z.ZodNullable<z.ZodNumber>;
|
|
69
69
|
system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
-
}, z.core.$
|
|
70
|
+
}, z.core.$loose>;
|
|
71
71
|
declare const openrouterCreateChatCompletion: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
72
72
|
model: string;
|
|
73
73
|
messages: {
|
|
74
|
+
[x: string]: unknown;
|
|
74
75
|
role: "user" | "system" | "assistant" | "tool";
|
|
75
76
|
content: string;
|
|
76
77
|
}[];
|
|
@@ -80,14 +81,15 @@ declare const openrouterCreateChatCompletion: import("@keystrokehq/action").Work
|
|
|
80
81
|
top_p?: number | undefined;
|
|
81
82
|
stream?: boolean | undefined;
|
|
82
83
|
functions?: {
|
|
84
|
+
[x: string]: unknown;
|
|
83
85
|
name: string;
|
|
84
86
|
parameters: Record<string, unknown>;
|
|
85
87
|
description?: string | undefined;
|
|
86
88
|
}[] | undefined;
|
|
87
|
-
logit_bias?: Record<string,
|
|
89
|
+
logit_bias?: Record<string, unknown> | undefined;
|
|
88
90
|
max_tokens?: number | undefined;
|
|
89
91
|
temperature?: number | undefined;
|
|
90
|
-
function_call?: "none" | "auto" |
|
|
92
|
+
function_call?: Record<string, unknown> | "none" | "auto" | undefined;
|
|
91
93
|
presence_penalty?: number | undefined;
|
|
92
94
|
frequency_penalty?: number | undefined;
|
|
93
95
|
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
@@ -16,19 +16,19 @@ declare const OpenrouterCreateChatCompletionInput: z.ZodObject<{
|
|
|
16
16
|
tool: "tool";
|
|
17
17
|
}>;
|
|
18
18
|
content: z.ZodString;
|
|
19
|
-
}, z.core.$
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
20
|
functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
21
|
name: z.ZodString;
|
|
22
22
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
23
|
description: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$
|
|
25
|
-
logit_bias: z.ZodOptional<z.
|
|
24
|
+
}, z.core.$loose>>>;
|
|
25
|
+
logit_bias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
26
|
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
27
27
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
28
28
|
function_call: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
29
29
|
none: "none";
|
|
30
30
|
auto: "auto";
|
|
31
|
-
}>, z.
|
|
31
|
+
}>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
32
32
|
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
}, z.core.$strip>;
|
|
@@ -39,7 +39,7 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
39
39
|
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
40
40
|
prompt_tokens: z.ZodNullable<z.ZodNumber>;
|
|
41
41
|
completion_tokens: z.ZodNullable<z.ZodNumber>;
|
|
42
|
-
}, z.core.$
|
|
42
|
+
}, z.core.$loose>>>;
|
|
43
43
|
object: z.ZodNullable<z.ZodEnum<{
|
|
44
44
|
"chat.completion": "chat.completion";
|
|
45
45
|
"chat.completion.chunk": "chat.completion.chunk";
|
|
@@ -49,7 +49,7 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
49
49
|
code: z.ZodNullable<z.ZodNumber>;
|
|
50
50
|
message: z.ZodNullable<z.ZodString>;
|
|
51
51
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
-
}, z.core.$
|
|
52
|
+
}, z.core.$loose>>>;
|
|
53
53
|
message: z.ZodNullable<z.ZodObject<{
|
|
54
54
|
role: z.ZodNullable<z.ZodString>;
|
|
55
55
|
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -59,18 +59,19 @@ declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
|
59
59
|
function: z.ZodNullable<z.ZodObject<{
|
|
60
60
|
name: z.ZodNullable<z.ZodString>;
|
|
61
61
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
-
}, z.core.$
|
|
63
|
-
}, z.core.$
|
|
64
|
-
}, z.core.$
|
|
62
|
+
}, z.core.$loose>>;
|
|
63
|
+
}, z.core.$loose>>>>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
65
65
|
finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
66
|
native_finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
-
}, z.core.$
|
|
67
|
+
}, z.core.$loose>>;
|
|
68
68
|
created: z.ZodNullable<z.ZodNumber>;
|
|
69
69
|
system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
-
}, z.core.$
|
|
70
|
+
}, z.core.$loose>;
|
|
71
71
|
declare const openrouterCreateChatCompletion: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
72
72
|
model: string;
|
|
73
73
|
messages: {
|
|
74
|
+
[x: string]: unknown;
|
|
74
75
|
role: "user" | "system" | "assistant" | "tool";
|
|
75
76
|
content: string;
|
|
76
77
|
}[];
|
|
@@ -80,14 +81,15 @@ declare const openrouterCreateChatCompletion: import("@keystrokehq/action").Work
|
|
|
80
81
|
top_p?: number | undefined;
|
|
81
82
|
stream?: boolean | undefined;
|
|
82
83
|
functions?: {
|
|
84
|
+
[x: string]: unknown;
|
|
83
85
|
name: string;
|
|
84
86
|
parameters: Record<string, unknown>;
|
|
85
87
|
description?: string | undefined;
|
|
86
88
|
}[] | undefined;
|
|
87
|
-
logit_bias?: Record<string,
|
|
89
|
+
logit_bias?: Record<string, unknown> | undefined;
|
|
88
90
|
max_tokens?: number | undefined;
|
|
89
91
|
temperature?: number | undefined;
|
|
90
|
-
function_call?: "none" | "auto" |
|
|
92
|
+
function_call?: Record<string, unknown> | "none" | "auto" | undefined;
|
|
91
93
|
presence_penalty?: number | undefined;
|
|
92
94
|
frequency_penalty?: number | undefined;
|
|
93
95
|
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
@@ -16,16 +16,16 @@ const OpenrouterCreateChatCompletionInput = z.object({
|
|
|
16
16
|
"tool"
|
|
17
17
|
]).describe("Role of the message sender."),
|
|
18
18
|
content: z.string().describe("Content of the message.")
|
|
19
|
-
})).describe("List of conversation messages to provide as context."),
|
|
19
|
+
}).passthrough()).describe("List of conversation messages to provide as context."),
|
|
20
20
|
functions: z.array(z.object({
|
|
21
21
|
name: z.string().describe("Name of the function to be called by the model."),
|
|
22
22
|
parameters: z.record(z.string(), z.unknown()).describe("JSON schema describing function parameters."),
|
|
23
23
|
description: z.string().describe("Description of the function purpose.").optional()
|
|
24
|
-
})).describe("List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.").optional(),
|
|
25
|
-
logit_bias: z.
|
|
24
|
+
}).passthrough()).describe("List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.").optional(),
|
|
25
|
+
logit_bias: z.record(z.string(), z.unknown()).describe("Adjust the likelihood of specified tokens.").optional(),
|
|
26
26
|
max_tokens: z.number().int().describe("Maximum number of tokens to generate.").optional(),
|
|
27
27
|
temperature: z.number().describe("Sampling temperature to use, between 0 and 2.").optional(),
|
|
28
|
-
function_call: z.union([z.enum(["none", "auto"]), z.
|
|
28
|
+
function_call: z.union([z.enum(["none", "auto"]), z.record(z.string(), z.unknown())]).optional(),
|
|
29
29
|
presence_penalty: z.number().describe("Penalty for new tokens based on presence in the text so far.").optional(),
|
|
30
30
|
frequency_penalty: z.number().describe("Penalty for new tokens based on frequency in the text so far.").optional()
|
|
31
31
|
});
|
|
@@ -33,32 +33,32 @@ const OpenrouterCreateChatCompletion_UsageSchema = z.object({
|
|
|
33
33
|
total_tokens: z.number().int().describe("Total number of tokens used.").nullable(),
|
|
34
34
|
prompt_tokens: z.number().int().describe("Number of tokens in the prompt.").nullable(),
|
|
35
35
|
completion_tokens: z.number().int().describe("Number of tokens generated in the completion.").nullable()
|
|
36
|
-
});
|
|
36
|
+
}).passthrough();
|
|
37
37
|
const OpenrouterCreateChatCompletion_ErrorResponseSchema = z.object({
|
|
38
38
|
code: z.number().int().describe("Error code from the provider.").nullable(),
|
|
39
39
|
message: z.string().describe("Error message from the provider.").nullable(),
|
|
40
40
|
metadata: z.record(z.string(), z.unknown()).describe("Additional error information.").nullable().optional()
|
|
41
|
-
});
|
|
41
|
+
}).passthrough();
|
|
42
42
|
const OpenrouterCreateChatCompletion_FunctionCallSchema = z.object({
|
|
43
43
|
name: z.string().describe("Name of the function called by the model.").nullable(),
|
|
44
44
|
arguments: z.record(z.string(), z.unknown()).describe("Arguments provided to the function call.")
|
|
45
|
-
});
|
|
45
|
+
}).passthrough();
|
|
46
46
|
const OpenrouterCreateChatCompletion_ToolCallSchema = z.object({
|
|
47
47
|
id: z.string().describe("Unique identifier for this tool call.").nullable(),
|
|
48
48
|
type: z.string().describe("Type of the call (function).").nullable(),
|
|
49
49
|
"function": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable()
|
|
50
|
-
});
|
|
50
|
+
}).passthrough();
|
|
51
51
|
const OpenrouterCreateChatCompletion_ChoiceMessageSchema = z.object({
|
|
52
52
|
role: z.string().describe("Role of the generated message content.").nullable(),
|
|
53
53
|
content: z.string().describe("Content of the generated message.").nullable().optional(),
|
|
54
54
|
tool_calls: z.array(OpenrouterCreateChatCompletion_ToolCallSchema).describe("Tool calls triggered by the model.").nullable().optional()
|
|
55
|
-
});
|
|
55
|
+
}).passthrough();
|
|
56
56
|
const OpenrouterCreateChatCompletion_CreateChoiceSchema = z.object({
|
|
57
57
|
error: OpenrouterCreateChatCompletion_ErrorResponseSchema.nullable().optional(),
|
|
58
58
|
message: OpenrouterCreateChatCompletion_ChoiceMessageSchema.nullable(),
|
|
59
59
|
finish_reason: z.string().describe("The reason why the completion finished.").nullable().optional(),
|
|
60
60
|
native_finish_reason: z.string().describe("Provider-specific finish reason.").nullable().optional()
|
|
61
|
-
});
|
|
61
|
+
}).passthrough();
|
|
62
62
|
const openrouterCreateChatCompletion = action("OPENROUTER_CREATE_CHAT_COMPLETION", {
|
|
63
63
|
slug: "openrouter-create-chat-completion",
|
|
64
64
|
name: "Create Chat Completion",
|
|
@@ -72,7 +72,7 @@ const openrouterCreateChatCompletion = action("OPENROUTER_CREATE_CHAT_COMPLETION
|
|
|
72
72
|
choices: z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe("List of generated completion choices."),
|
|
73
73
|
created: z.number().int().describe("Unix timestamp when the completion was created.").nullable(),
|
|
74
74
|
system_fingerprint: z.string().describe("Provider fingerprint if supported.").nullable().optional()
|
|
75
|
-
})
|
|
75
|
+
}).passthrough()
|
|
76
76
|
});
|
|
77
77
|
//#endregion
|
|
78
78
|
export { openrouterCreateChatCompletion };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-chat-completion.mjs","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateChatCompletionInput = z.object({\n n: z.number().int().describe(\"Number of completion choices to generate.\").optional(),\n stop: z.union([z.string(), z.array(z.string())]).optional(),\n user: z.string().describe(\"A unique identifier for the end-user to help detect abuse.\").optional(),\n model: z.string().describe(\"ID of the model to use for the chat completion. Must exactly match an ID returned by OPENROUTER_LIST_AVAILABLE_MODELS; typos or approximate names cause request failures.\"),\n top_p: z.number().describe(\"Nucleus sampling probability, between 0 and 1.\").optional(),\n stream: z.boolean().default(false).describe(\"Whether to stream back partial message deltas.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"system\", \"user\", \"assistant\", \"tool\"]).describe(\"Role of the message sender.\"),\n content: z.string().describe(\"Content of the message.\"),\n})).describe(\"List of conversation messages to provide as context.\"),\n functions: z.array(z.object({\n name: z.string().describe(\"Name of the function to be called by the model.\"),\n parameters: z.record(z.string(), z.unknown()).describe(\"JSON schema describing function parameters.\"),\n description: z.string().describe(\"Description of the function purpose.\").optional(),\n})).describe(\"List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.\").optional(),\n logit_bias: z.
|
|
1
|
+
{"version":3,"file":"create-chat-completion.mjs","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateChatCompletionInput = z.object({\n n: z.number().int().describe(\"Number of completion choices to generate.\").optional(),\n stop: z.union([z.string(), z.array(z.string())]).optional(),\n user: z.string().describe(\"A unique identifier for the end-user to help detect abuse.\").optional(),\n model: z.string().describe(\"ID of the model to use for the chat completion. Must exactly match an ID returned by OPENROUTER_LIST_AVAILABLE_MODELS; typos or approximate names cause request failures.\"),\n top_p: z.number().describe(\"Nucleus sampling probability, between 0 and 1.\").optional(),\n stream: z.boolean().default(false).describe(\"Whether to stream back partial message deltas.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"system\", \"user\", \"assistant\", \"tool\"]).describe(\"Role of the message sender.\"),\n content: z.string().describe(\"Content of the message.\"),\n}).passthrough()).describe(\"List of conversation messages to provide as context.\"),\n functions: z.array(z.object({\n name: z.string().describe(\"Name of the function to be called by the model.\"),\n parameters: z.record(z.string(), z.unknown()).describe(\"JSON schema describing function parameters.\"),\n description: z.string().describe(\"Description of the function purpose.\").optional(),\n}).passthrough()).describe(\"List of functions the model may call. Only supported by models that explicitly advertise function-calling capability via OPENROUTER_LIST_AVAILABLE_MODELS. Each function schema must be valid JSON; malformed schemas cause runtime failures regardless of prompt correctness.\").optional(),\n logit_bias: z.record(z.string(), z.unknown()).describe(\"Adjust the likelihood of specified tokens.\").optional(),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate.\").optional(),\n temperature: z.number().describe(\"Sampling temperature to use, between 0 and 2.\").optional(),\n function_call: z.union([z.enum([\"none\", \"auto\"]), z.record(z.string(), z.unknown())]).optional(),\n presence_penalty: z.number().describe(\"Penalty for new tokens based on presence in the text so far.\").optional(),\n frequency_penalty: z.number().describe(\"Penalty for new tokens based on frequency in the text so far.\").optional(),\n});\nconst OpenrouterCreateChatCompletion_UsageSchema = z.object({\n total_tokens: z.number().int().describe(\"Total number of tokens used.\").nullable(),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the prompt.\").nullable(),\n completion_tokens: z.number().int().describe(\"Number of tokens generated in the completion.\").nullable(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ErrorResponseSchema = z.object({\n code: z.number().int().describe(\"Error code from the provider.\").nullable(),\n message: z.string().describe(\"Error message from the provider.\").nullable(),\n metadata: z.record(z.string(), z.unknown()).describe(\"Additional error information.\").nullable().optional(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_FunctionCallSchema = z.object({\n name: z.string().describe(\"Name of the function called by the model.\").nullable(),\n arguments: z.record(z.string(), z.unknown()).describe(\"Arguments provided to the function call.\"),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ToolCallSchema = z.object({\n id: z.string().describe(\"Unique identifier for this tool call.\").nullable(),\n type: z.string().describe(\"Type of the call (function).\").nullable(),\n \"function\": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_ChoiceMessageSchema = z.object({\n role: z.string().describe(\"Role of the generated message content.\").nullable(),\n content: z.string().describe(\"Content of the generated message.\").nullable().optional(),\n tool_calls: z.array(OpenrouterCreateChatCompletion_ToolCallSchema).describe(\"Tool calls triggered by the model.\").nullable().optional(),\n}).passthrough();\nconst OpenrouterCreateChatCompletion_CreateChoiceSchema = z.object({\n error: OpenrouterCreateChatCompletion_ErrorResponseSchema.nullable().optional(),\n message: OpenrouterCreateChatCompletion_ChoiceMessageSchema.nullable(),\n finish_reason: z.string().describe(\"The reason why the completion finished.\").nullable().optional(),\n native_finish_reason: z.string().describe(\"Provider-specific finish reason.\").nullable().optional(),\n}).passthrough();\nexport const OpenrouterCreateChatCompletionOutput = z.object({\n id: z.string().describe(\"Unique identifier for the completion.\").nullable(),\n model: z.string().describe(\"Model ID used for the completion.\").nullable(),\n usage: OpenrouterCreateChatCompletion_UsageSchema.nullable().optional(),\n object: z.enum([\"chat.completion\", \"chat.completion.chunk\"]).describe(\"Object type returned.\").nullable(),\n choices: z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe(\"List of generated completion choices.\"),\n created: z.number().int().describe(\"Unix timestamp when the completion was created.\").nullable(),\n system_fingerprint: z.string().describe(\"Provider fingerprint if supported.\").nullable().optional(),\n}).passthrough();\n\nexport const openrouterCreateChatCompletion = action(\"OPENROUTER_CREATE_CHAT_COMPLETION\", {\n slug: \"openrouter-create-chat-completion\",\n name: \"Create Chat Completion\",\n description: \"Tool to generate a chat-style completion. Use after assembling messages and selecting a model. Supports streaming and function calls. Response format varies across models; use explicit prompt instructions to standardize output. Provider-level rate limits and moderation policies differ per model.\",\n input: OpenrouterCreateChatCompletionInput,\n output: OpenrouterCreateChatCompletionOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsC,EAAE,OAAO;CAC1D,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,2CAA2C,CAAC,CAAC,SAAS;CACnF,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;CAC1D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,4DAA4D,CAAC,CAAC,SAAS;CACjG,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,2KAA2K;CACtM,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CACtF,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CACvG,UAAU,EAAE,MAAM,EAAE,OAAO;EAC3B,MAAM,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAa;EAAM,CAAC,CAAC,CAAC,SAAS,6BAA6B;EAC5F,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB;CACxD,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,sDAAsD;CAC/E,WAAW,EAAE,MA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,CAAC,SAAS,CAAC,CAAC,SAAS;CAClG,sBAAsB,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC,CAAC,CAAC,YAAY;AAWf,MAAa,iCAAiC,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAfkD,EAAE,OAAO;EAC3D,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,SAAS;EAC1E,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;EACzE,OAAO,2CAA2C,SAAS,CAAC,CAAC,SAAS;EACtE,QAAQ,EAAE,KAAK,CAAC,mBAAmB,uBAAuB,CAAC,CAAC,CAAC,SAAS,uBAAuB,CAAC,CAAC,SAAS;EACxG,SAAS,EAAE,MAAM,iDAAiD,CAAC,CAAC,SAAS,uCAAuC;EACpH,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,iDAAiD,CAAC,CAAC,SAAS;EAC/F,oBAAoB,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACpG,CAAC,CAAC,CAAC,YAOO;AACV,CAAC"}
|
|
@@ -12,14 +12,14 @@ const OpenrouterCreateCoinbaseChargeInput = zod.z.object({
|
|
|
12
12
|
]).describe("Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base)."),
|
|
13
13
|
HTTP_Referer: zod.z.string().describe("The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.").optional()
|
|
14
14
|
});
|
|
15
|
-
const OpenrouterCreateCoinbaseCharge_Web3DataSchema = zod.z.object({ transfer_intent: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Details of the transfer intent for the crypto payment") });
|
|
15
|
+
const OpenrouterCreateCoinbaseCharge_Web3DataSchema = zod.z.object({ transfer_intent: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Details of the transfer intent for the crypto payment") }).passthrough();
|
|
16
16
|
const OpenrouterCreateCoinbaseCharge_ChargeDataSchema = zod.z.object({
|
|
17
17
|
id: zod.z.string().describe("Unique identifier for the created charge").nullable(),
|
|
18
18
|
web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),
|
|
19
19
|
created_at: zod.z.string().describe("ISO 8601 timestamp when the charge was created").nullable(),
|
|
20
20
|
expires_at: zod.z.string().describe("ISO 8601 timestamp when the charge expires").nullable()
|
|
21
|
-
});
|
|
22
|
-
const OpenrouterCreateCoinbaseChargeOutput = zod.z.object({ data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable() });
|
|
21
|
+
}).passthrough();
|
|
22
|
+
const OpenrouterCreateCoinbaseChargeOutput = zod.z.object({ data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable() }).passthrough();
|
|
23
23
|
const openrouterCreateCoinbaseCharge = require_action.action("OPENROUTER_CREATE_COINBASE_CHARGE", {
|
|
24
24
|
slug: "openrouter-create-coinbase-charge",
|
|
25
25
|
name: "Create Coinbase Charge",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coinbase-charge.cjs","names":["z","action"],"sources":["../../src/actions/create-coinbase-charge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateCoinbaseChargeInput = z.object({\n amount: z.number().describe(\"Amount in USD to charge. This will be converted to the equivalent crypto amount.\"),\n sender: z.string().describe(\"Ethereum wallet address of the sender (must be a valid 42-character hex address starting with '0x').\"),\n X_Title: z.string().describe(\"The app display name that customizes how your app appears in OpenRouter's dashboard.\").optional(),\n chain_id: z.union([z.literal(1), z.literal(137), z.literal(8453)]).describe(\"Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base).\"),\n HTTP_Referer: z.string().describe(\"The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.\").optional(),\n});\nconst OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({\n transfer_intent: z.record(z.string(), z.unknown()).describe(\"Details of the transfer intent for the crypto payment\"),\n});\nconst OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({\n id: z.string().describe(\"Unique identifier for the created charge\").nullable(),\n web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),\n created_at: z.string().describe(\"ISO 8601 timestamp when the charge was created\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 timestamp when the charge expires\").nullable(),\n});\nexport const OpenrouterCreateCoinbaseChargeOutput = z.object({\n data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable(),\n});\n\nexport const openrouterCreateCoinbaseCharge = action(\"OPENROUTER_CREATE_COINBASE_CHARGE\", {\n slug: \"openrouter-create-coinbase-charge\",\n name: \"Create Coinbase Charge\",\n description: \"Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transaction on the specified blockchain.\",\n input: OpenrouterCreateCoinbaseChargeInput,\n output: OpenrouterCreateCoinbaseChargeOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsCA,IAAAA,EAAE,OAAO;CAC1D,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kFAAkF;CAC9G,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sGAAsG;CAClI,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sFAAsF,CAAC,CAAC,SAAS;CAC9H,UAAUA,IAAAA,EAAE,MAAM;EAACA,IAAAA,EAAE,QAAQ,CAAC;EAAGA,IAAAA,EAAE,QAAQ,GAAG;EAAGA,IAAAA,EAAE,QAAQ,IAAI;CAAC,CAAC,CAAC,CAAC,SAAS,oGAAoG;CAChL,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;AACxK,CAAC;AACD,MAAM,gDAAgDA,IAAAA,EAAE,OAAO,EAC7D,iBAAiBA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,uDAAuD,EACrH,CAAC;
|
|
1
|
+
{"version":3,"file":"create-coinbase-charge.cjs","names":["z","action"],"sources":["../../src/actions/create-coinbase-charge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateCoinbaseChargeInput = z.object({\n amount: z.number().describe(\"Amount in USD to charge. This will be converted to the equivalent crypto amount.\"),\n sender: z.string().describe(\"Ethereum wallet address of the sender (must be a valid 42-character hex address starting with '0x').\"),\n X_Title: z.string().describe(\"The app display name that customizes how your app appears in OpenRouter's dashboard.\").optional(),\n chain_id: z.union([z.literal(1), z.literal(137), z.literal(8453)]).describe(\"Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base).\"),\n HTTP_Referer: z.string().describe(\"The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.\").optional(),\n});\nconst OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({\n transfer_intent: z.record(z.string(), z.unknown()).describe(\"Details of the transfer intent for the crypto payment\"),\n}).passthrough();\nconst OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({\n id: z.string().describe(\"Unique identifier for the created charge\").nullable(),\n web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),\n created_at: z.string().describe(\"ISO 8601 timestamp when the charge was created\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 timestamp when the charge expires\").nullable(),\n}).passthrough();\nexport const OpenrouterCreateCoinbaseChargeOutput = z.object({\n data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable(),\n}).passthrough();\n\nexport const openrouterCreateCoinbaseCharge = action(\"OPENROUTER_CREATE_COINBASE_CHARGE\", {\n slug: \"openrouter-create-coinbase-charge\",\n name: \"Create Coinbase Charge\",\n description: \"Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transaction on the specified blockchain.\",\n input: OpenrouterCreateCoinbaseChargeInput,\n output: OpenrouterCreateCoinbaseChargeOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsCA,IAAAA,EAAE,OAAO;CAC1D,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kFAAkF;CAC9G,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sGAAsG;CAClI,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sFAAsF,CAAC,CAAC,SAAS;CAC9H,UAAUA,IAAAA,EAAE,MAAM;EAACA,IAAAA,EAAE,QAAQ,CAAC;EAAGA,IAAAA,EAAE,QAAQ,GAAG;EAAGA,IAAAA,EAAE,QAAQ,IAAI;CAAC,CAAC,CAAC,CAAC,SAAS,oGAAoG;CAChL,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;AACxK,CAAC;AACD,MAAM,gDAAgDA,IAAAA,EAAE,OAAO,EAC7D,iBAAiBA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,uDAAuD,EACrH,CAAC,CAAC,CAAC,YAAY;AACf,MAAM,kDAAkDA,IAAAA,EAAE,OAAO;CAC/D,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C,CAAC,CAAC,SAAS;CAC7E,WAAW,8CAA8C,SAAS;CAClE,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CAC3F,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4CAA4C,CAAC,CAAC,SAAS;AACzF,CAAC,CAAC,CAAC,YAAY;AACf,MAAa,uCAAuCA,IAAAA,EAAE,OAAO,EAC3D,MAAM,gDAAgD,SAAS,EACjE,CAAC,CAAC,CAAC,YAAY;AAEf,MAAa,iCAAiCC,eAAAA,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -13,11 +13,11 @@ declare const OpenrouterCreateCoinbaseChargeOutput: z.ZodObject<{
|
|
|
13
13
|
id: z.ZodNullable<z.ZodString>;
|
|
14
14
|
web3_data: z.ZodNullable<z.ZodObject<{
|
|
15
15
|
transfer_intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
-
}, z.core.$
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
17
|
created_at: z.ZodNullable<z.ZodString>;
|
|
18
18
|
expires_at: z.ZodNullable<z.ZodString>;
|
|
19
|
-
}, z.core.$
|
|
20
|
-
}, z.core.$
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
}, z.core.$loose>;
|
|
21
21
|
declare const openrouterCreateCoinbaseCharge: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
22
22
|
amount: number;
|
|
23
23
|
sender: string;
|
|
@@ -13,11 +13,11 @@ declare const OpenrouterCreateCoinbaseChargeOutput: z.ZodObject<{
|
|
|
13
13
|
id: z.ZodNullable<z.ZodString>;
|
|
14
14
|
web3_data: z.ZodNullable<z.ZodObject<{
|
|
15
15
|
transfer_intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
-
}, z.core.$
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
17
|
created_at: z.ZodNullable<z.ZodString>;
|
|
18
18
|
expires_at: z.ZodNullable<z.ZodString>;
|
|
19
|
-
}, z.core.$
|
|
20
|
-
}, z.core.$
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
}, z.core.$loose>;
|
|
21
21
|
declare const openrouterCreateCoinbaseCharge: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
22
22
|
amount: number;
|
|
23
23
|
sender: string;
|
|
@@ -12,19 +12,19 @@ const OpenrouterCreateCoinbaseChargeInput = z.object({
|
|
|
12
12
|
]).describe("Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base)."),
|
|
13
13
|
HTTP_Referer: z.string().describe("The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.").optional()
|
|
14
14
|
});
|
|
15
|
-
const OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({ transfer_intent: z.record(z.string(), z.unknown()).describe("Details of the transfer intent for the crypto payment") });
|
|
15
|
+
const OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({ transfer_intent: z.record(z.string(), z.unknown()).describe("Details of the transfer intent for the crypto payment") }).passthrough();
|
|
16
16
|
const OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({
|
|
17
17
|
id: z.string().describe("Unique identifier for the created charge").nullable(),
|
|
18
18
|
web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),
|
|
19
19
|
created_at: z.string().describe("ISO 8601 timestamp when the charge was created").nullable(),
|
|
20
20
|
expires_at: z.string().describe("ISO 8601 timestamp when the charge expires").nullable()
|
|
21
|
-
});
|
|
21
|
+
}).passthrough();
|
|
22
22
|
const openrouterCreateCoinbaseCharge = action("OPENROUTER_CREATE_COINBASE_CHARGE", {
|
|
23
23
|
slug: "openrouter-create-coinbase-charge",
|
|
24
24
|
name: "Create Coinbase Charge",
|
|
25
25
|
description: "Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transaction on the specified blockchain.",
|
|
26
26
|
input: OpenrouterCreateCoinbaseChargeInput,
|
|
27
|
-
output: z.object({ data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable() })
|
|
27
|
+
output: z.object({ data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable() }).passthrough()
|
|
28
28
|
});
|
|
29
29
|
//#endregion
|
|
30
30
|
export { openrouterCreateCoinbaseCharge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coinbase-charge.mjs","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateCoinbaseChargeInput = z.object({\n amount: z.number().describe(\"Amount in USD to charge. This will be converted to the equivalent crypto amount.\"),\n sender: z.string().describe(\"Ethereum wallet address of the sender (must be a valid 42-character hex address starting with '0x').\"),\n X_Title: z.string().describe(\"The app display name that customizes how your app appears in OpenRouter's dashboard.\").optional(),\n chain_id: z.union([z.literal(1), z.literal(137), z.literal(8453)]).describe(\"Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base).\"),\n HTTP_Referer: z.string().describe(\"The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.\").optional(),\n});\nconst OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({\n transfer_intent: z.record(z.string(), z.unknown()).describe(\"Details of the transfer intent for the crypto payment\"),\n});\nconst OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({\n id: z.string().describe(\"Unique identifier for the created charge\").nullable(),\n web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),\n created_at: z.string().describe(\"ISO 8601 timestamp when the charge was created\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 timestamp when the charge expires\").nullable(),\n});\nexport const OpenrouterCreateCoinbaseChargeOutput = z.object({\n data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable(),\n});\n\nexport const openrouterCreateCoinbaseCharge = action(\"OPENROUTER_CREATE_COINBASE_CHARGE\", {\n slug: \"openrouter-create-coinbase-charge\",\n name: \"Create Coinbase Charge\",\n description: \"Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transaction on the specified blockchain.\",\n input: OpenrouterCreateCoinbaseChargeInput,\n output: OpenrouterCreateCoinbaseChargeOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsC,EAAE,OAAO;CAC1D,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,kFAAkF;CAC9G,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,sGAAsG;CAClI,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,sFAAsF,CAAC,CAAC,SAAS;CAC9H,UAAU,EAAE,MAAM;EAAC,EAAE,QAAQ,CAAC;EAAG,EAAE,QAAQ,GAAG;EAAG,EAAE,QAAQ,IAAI;CAAC,CAAC,CAAC,CAAC,SAAS,oGAAoG;CAChL,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;AACxK,CAAC;AACD,MAAM,gDAAgD,EAAE,OAAO,EAC7D,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,uDAAuD,EACrH,CAAC;
|
|
1
|
+
{"version":3,"file":"create-coinbase-charge.mjs","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateCoinbaseChargeInput = z.object({\n amount: z.number().describe(\"Amount in USD to charge. This will be converted to the equivalent crypto amount.\"),\n sender: z.string().describe(\"Ethereum wallet address of the sender (must be a valid 42-character hex address starting with '0x').\"),\n X_Title: z.string().describe(\"The app display name that customizes how your app appears in OpenRouter's dashboard.\").optional(),\n chain_id: z.union([z.literal(1), z.literal(137), z.literal(8453)]).describe(\"Blockchain chain ID to use for the transaction. Options: 1 (Ethereum), 137 (Polygon), 8453 (Base).\"),\n HTTP_Referer: z.string().describe(\"The app identifier (your app's URL) used as the primary identifier for rankings and to track API usage per application.\").optional(),\n});\nconst OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({\n transfer_intent: z.record(z.string(), z.unknown()).describe(\"Details of the transfer intent for the crypto payment\"),\n}).passthrough();\nconst OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({\n id: z.string().describe(\"Unique identifier for the created charge\").nullable(),\n web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),\n created_at: z.string().describe(\"ISO 8601 timestamp when the charge was created\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 timestamp when the charge expires\").nullable(),\n}).passthrough();\nexport const OpenrouterCreateCoinbaseChargeOutput = z.object({\n data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable(),\n}).passthrough();\n\nexport const openrouterCreateCoinbaseCharge = action(\"OPENROUTER_CREATE_COINBASE_CHARGE\", {\n slug: \"openrouter-create-coinbase-charge\",\n name: \"Create Coinbase Charge\",\n description: \"Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transaction on the specified blockchain.\",\n input: OpenrouterCreateCoinbaseChargeInput,\n output: OpenrouterCreateCoinbaseChargeOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sCAAsC,EAAE,OAAO;CAC1D,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,kFAAkF;CAC9G,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,sGAAsG;CAClI,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,sFAAsF,CAAC,CAAC,SAAS;CAC9H,UAAU,EAAE,MAAM;EAAC,EAAE,QAAQ,CAAC;EAAG,EAAE,QAAQ,GAAG;EAAG,EAAE,QAAQ,IAAI;CAAC,CAAC,CAAC,CAAC,SAAS,oGAAoG;CAChL,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;AACxK,CAAC;AACD,MAAM,gDAAgD,EAAE,OAAO,EAC7D,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,uDAAuD,EACrH,CAAC,CAAC,CAAC,YAAY;AACf,MAAM,kDAAkD,EAAE,OAAO;CAC/D,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C,CAAC,CAAC,SAAS;CAC7E,WAAW,8CAA8C,SAAS;CAClE,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CAC3F,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,4CAA4C,CAAC,CAAC,SAAS;AACzF,CAAC,CAAC,CAAC,YAAY;AAKf,MAAa,iCAAiC,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QATkD,EAAE,OAAO,EAC3D,MAAM,gDAAgD,SAAS,EACjE,CAAC,CAAC,CAAC,YAOO;AACV,CAAC"}
|
|
@@ -9,7 +9,7 @@ const OpenrouterCreateMessageInput = zod.z.object({
|
|
|
9
9
|
type: zod.z.string().describe("Type of tool (default: 'function').").optional(),
|
|
10
10
|
description: zod.z.string().describe("Description of the tool.").optional(),
|
|
11
11
|
input_schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe("JSON schema describing the tool's input parameters.").optional()
|
|
12
|
-
}).describe("Tool definition for function calling.")).describe("List of tools available for the model to call.").optional(),
|
|
12
|
+
}).passthrough().describe("Tool definition for function calling.")).describe("List of tools available for the model to call.").optional(),
|
|
13
13
|
top_k: zod.z.number().int().describe("Top-k sampling parameter.").optional(),
|
|
14
14
|
top_p: zod.z.number().describe("Nucleus sampling probability between 0 and 1.").optional(),
|
|
15
15
|
models: zod.z.array(zod.z.string()).describe("List of fallback models to use if primary model fails.").optional(),
|
|
@@ -18,7 +18,7 @@ const OpenrouterCreateMessageInput = zod.z.object({
|
|
|
18
18
|
plugins: zod.z.array(zod.z.object({
|
|
19
19
|
id: zod.z.string().describe("Plugin identifier."),
|
|
20
20
|
enabled: zod.z.boolean().describe("Whether the plugin is enabled.").optional()
|
|
21
|
-
}).describe("Plugin configuration.")).describe("Plugins to enable for this request.").optional(),
|
|
21
|
+
}).passthrough().describe("Plugin configuration.")).describe("Plugins to enable for this request.").optional(),
|
|
22
22
|
x_title: zod.z.string().describe("App display name for OpenRouter dashboard.").optional(),
|
|
23
23
|
messages: zod.z.array(zod.z.object({
|
|
24
24
|
role: zod.z.enum(["user", "assistant"]).describe("Role of the message sender."),
|
|
@@ -26,8 +26,8 @@ const OpenrouterCreateMessageInput = zod.z.object({
|
|
|
26
26
|
text: zod.z.string().nullable().optional(),
|
|
27
27
|
type: zod.z.string().describe("Type of content block (e.g., 'text', 'image')."),
|
|
28
28
|
source: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().optional()
|
|
29
|
-
}).describe("Content block in a message."))])
|
|
30
|
-
}).describe("Message in the conversation.")).describe("List of conversation messages. Each message has a role ('user' or 'assistant') and content."),
|
|
29
|
+
}).passthrough().describe("Content block in a message."))])
|
|
30
|
+
}).passthrough().describe("Message in the conversation.")).describe("List of conversation messages. Each message has a role ('user' or 'assistant') and content."),
|
|
31
31
|
metadata: zod.z.object({ user_id: zod.z.string().describe("Unique identifier for the user making the request.").optional() }).describe("Metadata for the request.").optional(),
|
|
32
32
|
provider: zod.z.object({
|
|
33
33
|
zdr: zod.z.boolean().describe("Whether to restrict routing to only ZDR (Zero Data Retention) endpoints.").optional(),
|
|
@@ -63,11 +63,11 @@ const OpenrouterCreateMessage_ResponseUsageSchema = zod.z.object({
|
|
|
63
63
|
output_tokens: zod.z.number().int().describe("Number of output tokens.").nullable(),
|
|
64
64
|
cache_read_input_tokens: zod.z.number().int().describe("Number of tokens read from cache.").nullable().optional(),
|
|
65
65
|
cache_creation_input_tokens: zod.z.number().int().describe("Number of tokens used for cache creation.").nullable().optional()
|
|
66
|
-
}).describe("Token usage information.");
|
|
66
|
+
}).passthrough().describe("Token usage information.");
|
|
67
67
|
const OpenrouterCreateMessage_ContentBlockSchema = zod.z.object({
|
|
68
68
|
text: zod.z.string().describe("Text content if applicable.").nullable().optional(),
|
|
69
69
|
type: zod.z.string().describe("Type of content block.").nullable()
|
|
70
|
-
}).describe("Content block in the response.");
|
|
70
|
+
}).passthrough().describe("Content block in the response.");
|
|
71
71
|
const OpenrouterCreateMessageOutput = zod.z.object({
|
|
72
72
|
id: zod.z.string().describe("Unique identifier for this message.").nullable(),
|
|
73
73
|
role: zod.z.string().describe("Role of the response, typically 'assistant'.").nullable(),
|
|
@@ -77,7 +77,7 @@ const OpenrouterCreateMessageOutput = zod.z.object({
|
|
|
77
77
|
content: zod.z.array(OpenrouterCreateMessage_ContentBlockSchema).describe("List of content blocks in the response."),
|
|
78
78
|
stop_reason: zod.z.string().describe("Reason why generation stopped.").nullable().optional(),
|
|
79
79
|
stop_sequence: zod.z.string().describe("Stop sequence that triggered generation to stop.").nullable().optional()
|
|
80
|
-
}).describe("Response from creating a message.");
|
|
80
|
+
}).passthrough().describe("Response from creating a message.");
|
|
81
81
|
const openrouterCreateMessage = require_action.action("OPENROUTER_CREATE_MESSAGE", {
|
|
82
82
|
slug: "openrouter-create-message",
|
|
83
83
|
name: "Create Message (Anthropic Format)",
|