@keystrokehq/openrouter 0.1.0 → 0.1.2
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/action.cjs.map +1 -1
- package/dist/action.mjs.map +1 -1
- package/dist/actions/create-chat-completion.cjs +13 -13
- package/dist/actions/create-chat-completion.cjs.map +1 -1
- package/dist/actions/create-chat-completion.d.cts +90 -3
- package/dist/actions/create-chat-completion.d.cts.map +1 -1
- package/dist/actions/create-chat-completion.d.mts +90 -3
- package/dist/actions/create-chat-completion.d.mts.map +1 -1
- package/dist/actions/create-chat-completion.mjs +13 -13
- 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 +24 -3
- package/dist/actions/create-coinbase-charge.d.cts.map +1 -1
- package/dist/actions/create-coinbase-charge.d.mts +24 -3
- package/dist/actions/create-coinbase-charge.d.mts.map +1 -1
- 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 +144 -3
- package/dist/actions/create-message.d.cts.map +1 -1
- package/dist/actions/create-message.d.mts +144 -3
- package/dist/actions/create-message.d.mts.map +1 -1
- 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 +8 -3
- package/dist/actions/get-credits.d.cts.map +1 -1
- package/dist/actions/get-credits.d.mts +8 -3
- package/dist/actions/get-credits.d.mts.map +1 -1
- package/dist/actions/get-credits.mjs +2 -2
- package/dist/actions/get-credits.mjs.map +1 -1
- package/dist/actions/get-current-key.cjs +16 -16
- package/dist/actions/get-current-key.cjs.map +1 -1
- package/dist/actions/get-current-key.d.cts +34 -3
- package/dist/actions/get-current-key.d.cts.map +1 -1
- package/dist/actions/get-current-key.d.mts +34 -3
- package/dist/actions/get-current-key.d.mts.map +1 -1
- package/dist/actions/get-current-key.mjs +16 -16
- package/dist/actions/get-current-key.mjs.map +1 -1
- package/dist/actions/get-generation.cjs +19 -19
- package/dist/actions/get-generation.cjs.map +1 -1
- package/dist/actions/get-generation.d.cts +37 -3
- package/dist/actions/get-generation.d.cts.map +1 -1
- package/dist/actions/get-generation.d.mts +37 -3
- package/dist/actions/get-generation.d.mts.map +1 -1
- package/dist/actions/get-generation.mjs +19 -19
- package/dist/actions/get-generation.mjs.map +1 -1
- package/dist/actions/get-models-count.cjs +1 -1
- package/dist/actions/get-models-count.cjs.map +1 -1
- package/dist/actions/get-models-count.d.cts +13 -3
- package/dist/actions/get-models-count.d.cts.map +1 -1
- package/dist/actions/get-models-count.d.mts +13 -3
- package/dist/actions/get-models-count.d.mts.map +1 -1
- package/dist/actions/get-models-count.mjs +1 -1
- package/dist/actions/get-models-count.mjs.map +1 -1
- package/dist/actions/list-available-models.cjs +12 -12
- package/dist/actions/list-available-models.cjs.map +1 -1
- package/dist/actions/list-available-models.d.cts +68 -3
- package/dist/actions/list-available-models.d.cts.map +1 -1
- package/dist/actions/list-available-models.d.mts +68 -3
- package/dist/actions/list-available-models.d.mts.map +1 -1
- package/dist/actions/list-available-models.mjs +12 -12
- package/dist/actions/list-available-models.mjs.map +1 -1
- package/dist/actions/list-embedding-models.cjs +10 -10
- package/dist/actions/list-embedding-models.cjs.map +1 -1
- package/dist/actions/list-embedding-models.d.cts +41 -3
- package/dist/actions/list-embedding-models.d.cts.map +1 -1
- package/dist/actions/list-embedding-models.d.mts +41 -3
- package/dist/actions/list-embedding-models.d.mts.map +1 -1
- package/dist/actions/list-embedding-models.mjs +10 -10
- package/dist/actions/list-embedding-models.mjs.map +1 -1
- package/dist/actions/list-model-endpoints.cjs +9 -9
- package/dist/actions/list-model-endpoints.cjs.map +1 -1
- package/dist/actions/list-model-endpoints.d.cts +39 -3
- package/dist/actions/list-model-endpoints.d.cts.map +1 -1
- package/dist/actions/list-model-endpoints.d.mts +39 -3
- package/dist/actions/list-model-endpoints.d.mts.map +1 -1
- package/dist/actions/list-model-endpoints.mjs +9 -9
- 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 +9 -3
- package/dist/actions/list-providers.d.cts.map +1 -1
- package/dist/actions/list-providers.d.mts +9 -3
- package/dist/actions/list-providers.d.mts.map +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 +8 -8
- package/dist/actions/list-user-models.cjs.map +1 -1
- package/dist/actions/list-user-models.d.cts +45 -3
- package/dist/actions/list-user-models.d.cts.map +1 -1
- package/dist/actions/list-user-models.d.mts +45 -3
- package/dist/actions/list-user-models.d.mts.map +1 -1
- package/dist/actions/list-user-models.mjs +8 -8
- package/dist/actions/list-user-models.mjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.cjs +9 -9
- package/dist/actions/list-zdr-endpoints.cjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.d.cts +43 -3
- package/dist/actions/list-zdr-endpoints.d.cts.map +1 -1
- package/dist/actions/list-zdr-endpoints.d.mts +43 -3
- package/dist/actions/list-zdr-endpoints.d.mts.map +1 -1
- package/dist/actions/list-zdr-endpoints.mjs +9 -9
- package/dist/actions/list-zdr-endpoints.mjs.map +1 -1
- package/dist/catalog.cjs +7 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +8 -0
- package/dist/catalog.d.mts +8 -0
- package/dist/catalog.mjs +7 -1
- package/dist/catalog.mjs.map +1 -1
- package/package.json +2 -2
package/dist/action.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.cjs","names":["openrouter","executeOpenrouterTool"],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { openrouter } from \"./app\";\nimport { executeOpenrouterTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input:
|
|
1
|
+
{"version":3,"file":"action.cjs","names":["openrouter","executeOpenrouterTool"],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { openrouter } from \"./app\";\nimport { executeOpenrouterTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action<TInput extends z.ZodType>(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input: TInput;\n output: z.ZodType;\n },\n) {\n return openrouter.action({\n slug: def.slug,\n name: def.name,\n description: def.description,\n input: def.input,\n output: def.output as z.ZodTypeAny,\n async run(input) {\n return def.output.parse(await executeOpenrouterTool(tool, input as Record<string, unknown>));\n },\n });\n}\n"],"mappings":";;;;;AAMA,SAAgB,OACd,MACA,KAOA;CACA,OAAOA,YAAAA,WAAW,OAAO;EACvB,MAAM,IAAI;EACV,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,OAAO,IAAI;EACX,QAAQ,IAAI;EACZ,MAAM,IAAI,OAAO;GACf,OAAO,IAAI,OAAO,MAAM,MAAMC,gBAAAA,sBAAsB,MAAM,KAAgC,CAAC;EAC7F;CACF,CAAC;AACH"}
|
package/dist/action.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.mjs","names":[],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { openrouter } from \"./app\";\nimport { executeOpenrouterTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input:
|
|
1
|
+
{"version":3,"file":"action.mjs","names":[],"sources":["../src/action.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { openrouter } from \"./app\";\nimport { executeOpenrouterTool } from \"./execute\";\n\n/** Bind one gateway tool to a typed app action; the call's output is parsed against `def.output`. */\nexport function action<TInput extends z.ZodType>(\n tool: string,\n def: {\n slug: string;\n name: string;\n description: string;\n input: TInput;\n output: z.ZodType;\n },\n) {\n return openrouter.action({\n slug: def.slug,\n name: def.name,\n description: def.description,\n input: def.input,\n output: def.output as z.ZodTypeAny,\n async run(input) {\n return def.output.parse(await executeOpenrouterTool(tool, input as Record<string, unknown>));\n },\n });\n}\n"],"mappings":";;;;;AAMA,SAAgB,OACd,MACA,KAOA;CACA,OAAO,WAAW,OAAO;EACvB,MAAM,IAAI;EACV,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,OAAO,IAAI;EACX,QAAQ,IAAI;EACZ,MAAM,IAAI,OAAO;GACf,OAAO,IAAI,OAAO,MAAM,MAAM,sBAAsB,MAAM,KAAgC,CAAC;EAC7F;CACF,CAAC;AACH"}
|
|
@@ -30,26 +30,26 @@ const OpenrouterCreateChatCompletionInput = zod.z.object({
|
|
|
30
30
|
frequency_penalty: zod.z.number().describe("Penalty for new tokens based on frequency in the text so far.").optional()
|
|
31
31
|
});
|
|
32
32
|
const OpenrouterCreateChatCompletion_UsageSchema = zod.z.object({
|
|
33
|
-
total_tokens: zod.z.number().int().describe("Total number of tokens used."),
|
|
34
|
-
prompt_tokens: zod.z.number().int().describe("Number of tokens in the prompt."),
|
|
35
|
-
completion_tokens: zod.z.number().int().describe("Number of tokens generated in the completion.")
|
|
33
|
+
total_tokens: zod.z.number().int().describe("Total number of tokens used.").nullable(),
|
|
34
|
+
prompt_tokens: zod.z.number().int().describe("Number of tokens in the prompt.").nullable(),
|
|
35
|
+
completion_tokens: zod.z.number().int().describe("Number of tokens generated in the completion.").nullable()
|
|
36
36
|
});
|
|
37
37
|
const OpenrouterCreateChatCompletion_ErrorResponseSchema = zod.z.object({
|
|
38
|
-
code: zod.z.number().int().describe("Error code from the provider."),
|
|
39
|
-
message: zod.z.string().describe("Error message from the provider."),
|
|
38
|
+
code: zod.z.number().int().describe("Error code from the provider.").nullable(),
|
|
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
|
});
|
|
42
42
|
const OpenrouterCreateChatCompletion_FunctionCallSchema = zod.z.object({
|
|
43
|
-
name: zod.z.string().describe("Name of the function called by the model."),
|
|
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
|
});
|
|
46
46
|
const OpenrouterCreateChatCompletion_ToolCallSchema = zod.z.object({
|
|
47
|
-
id: zod.z.string().describe("Unique identifier for this tool call."),
|
|
48
|
-
type: zod.z.string().describe("Type of the call (function)."),
|
|
47
|
+
id: zod.z.string().describe("Unique identifier for this tool call.").nullable(),
|
|
48
|
+
type: zod.z.string().describe("Type of the call (function).").nullable(),
|
|
49
49
|
"function": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable()
|
|
50
50
|
});
|
|
51
51
|
const OpenrouterCreateChatCompletion_ChoiceMessageSchema = zod.z.object({
|
|
52
|
-
role: zod.z.string().describe("Role of the generated message content."),
|
|
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
|
});
|
|
@@ -60,12 +60,12 @@ const OpenrouterCreateChatCompletion_CreateChoiceSchema = zod.z.object({
|
|
|
60
60
|
native_finish_reason: zod.z.string().describe("Provider-specific finish reason.").nullable().optional()
|
|
61
61
|
});
|
|
62
62
|
const OpenrouterCreateChatCompletionOutput = zod.z.object({
|
|
63
|
-
id: zod.z.string().describe("Unique identifier for the completion."),
|
|
64
|
-
model: zod.z.string().describe("Model ID used for the completion."),
|
|
63
|
+
id: zod.z.string().describe("Unique identifier for the completion.").nullable(),
|
|
64
|
+
model: zod.z.string().describe("Model ID used for the completion.").nullable(),
|
|
65
65
|
usage: OpenrouterCreateChatCompletion_UsageSchema.nullable().optional(),
|
|
66
|
-
object: zod.z.enum(["chat.completion", "chat.completion.chunk"]).describe("Object type returned."),
|
|
66
|
+
object: zod.z.enum(["chat.completion", "chat.completion.chunk"]).describe("Object type returned.").nullable(),
|
|
67
67
|
choices: zod.z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe("List of generated completion choices."),
|
|
68
|
-
created: zod.z.number().int().describe("Unix timestamp when the completion was created."),
|
|
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
|
});
|
|
71
71
|
const openrouterCreateChatCompletion = require_action.action("OPENROUTER_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
|
|
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,\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CAAuCA,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,9 +1,96 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/create-chat-completion.d.ts
|
|
4
|
-
declare const OpenrouterCreateChatCompletionInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterCreateChatCompletionInput: z.ZodObject<{
|
|
5
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7
|
+
user: z.ZodOptional<z.ZodString>;
|
|
8
|
+
model: z.ZodString;
|
|
9
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
stream: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
11
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
12
|
+
role: z.ZodEnum<{
|
|
13
|
+
user: "user";
|
|
14
|
+
system: "system";
|
|
15
|
+
assistant: "assistant";
|
|
16
|
+
tool: "tool";
|
|
17
|
+
}>;
|
|
18
|
+
content: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
logit_bias: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
26
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
function_call: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
29
|
+
none: "none";
|
|
30
|
+
auto: "auto";
|
|
31
|
+
}>, z.ZodObject<{}, z.core.$strip>]>>;
|
|
32
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
36
|
+
id: z.ZodNullable<z.ZodString>;
|
|
37
|
+
model: z.ZodNullable<z.ZodString>;
|
|
38
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
|
+
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
prompt_tokens: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
completion_tokens: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
object: z.ZodNullable<z.ZodEnum<{
|
|
44
|
+
"chat.completion": "chat.completion";
|
|
45
|
+
"chat.completion.chunk": "chat.completion.chunk";
|
|
46
|
+
}>>;
|
|
47
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
48
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
|
+
code: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
message: z.ZodNullable<z.ZodString>;
|
|
51
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
message: z.ZodNullable<z.ZodObject<{
|
|
54
|
+
role: z.ZodNullable<z.ZodString>;
|
|
55
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodNullable<z.ZodString>;
|
|
58
|
+
type: z.ZodNullable<z.ZodString>;
|
|
59
|
+
function: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
name: z.ZodNullable<z.ZodString>;
|
|
61
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>>>>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
native_finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
created: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
declare const openrouterCreateChatCompletion: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
72
|
+
model: string;
|
|
73
|
+
messages: {
|
|
74
|
+
role: "user" | "system" | "assistant" | "tool";
|
|
75
|
+
content: string;
|
|
76
|
+
}[];
|
|
77
|
+
n?: number | undefined;
|
|
78
|
+
stop?: string | string[] | undefined;
|
|
79
|
+
user?: string | undefined;
|
|
80
|
+
top_p?: number | undefined;
|
|
81
|
+
stream?: boolean | undefined;
|
|
82
|
+
functions?: {
|
|
83
|
+
name: string;
|
|
84
|
+
parameters: Record<string, unknown>;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
logit_bias?: Record<string, never> | undefined;
|
|
88
|
+
max_tokens?: number | undefined;
|
|
89
|
+
temperature?: number | undefined;
|
|
90
|
+
function_call?: "none" | "auto" | Record<string, never> | undefined;
|
|
91
|
+
presence_penalty?: number | undefined;
|
|
92
|
+
frequency_penalty?: number | undefined;
|
|
93
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
94
|
//#endregion
|
|
8
95
|
export { openrouterCreateChatCompletion };
|
|
9
96
|
//# sourceMappingURL=create-chat-completion.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-chat-completion.d.cts","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"mappings":";;;cAIa,mCAAA,
|
|
1
|
+
{"version":3,"file":"create-chat-completion.d.cts","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"mappings":";;;cAIa,mCAAA,EAAmC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqDnC,oCAAA,EAAoC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUpC,8BAAA,gCAA8B,wBAAA"}
|
|
@@ -1,9 +1,96 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/create-chat-completion.d.ts
|
|
4
|
-
declare const OpenrouterCreateChatCompletionInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterCreateChatCompletionInput: z.ZodObject<{
|
|
5
|
+
n: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
stop: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7
|
+
user: z.ZodOptional<z.ZodString>;
|
|
8
|
+
model: z.ZodString;
|
|
9
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
stream: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
11
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
12
|
+
role: z.ZodEnum<{
|
|
13
|
+
user: "user";
|
|
14
|
+
system: "system";
|
|
15
|
+
assistant: "assistant";
|
|
16
|
+
tool: "tool";
|
|
17
|
+
}>;
|
|
18
|
+
content: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>>;
|
|
25
|
+
logit_bias: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
26
|
+
max_tokens: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
function_call: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
29
|
+
none: "none";
|
|
30
|
+
auto: "auto";
|
|
31
|
+
}>, z.ZodObject<{}, z.core.$strip>]>>;
|
|
32
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
declare const OpenrouterCreateChatCompletionOutput: z.ZodObject<{
|
|
36
|
+
id: z.ZodNullable<z.ZodString>;
|
|
37
|
+
model: z.ZodNullable<z.ZodString>;
|
|
38
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
|
+
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
prompt_tokens: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
completion_tokens: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
object: z.ZodNullable<z.ZodEnum<{
|
|
44
|
+
"chat.completion": "chat.completion";
|
|
45
|
+
"chat.completion.chunk": "chat.completion.chunk";
|
|
46
|
+
}>>;
|
|
47
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
48
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
|
+
code: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
message: z.ZodNullable<z.ZodString>;
|
|
51
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
message: z.ZodNullable<z.ZodObject<{
|
|
54
|
+
role: z.ZodNullable<z.ZodString>;
|
|
55
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodNullable<z.ZodString>;
|
|
58
|
+
type: z.ZodNullable<z.ZodString>;
|
|
59
|
+
function: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
name: z.ZodNullable<z.ZodString>;
|
|
61
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>>>>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
native_finish_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
created: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
system_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
declare const openrouterCreateChatCompletion: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
72
|
+
model: string;
|
|
73
|
+
messages: {
|
|
74
|
+
role: "user" | "system" | "assistant" | "tool";
|
|
75
|
+
content: string;
|
|
76
|
+
}[];
|
|
77
|
+
n?: number | undefined;
|
|
78
|
+
stop?: string | string[] | undefined;
|
|
79
|
+
user?: string | undefined;
|
|
80
|
+
top_p?: number | undefined;
|
|
81
|
+
stream?: boolean | undefined;
|
|
82
|
+
functions?: {
|
|
83
|
+
name: string;
|
|
84
|
+
parameters: Record<string, unknown>;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
logit_bias?: Record<string, never> | undefined;
|
|
88
|
+
max_tokens?: number | undefined;
|
|
89
|
+
temperature?: number | undefined;
|
|
90
|
+
function_call?: "none" | "auto" | Record<string, never> | undefined;
|
|
91
|
+
presence_penalty?: number | undefined;
|
|
92
|
+
frequency_penalty?: number | undefined;
|
|
93
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
94
|
//#endregion
|
|
8
95
|
export { openrouterCreateChatCompletion };
|
|
9
96
|
//# sourceMappingURL=create-chat-completion.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-chat-completion.d.mts","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"mappings":";;;cAIa,mCAAA,
|
|
1
|
+
{"version":3,"file":"create-chat-completion.d.mts","names":[],"sources":["../../src/actions/create-chat-completion.ts"],"mappings":";;;cAIa,mCAAA,EAAmC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqDnC,oCAAA,EAAoC,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUpC,8BAAA,gCAA8B,wBAAA"}
|
|
@@ -30,26 +30,26 @@ const OpenrouterCreateChatCompletionInput = z.object({
|
|
|
30
30
|
frequency_penalty: z.number().describe("Penalty for new tokens based on frequency in the text so far.").optional()
|
|
31
31
|
});
|
|
32
32
|
const OpenrouterCreateChatCompletion_UsageSchema = z.object({
|
|
33
|
-
total_tokens: z.number().int().describe("Total number of tokens used."),
|
|
34
|
-
prompt_tokens: z.number().int().describe("Number of tokens in the prompt."),
|
|
35
|
-
completion_tokens: z.number().int().describe("Number of tokens generated in the completion.")
|
|
33
|
+
total_tokens: z.number().int().describe("Total number of tokens used.").nullable(),
|
|
34
|
+
prompt_tokens: z.number().int().describe("Number of tokens in the prompt.").nullable(),
|
|
35
|
+
completion_tokens: z.number().int().describe("Number of tokens generated in the completion.").nullable()
|
|
36
36
|
});
|
|
37
37
|
const OpenrouterCreateChatCompletion_ErrorResponseSchema = z.object({
|
|
38
|
-
code: z.number().int().describe("Error code from the provider."),
|
|
39
|
-
message: z.string().describe("Error message from the provider."),
|
|
38
|
+
code: z.number().int().describe("Error code from the provider.").nullable(),
|
|
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
|
});
|
|
42
42
|
const OpenrouterCreateChatCompletion_FunctionCallSchema = z.object({
|
|
43
|
-
name: z.string().describe("Name of the function called by the model."),
|
|
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
|
});
|
|
46
46
|
const OpenrouterCreateChatCompletion_ToolCallSchema = z.object({
|
|
47
|
-
id: z.string().describe("Unique identifier for this tool call."),
|
|
48
|
-
type: z.string().describe("Type of the call (function)."),
|
|
47
|
+
id: z.string().describe("Unique identifier for this tool call.").nullable(),
|
|
48
|
+
type: z.string().describe("Type of the call (function).").nullable(),
|
|
49
49
|
"function": OpenrouterCreateChatCompletion_FunctionCallSchema.nullable()
|
|
50
50
|
});
|
|
51
51
|
const OpenrouterCreateChatCompletion_ChoiceMessageSchema = z.object({
|
|
52
|
-
role: z.string().describe("Role of the generated message content."),
|
|
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
|
});
|
|
@@ -65,12 +65,12 @@ const openrouterCreateChatCompletion = action("OPENROUTER_CREATE_CHAT_COMPLETION
|
|
|
65
65
|
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.",
|
|
66
66
|
input: OpenrouterCreateChatCompletionInput,
|
|
67
67
|
output: z.object({
|
|
68
|
-
id: z.string().describe("Unique identifier for the completion."),
|
|
69
|
-
model: z.string().describe("Model ID used for the completion."),
|
|
68
|
+
id: z.string().describe("Unique identifier for the completion.").nullable(),
|
|
69
|
+
model: z.string().describe("Model ID used for the completion.").nullable(),
|
|
70
70
|
usage: OpenrouterCreateChatCompletion_UsageSchema.nullable().optional(),
|
|
71
|
-
object: z.enum(["chat.completion", "chat.completion.chunk"]).describe("Object type returned."),
|
|
71
|
+
object: z.enum(["chat.completion", "chat.completion.chunk"]).describe("Object type returned.").nullable(),
|
|
72
72
|
choices: z.array(OpenrouterCreateChatCompletion_CreateChoiceSchema).describe("List of generated completion choices."),
|
|
73
|
-
created: z.number().int().describe("Unix timestamp when the completion was created."),
|
|
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
|
})
|
|
76
76
|
});
|
|
@@ -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
|
|
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.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,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,CAAC,SAAS,sDAAsD;CACjE,WAAW,EAAE,MAAM,EAAE,OAAO;EAC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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,CAOU;AACV,CAAC"}
|
|
@@ -14,10 +14,10 @@ const OpenrouterCreateCoinbaseChargeInput = zod.z.object({
|
|
|
14
14
|
});
|
|
15
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") });
|
|
16
16
|
const OpenrouterCreateCoinbaseCharge_ChargeDataSchema = zod.z.object({
|
|
17
|
-
id: zod.z.string().describe("Unique identifier for the created charge"),
|
|
17
|
+
id: zod.z.string().describe("Unique identifier for the created charge").nullable(),
|
|
18
18
|
web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),
|
|
19
|
-
created_at: zod.z.string().describe("ISO 8601 timestamp when the charge was created"),
|
|
20
|
-
expires_at: zod.z.string().describe("ISO 8601 timestamp when the charge expires")
|
|
19
|
+
created_at: zod.z.string().describe("ISO 8601 timestamp when the charge was created").nullable(),
|
|
20
|
+
expires_at: zod.z.string().describe("ISO 8601 timestamp when the charge expires").nullable()
|
|
21
21
|
});
|
|
22
22
|
const OpenrouterCreateCoinbaseChargeOutput = zod.z.object({ data: OpenrouterCreateCoinbaseCharge_ChargeDataSchema.nullable() });
|
|
23
23
|
const openrouterCreateCoinbaseCharge = require_action.action("OPENROUTER_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
|
|
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;AACD,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;AACD,MAAa,uCAAuCA,IAAAA,EAAE,OAAO,EAC3D,MAAM,gDAAgD,SAAS,EACjE,CAAC;AAED,MAAa,iCAAiCC,eAAAA,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/create-coinbase-charge.d.ts
|
|
4
|
-
declare const OpenrouterCreateCoinbaseChargeInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterCreateCoinbaseChargeInput: z.ZodObject<{
|
|
5
|
+
amount: z.ZodNumber;
|
|
6
|
+
sender: z.ZodString;
|
|
7
|
+
X_Title: z.ZodOptional<z.ZodString>;
|
|
8
|
+
chain_id: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<137>, z.ZodLiteral<8453>]>;
|
|
9
|
+
HTTP_Referer: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
declare const OpenrouterCreateCoinbaseChargeOutput: z.ZodObject<{
|
|
12
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
13
|
+
id: z.ZodNullable<z.ZodString>;
|
|
14
|
+
web3_data: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
transfer_intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
18
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
declare const openrouterCreateCoinbaseCharge: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
22
|
+
amount: number;
|
|
23
|
+
sender: string;
|
|
24
|
+
chain_id: 1 | 137 | 8453;
|
|
25
|
+
X_Title?: string | undefined;
|
|
26
|
+
HTTP_Referer?: string | undefined;
|
|
27
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
28
|
//#endregion
|
|
8
29
|
export { openrouterCreateCoinbaseCharge };
|
|
9
30
|
//# sourceMappingURL=create-coinbase-charge.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coinbase-charge.d.cts","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"mappings":";;;cAIa,mCAAA,
|
|
1
|
+
{"version":3,"file":"create-coinbase-charge.d.cts","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"mappings":";;;cAIa,mCAAA,EAAmC,CAAA,CAAA,SAAA;;;;;;;cAgBnC,oCAAA,EAAoC,CAAA,CAAA,SAAA;;;;;;;;;;cAIpC,8BAAA,gCAA8B,wBAAA"}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/create-coinbase-charge.d.ts
|
|
4
|
-
declare const OpenrouterCreateCoinbaseChargeInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterCreateCoinbaseChargeInput: z.ZodObject<{
|
|
5
|
+
amount: z.ZodNumber;
|
|
6
|
+
sender: z.ZodString;
|
|
7
|
+
X_Title: z.ZodOptional<z.ZodString>;
|
|
8
|
+
chain_id: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<137>, z.ZodLiteral<8453>]>;
|
|
9
|
+
HTTP_Referer: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
declare const OpenrouterCreateCoinbaseChargeOutput: z.ZodObject<{
|
|
12
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
13
|
+
id: z.ZodNullable<z.ZodString>;
|
|
14
|
+
web3_data: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
transfer_intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
18
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
declare const openrouterCreateCoinbaseCharge: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
22
|
+
amount: number;
|
|
23
|
+
sender: string;
|
|
24
|
+
chain_id: 1 | 137 | 8453;
|
|
25
|
+
X_Title?: string | undefined;
|
|
26
|
+
HTTP_Referer?: string | undefined;
|
|
27
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
28
|
//#endregion
|
|
8
29
|
export { openrouterCreateCoinbaseCharge };
|
|
9
30
|
//# sourceMappingURL=create-coinbase-charge.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-coinbase-charge.d.mts","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"mappings":";;;cAIa,mCAAA,
|
|
1
|
+
{"version":3,"file":"create-coinbase-charge.d.mts","names":[],"sources":["../../src/actions/create-coinbase-charge.ts"],"mappings":";;;cAIa,mCAAA,EAAmC,CAAA,CAAA,SAAA;;;;;;;cAgBnC,oCAAA,EAAoC,CAAA,CAAA,SAAA;;;;;;;;;;cAIpC,8BAAA,gCAA8B,wBAAA"}
|
|
@@ -14,10 +14,10 @@ const OpenrouterCreateCoinbaseChargeInput = z.object({
|
|
|
14
14
|
});
|
|
15
15
|
const OpenrouterCreateCoinbaseCharge_Web3DataSchema = z.object({ transfer_intent: z.record(z.string(), z.unknown()).describe("Details of the transfer intent for the crypto payment") });
|
|
16
16
|
const OpenrouterCreateCoinbaseCharge_ChargeDataSchema = z.object({
|
|
17
|
-
id: z.string().describe("Unique identifier for the created charge"),
|
|
17
|
+
id: z.string().describe("Unique identifier for the created charge").nullable(),
|
|
18
18
|
web3_data: OpenrouterCreateCoinbaseCharge_Web3DataSchema.nullable(),
|
|
19
|
-
created_at: z.string().describe("ISO 8601 timestamp when the charge was created"),
|
|
20
|
-
expires_at: z.string().describe("ISO 8601 timestamp when the charge expires")
|
|
19
|
+
created_at: z.string().describe("ISO 8601 timestamp when the charge was created").nullable(),
|
|
20
|
+
expires_at: z.string().describe("ISO 8601 timestamp when the charge expires").nullable()
|
|
21
21
|
});
|
|
22
22
|
const openrouterCreateCoinbaseCharge = action("OPENROUTER_CREATE_COINBASE_CHARGE", {
|
|
23
23
|
slug: "openrouter-create-coinbase-charge",
|
|
@@ -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
|
|
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;AACD,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;AAKD,MAAa,iCAAiC,OAAO,qCAAqC;CACxF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QATkD,EAAE,OAAO,EAC3D,MAAM,gDAAgD,SAAS,EACjE,CAOU;AACV,CAAC"}
|