@keystrokehq/perplexityai 0.1.0

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.
Files changed (106) hide show
  1. package/README.md +17 -0
  2. package/dist/action.cjs +21 -0
  3. package/dist/action.cjs.map +1 -0
  4. package/dist/action.mjs +21 -0
  5. package/dist/action.mjs.map +1 -0
  6. package/dist/actions/create-async-chat-completion.cjs +73 -0
  7. package/dist/actions/create-async-chat-completion.cjs.map +1 -0
  8. package/dist/actions/create-async-chat-completion.d.cts +9 -0
  9. package/dist/actions/create-async-chat-completion.d.cts.map +1 -0
  10. package/dist/actions/create-async-chat-completion.d.mts +9 -0
  11. package/dist/actions/create-async-chat-completion.d.mts.map +1 -0
  12. package/dist/actions/create-async-chat-completion.mjs +72 -0
  13. package/dist/actions/create-async-chat-completion.mjs.map +1 -0
  14. package/dist/actions/create-chat-completion.cjs +122 -0
  15. package/dist/actions/create-chat-completion.cjs.map +1 -0
  16. package/dist/actions/create-chat-completion.d.cts +9 -0
  17. package/dist/actions/create-chat-completion.d.cts.map +1 -0
  18. package/dist/actions/create-chat-completion.d.mts +9 -0
  19. package/dist/actions/create-chat-completion.d.mts.map +1 -0
  20. package/dist/actions/create-chat-completion.mjs +121 -0
  21. package/dist/actions/create-chat-completion.mjs.map +1 -0
  22. package/dist/actions/create-contextualized-embeddings.cjs +40 -0
  23. package/dist/actions/create-contextualized-embeddings.cjs.map +1 -0
  24. package/dist/actions/create-contextualized-embeddings.d.cts +9 -0
  25. package/dist/actions/create-contextualized-embeddings.d.cts.map +1 -0
  26. package/dist/actions/create-contextualized-embeddings.d.mts +9 -0
  27. package/dist/actions/create-contextualized-embeddings.d.mts.map +1 -0
  28. package/dist/actions/create-contextualized-embeddings.mjs +39 -0
  29. package/dist/actions/create-contextualized-embeddings.mjs.map +1 -0
  30. package/dist/actions/create-embeddings.cjs +41 -0
  31. package/dist/actions/create-embeddings.cjs.map +1 -0
  32. package/dist/actions/create-embeddings.d.cts +9 -0
  33. package/dist/actions/create-embeddings.d.cts.map +1 -0
  34. package/dist/actions/create-embeddings.d.mts +9 -0
  35. package/dist/actions/create-embeddings.d.mts.map +1 -0
  36. package/dist/actions/create-embeddings.mjs +40 -0
  37. package/dist/actions/create-embeddings.mjs.map +1 -0
  38. package/dist/actions/execute-agent.cjs +71 -0
  39. package/dist/actions/execute-agent.cjs.map +1 -0
  40. package/dist/actions/execute-agent.d.cts +9 -0
  41. package/dist/actions/execute-agent.d.cts.map +1 -0
  42. package/dist/actions/execute-agent.d.mts +9 -0
  43. package/dist/actions/execute-agent.d.mts.map +1 -0
  44. package/dist/actions/execute-agent.mjs +68 -0
  45. package/dist/actions/execute-agent.mjs.map +1 -0
  46. package/dist/actions/get-async-chat-completion.cjs +32 -0
  47. package/dist/actions/get-async-chat-completion.cjs.map +1 -0
  48. package/dist/actions/get-async-chat-completion.d.cts +9 -0
  49. package/dist/actions/get-async-chat-completion.d.cts.map +1 -0
  50. package/dist/actions/get-async-chat-completion.d.mts +9 -0
  51. package/dist/actions/get-async-chat-completion.d.mts.map +1 -0
  52. package/dist/actions/get-async-chat-completion.mjs +31 -0
  53. package/dist/actions/get-async-chat-completion.mjs.map +1 -0
  54. package/dist/actions/index.cjs +19 -0
  55. package/dist/actions/index.d.cts +10 -0
  56. package/dist/actions/index.d.mts +10 -0
  57. package/dist/actions/index.mjs +10 -0
  58. package/dist/actions/list-async-chat-completions.cjs +34 -0
  59. package/dist/actions/list-async-chat-completions.cjs.map +1 -0
  60. package/dist/actions/list-async-chat-completions.d.cts +9 -0
  61. package/dist/actions/list-async-chat-completions.d.cts.map +1 -0
  62. package/dist/actions/list-async-chat-completions.d.mts +9 -0
  63. package/dist/actions/list-async-chat-completions.d.mts.map +1 -0
  64. package/dist/actions/list-async-chat-completions.mjs +33 -0
  65. package/dist/actions/list-async-chat-completions.mjs.map +1 -0
  66. package/dist/actions/list-models.cjs +25 -0
  67. package/dist/actions/list-models.cjs.map +1 -0
  68. package/dist/actions/list-models.d.cts +9 -0
  69. package/dist/actions/list-models.d.cts.map +1 -0
  70. package/dist/actions/list-models.d.mts +9 -0
  71. package/dist/actions/list-models.d.mts.map +1 -0
  72. package/dist/actions/list-models.mjs +24 -0
  73. package/dist/actions/list-models.mjs.map +1 -0
  74. package/dist/actions/search.cjs +46 -0
  75. package/dist/actions/search.cjs.map +1 -0
  76. package/dist/actions/search.d.cts +9 -0
  77. package/dist/actions/search.d.cts.map +1 -0
  78. package/dist/actions/search.d.mts +9 -0
  79. package/dist/actions/search.d.mts.map +1 -0
  80. package/dist/actions/search.mjs +45 -0
  81. package/dist/actions/search.mjs.map +1 -0
  82. package/dist/app.cjs +9 -0
  83. package/dist/app.cjs.map +1 -0
  84. package/dist/app.d.cts +5 -0
  85. package/dist/app.d.cts.map +1 -0
  86. package/dist/app.d.mts +5 -0
  87. package/dist/app.d.mts.map +1 -0
  88. package/dist/app.mjs +10 -0
  89. package/dist/app.mjs.map +1 -0
  90. package/dist/catalog.cjs +15 -0
  91. package/dist/catalog.cjs.map +1 -0
  92. package/dist/catalog.d.cts +14 -0
  93. package/dist/catalog.d.cts.map +1 -0
  94. package/dist/catalog.d.mts +14 -0
  95. package/dist/catalog.d.mts.map +1 -0
  96. package/dist/catalog.mjs +15 -0
  97. package/dist/catalog.mjs.map +1 -0
  98. package/dist/execute.cjs +18 -0
  99. package/dist/execute.cjs.map +1 -0
  100. package/dist/execute.mjs +18 -0
  101. package/dist/execute.mjs.map +1 -0
  102. package/dist/index.cjs +24 -0
  103. package/dist/index.d.cts +12 -0
  104. package/dist/index.d.mts +12 -0
  105. package/dist/index.mjs +13 -0
  106. package/package.json +49 -0
@@ -0,0 +1,121 @@
1
+ import { action } from "../action.mjs";
2
+ import { z } from "zod";
3
+ //#region src/actions/create-chat-completion.ts
4
+ const PerplexityaiCreateChatCompletionInput = z.object({
5
+ stop: z.union([z.string(), z.array(z.string())]).optional(),
6
+ model: z.enum([
7
+ "sonar",
8
+ "sonar-pro",
9
+ "sonar-deep-research",
10
+ "sonar-reasoning-pro"
11
+ ]).default("sonar").describe("The Sonar model to use. 'sonar' for fast/cheap queries, 'sonar-pro' for complex queries, 'sonar-reasoning-pro' for chain-of-thought reasoning, 'sonar-deep-research' for exhaustive research (generates very long 10K+ word responses; prefer the async endpoint for this model).").optional(),
12
+ top_p: z.number().describe("Nucleus sampling threshold controlling cumulative probability of tokens.").optional(),
13
+ stream: z.boolean().describe("Whether to stream the response using server-sent events.").optional(),
14
+ messages: z.array(z.object({
15
+ role: z.enum([
16
+ "system",
17
+ "user",
18
+ "assistant",
19
+ "tool"
20
+ ]).describe("Role of the message sender (system, user, assistant, or tool)"),
21
+ content: z.string().describe("Content of the message")
22
+ }).describe("A message in the conversation.")).describe("A list of messages comprising the conversation. Each message has a role (system, user, assistant, tool) and content. Messages with 'tool' role must alternate with 'assistant' messages. Valid pattern: system -> user -> assistant -> tool -> user."),
23
+ max_tokens: z.number().int().describe("Maximum number of tokens to generate. Max 128000.").optional(),
24
+ search_mode: z.string().describe("Search mode. Options: 'web', 'academic', 'sec'.").optional(),
25
+ stream_mode: z.string().describe("Stream mode: 'full' (default) or 'concise'.").optional(),
26
+ temperature: z.number().describe("Controls randomness. 0 is deterministic, up to 2 is more random.").optional(),
27
+ return_images: z.boolean().describe("Whether to include images in the response.").optional(),
28
+ disable_search: z.boolean().describe("Whether to disable web search entirely.").optional(),
29
+ response_format: z.object({
30
+ type: z.string().describe("Type of response format: 'text' or 'json_schema'"),
31
+ json_schema: z.object({
32
+ name: z.string().default("schema").describe("Name of the schema").optional(),
33
+ schema: z.record(z.string(), z.unknown()).describe("The JSON schema definition"),
34
+ strict: z.boolean().default(true).describe("Whether to enforce strict schema validation").optional(),
35
+ description: z.string().describe("Description of the schema").optional()
36
+ }).describe("JSON schema configuration for structured output.").optional()
37
+ }).describe("Response format configuration.").optional(),
38
+ reasoning_effort: z.string().describe("Reasoning effort level: 'minimal', 'low', 'medium', 'high'.").optional(),
39
+ web_search_options: z.object({
40
+ search_type: z.string().describe("Type of search to perform. Options: 'fast', 'pro', 'auto'").optional(),
41
+ search_context_size: z.string().describe("Amount of context used for search queries. Options: 'low', 'medium', 'high'").optional()
42
+ }).describe("Options for web search behavior.").optional(),
43
+ image_domain_filter: z.array(z.string()).describe("Filter images by source domain.").optional(),
44
+ image_format_filter: z.array(z.string()).describe("Filter images by format (e.g. 'png', 'jpg').").optional(),
45
+ language_preference: z.string().describe("Preferred response language as ISO 639-1 code (e.g. 'en', 'fr').").optional(),
46
+ search_domain_filter: z.array(z.string()).describe("List of domains to restrict search results to.").optional(),
47
+ search_recency_filter: z.string().describe("Filter by recency: 'hour', 'day', 'week', 'month', 'year'. Mutually exclusive with date filters (search_after_date_filter, search_before_date_filter, last_updated_after_filter, last_updated_before_filter).").optional(),
48
+ search_language_filter: z.array(z.string()).describe("ISO 639-1 language codes to filter search results.").optional(),
49
+ enable_search_classifier: z.boolean().describe("Whether to enable the search classifier.").optional(),
50
+ return_related_questions: z.boolean().describe("Whether to return related questions.").optional(),
51
+ search_after_date_filter: z.string().describe("Only include results published after this date (MM/DD/YYYY). Cannot be used with search_recency_filter.").optional(),
52
+ last_updated_after_filter: z.string().describe("Only include results last updated after this date (MM/DD/YYYY).").optional(),
53
+ search_before_date_filter: z.string().describe("Only include results published before this date (MM/DD/YYYY). Cannot be used with search_recency_filter.").optional(),
54
+ last_updated_before_filter: z.string().describe("Only include results last updated before this date (MM/DD/YYYY).").optional()
55
+ }).describe("Request model for Sonar chat completions.");
56
+ const PerplexityaiCreateChatCompletion_CostSchema = z.object({
57
+ total_cost: z.number().describe("Total cost").nullable().optional(),
58
+ request_cost: z.number().describe("Per-request cost").nullable().optional(),
59
+ input_tokens_cost: z.number().describe("Cost for input tokens").nullable().optional(),
60
+ output_tokens_cost: z.number().describe("Cost for output tokens").nullable().optional(),
61
+ search_queries_cost: z.number().describe("Cost for search queries").nullable().optional(),
62
+ citation_tokens_cost: z.number().describe("Cost for citation tokens").nullable().optional(),
63
+ reasoning_tokens_cost: z.number().describe("Cost for reasoning tokens").nullable().optional()
64
+ }).describe("Cost breakdown for the completion.");
65
+ const PerplexityaiCreateChatCompletion_UsageInfoSchema = z.object({
66
+ cost: PerplexityaiCreateChatCompletion_CostSchema.nullable().optional(),
67
+ total_tokens: z.number().int().describe("Total number of tokens used"),
68
+ prompt_tokens: z.number().int().describe("Number of tokens in the prompt"),
69
+ citation_tokens: z.number().int().describe("Tokens used for citations").nullable().optional(),
70
+ reasoning_tokens: z.number().int().describe("Tokens used for reasoning").nullable().optional(),
71
+ completion_tokens: z.number().int().describe("Number of tokens in the completion"),
72
+ num_search_queries: z.number().int().describe("Number of search queries").nullable().optional(),
73
+ search_context_size: z.string().describe("Search context size used").nullable().optional()
74
+ }).describe("Token usage information.");
75
+ const PerplexityaiCreateChatCompletion_ImageResultSchema = z.object({
76
+ title: z.string().describe("Title of the image").nullable().optional(),
77
+ width: z.number().int().describe("Image width in pixels").nullable().optional(),
78
+ height: z.number().int().describe("Image height in pixels").nullable().optional(),
79
+ image_url: z.string().describe("URL of the image"),
80
+ origin_url: z.string().describe("URL of the page containing the image")
81
+ }).describe("An image result.");
82
+ const PerplexityaiCreateChatCompletion_ChoiceMessageSchema = z.object({
83
+ role: z.string().describe("Role of the message sender").nullable().optional(),
84
+ content: z.string().describe("Content of the message").nullable().optional()
85
+ }).describe("Message in a completion choice.");
86
+ const PerplexityaiCreateChatCompletion_ChoiceSchema = z.object({
87
+ delta: PerplexityaiCreateChatCompletion_ChoiceMessageSchema.nullable().optional(),
88
+ index: z.number().int().describe("Index of this choice"),
89
+ message: PerplexityaiCreateChatCompletion_ChoiceMessageSchema.nullable().optional(),
90
+ finish_reason: z.string().describe("Reason generation stopped: 'stop' or 'length'").nullable().optional()
91
+ }).describe("A completion choice.");
92
+ const PerplexityaiCreateChatCompletion_SearchResultSchema = z.object({
93
+ url: z.string().describe("URL of the search result"),
94
+ date: z.string().describe("Publication date").nullable().optional(),
95
+ title: z.string().describe("Title of the search result"),
96
+ source: z.string().describe("Source type: 'web' or 'attachment'").nullable().optional(),
97
+ snippet: z.string().describe("Text snippet").nullable().optional(),
98
+ last_updated: z.string().describe("Last updated date").nullable().optional()
99
+ }).describe("A search result used to ground the response.");
100
+ const perplexityaiCreateChatCompletion = action("PERPLEXITYAI_CREATE_CHAT_COMPLETION", {
101
+ slug: "perplexityai-create-chat-completion",
102
+ name: "Create Chat Completion",
103
+ description: "Perplexity Sonar Chat Completions (POST /v1/sonar). Generates web-grounded conversational AI responses with citations. Supports multiple Sonar models optimized for different use cases: - sonar: Fast, cost-effective for simple queries - sonar-pro: Enhanced quality for complex questions - sonar-reasoning-pro: Chain-of-thought reasoning with <think> blocks - sonar-deep-research: Exhaustive multi-source research (generates very long responses, 10K+ words; prefer the async endpoint for this model) Features: web search grounding, citations, images, structured JSON output, search filtering by domain/date/language/recency, and streaming. Important constraints: - search_recency_filter and date filters (search_after_date_filter, search_before_date_filter, etc.) are mutually exclusive. Use one or the other, not both. - Messages with the 'tool' role must alternate with 'assistant' messages. A valid pattern is: system -> user -> assistant -> tool -> user. - The 'stop' parameter is not currently supported by the API.",
104
+ input: PerplexityaiCreateChatCompletionInput,
105
+ output: z.object({
106
+ id: z.string().describe("Unique identifier for the completion"),
107
+ model: z.string().describe("Model used for the completion"),
108
+ usage: PerplexityaiCreateChatCompletion_UsageInfoSchema.nullable().optional(),
109
+ images: z.array(PerplexityaiCreateChatCompletion_ImageResultSchema).describe("Image results").nullable().optional(),
110
+ object: z.string().describe("Object type, typically 'chat.completion'"),
111
+ choices: z.array(PerplexityaiCreateChatCompletion_ChoiceSchema).describe("List of completion choices"),
112
+ created: z.number().int().describe("Unix timestamp when the completion was created"),
113
+ citations: z.array(z.string()).describe("Citation URLs").nullable().optional(),
114
+ search_results: z.array(PerplexityaiCreateChatCompletion_SearchResultSchema).describe("Search results used to ground the response").nullable().optional(),
115
+ related_questions: z.array(z.string()).describe("Related questions").nullable().optional()
116
+ }).describe("Response model for Sonar chat completions.")
117
+ });
118
+ //#endregion
119
+ export { perplexityaiCreateChatCompletion };
120
+
121
+ //# sourceMappingURL=create-chat-completion.mjs.map
@@ -0,0 +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 PerplexityaiCreateChatCompletionInput: z.ZodTypeAny = z.object({\n stop: z.union([z.string(), z.array(z.string())]).optional(),\n model: z.enum([\"sonar\", \"sonar-pro\", \"sonar-deep-research\", \"sonar-reasoning-pro\"]).default(\"sonar\").describe(\"The Sonar model to use. 'sonar' for fast/cheap queries, 'sonar-pro' for complex queries, 'sonar-reasoning-pro' for chain-of-thought reasoning, 'sonar-deep-research' for exhaustive research (generates very long 10K+ word responses; prefer the async endpoint for this model).\").optional(),\n top_p: z.number().describe(\"Nucleus sampling threshold controlling cumulative probability of tokens.\").optional(),\n stream: z.boolean().describe(\"Whether to stream the response using server-sent events.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"system\", \"user\", \"assistant\", \"tool\"]).describe(\"Role of the message sender (system, user, assistant, or tool)\"),\n content: z.string().describe(\"Content of the message\"),\n}).describe(\"A message in the conversation.\")).describe(\"A list of messages comprising the conversation. Each message has a role (system, user, assistant, tool) and content. Messages with 'tool' role must alternate with 'assistant' messages. Valid pattern: system -> user -> assistant -> tool -> user.\"),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate. Max 128000.\").optional(),\n search_mode: z.string().describe(\"Search mode. Options: 'web', 'academic', 'sec'.\").optional(),\n stream_mode: z.string().describe(\"Stream mode: 'full' (default) or 'concise'.\").optional(),\n temperature: z.number().describe(\"Controls randomness. 0 is deterministic, up to 2 is more random.\").optional(),\n return_images: z.boolean().describe(\"Whether to include images in the response.\").optional(),\n disable_search: z.boolean().describe(\"Whether to disable web search entirely.\").optional(),\n response_format: z.object({\n type: z.string().describe(\"Type of response format: 'text' or 'json_schema'\"),\n json_schema: z.object({\n name: z.string().default(\"schema\").describe(\"Name of the schema\").optional(),\n schema: z.record(z.string(), z.unknown()).describe(\"The JSON schema definition\"),\n strict: z.boolean().default(true).describe(\"Whether to enforce strict schema validation\").optional(),\n description: z.string().describe(\"Description of the schema\").optional(),\n}).describe(\"JSON schema configuration for structured output.\").optional(),\n}).describe(\"Response format configuration.\").optional(),\n reasoning_effort: z.string().describe(\"Reasoning effort level: 'minimal', 'low', 'medium', 'high'.\").optional(),\n web_search_options: z.object({\n search_type: z.string().describe(\"Type of search to perform. Options: 'fast', 'pro', 'auto'\").optional(),\n search_context_size: z.string().describe(\"Amount of context used for search queries. Options: 'low', 'medium', 'high'\").optional(),\n}).describe(\"Options for web search behavior.\").optional(),\n image_domain_filter: z.array(z.string()).describe(\"Filter images by source domain.\").optional(),\n image_format_filter: z.array(z.string()).describe(\"Filter images by format (e.g. 'png', 'jpg').\").optional(),\n language_preference: z.string().describe(\"Preferred response language as ISO 639-1 code (e.g. 'en', 'fr').\").optional(),\n search_domain_filter: z.array(z.string()).describe(\"List of domains to restrict search results to.\").optional(),\n search_recency_filter: z.string().describe(\"Filter by recency: 'hour', 'day', 'week', 'month', 'year'. Mutually exclusive with date filters (search_after_date_filter, search_before_date_filter, last_updated_after_filter, last_updated_before_filter).\").optional(),\n search_language_filter: z.array(z.string()).describe(\"ISO 639-1 language codes to filter search results.\").optional(),\n enable_search_classifier: z.boolean().describe(\"Whether to enable the search classifier.\").optional(),\n return_related_questions: z.boolean().describe(\"Whether to return related questions.\").optional(),\n search_after_date_filter: z.string().describe(\"Only include results published after this date (MM/DD/YYYY). Cannot be used with search_recency_filter.\").optional(),\n last_updated_after_filter: z.string().describe(\"Only include results last updated after this date (MM/DD/YYYY).\").optional(),\n search_before_date_filter: z.string().describe(\"Only include results published before this date (MM/DD/YYYY). Cannot be used with search_recency_filter.\").optional(),\n last_updated_before_filter: z.string().describe(\"Only include results last updated before this date (MM/DD/YYYY).\").optional(),\n}).describe(\"Request model for Sonar chat completions.\");\nconst PerplexityaiCreateChatCompletion_CostSchema: z.ZodTypeAny = z.object({\n total_cost: z.number().describe(\"Total cost\").nullable().optional(),\n request_cost: z.number().describe(\"Per-request cost\").nullable().optional(),\n input_tokens_cost: z.number().describe(\"Cost for input tokens\").nullable().optional(),\n output_tokens_cost: z.number().describe(\"Cost for output tokens\").nullable().optional(),\n search_queries_cost: z.number().describe(\"Cost for search queries\").nullable().optional(),\n citation_tokens_cost: z.number().describe(\"Cost for citation tokens\").nullable().optional(),\n reasoning_tokens_cost: z.number().describe(\"Cost for reasoning tokens\").nullable().optional(),\n}).describe(\"Cost breakdown for the completion.\");\nconst PerplexityaiCreateChatCompletion_UsageInfoSchema: z.ZodTypeAny = z.object({\n cost: PerplexityaiCreateChatCompletion_CostSchema.nullable().optional(),\n total_tokens: z.number().int().describe(\"Total number of tokens used\"),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the prompt\"),\n citation_tokens: z.number().int().describe(\"Tokens used for citations\").nullable().optional(),\n reasoning_tokens: z.number().int().describe(\"Tokens used for reasoning\").nullable().optional(),\n completion_tokens: z.number().int().describe(\"Number of tokens in the completion\"),\n num_search_queries: z.number().int().describe(\"Number of search queries\").nullable().optional(),\n search_context_size: z.string().describe(\"Search context size used\").nullable().optional(),\n}).describe(\"Token usage information.\");\nconst PerplexityaiCreateChatCompletion_ImageResultSchema: z.ZodTypeAny = z.object({\n title: z.string().describe(\"Title of the image\").nullable().optional(),\n width: z.number().int().describe(\"Image width in pixels\").nullable().optional(),\n height: z.number().int().describe(\"Image height in pixels\").nullable().optional(),\n image_url: z.string().describe(\"URL of the image\"),\n origin_url: z.string().describe(\"URL of the page containing the image\"),\n}).describe(\"An image result.\");\nconst PerplexityaiCreateChatCompletion_ChoiceMessageSchema: z.ZodTypeAny = z.object({\n role: z.string().describe(\"Role of the message sender\").nullable().optional(),\n content: z.string().describe(\"Content of the message\").nullable().optional(),\n}).describe(\"Message in a completion choice.\");\nconst PerplexityaiCreateChatCompletion_ChoiceSchema: z.ZodTypeAny = z.object({\n delta: PerplexityaiCreateChatCompletion_ChoiceMessageSchema.nullable().optional(),\n index: z.number().int().describe(\"Index of this choice\"),\n message: PerplexityaiCreateChatCompletion_ChoiceMessageSchema.nullable().optional(),\n finish_reason: z.string().describe(\"Reason generation stopped: 'stop' or 'length'\").nullable().optional(),\n}).describe(\"A completion choice.\");\nconst PerplexityaiCreateChatCompletion_SearchResultSchema: z.ZodTypeAny = z.object({\n url: z.string().describe(\"URL of the search result\"),\n date: z.string().describe(\"Publication date\").nullable().optional(),\n title: z.string().describe(\"Title of the search result\"),\n source: z.string().describe(\"Source type: 'web' or 'attachment'\").nullable().optional(),\n snippet: z.string().describe(\"Text snippet\").nullable().optional(),\n last_updated: z.string().describe(\"Last updated date\").nullable().optional(),\n}).describe(\"A search result used to ground the response.\");\nexport const PerplexityaiCreateChatCompletionOutput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique identifier for the completion\"),\n model: z.string().describe(\"Model used for the completion\"),\n usage: PerplexityaiCreateChatCompletion_UsageInfoSchema.nullable().optional(),\n images: z.array(PerplexityaiCreateChatCompletion_ImageResultSchema).describe(\"Image results\").nullable().optional(),\n object: z.string().describe(\"Object type, typically 'chat.completion'\"),\n choices: z.array(PerplexityaiCreateChatCompletion_ChoiceSchema).describe(\"List of completion choices\"),\n created: z.number().int().describe(\"Unix timestamp when the completion was created\"),\n citations: z.array(z.string()).describe(\"Citation URLs\").nullable().optional(),\n search_results: z.array(PerplexityaiCreateChatCompletion_SearchResultSchema).describe(\"Search results used to ground the response\").nullable().optional(),\n related_questions: z.array(z.string()).describe(\"Related questions\").nullable().optional(),\n}).describe(\"Response model for Sonar chat completions.\");\n\nexport const perplexityaiCreateChatCompletion = action(\"PERPLEXITYAI_CREATE_CHAT_COMPLETION\", {\n slug: \"perplexityai-create-chat-completion\",\n name: \"Create Chat Completion\",\n description: \"Perplexity Sonar Chat Completions (POST /v1/sonar). Generates web-grounded conversational AI responses with citations. Supports multiple Sonar models optimized for different use cases: - sonar: Fast, cost-effective for simple queries - sonar-pro: Enhanced quality for complex questions - sonar-reasoning-pro: Chain-of-thought reasoning with <think> blocks - sonar-deep-research: Exhaustive multi-source research (generates very long responses, 10K+ words; prefer the async endpoint for this model) Features: web search grounding, citations, images, structured JSON output, search filtering by domain/date/language/recency, and streaming. Important constraints: - search_recency_filter and date filters (search_after_date_filter, search_before_date_filter, etc.) are mutually exclusive. Use one or the other, not both. - Messages with the 'tool' role must alternate with 'assistant' messages. A valid pattern is: system -> user -> assistant -> tool -> user. - The 'stop' parameter is not currently supported by the API.\",\n input: PerplexityaiCreateChatCompletionInput,\n output: PerplexityaiCreateChatCompletionOutput,\n});\n"],"mappings":";;;AAIA,MAAa,wCAAsD,EAAE,OAAO;CAC1E,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;CAC1D,OAAO,EAAE,KAAK;EAAC;EAAS;EAAa;EAAuB;CAAqB,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC,SAAS,mRAAmR,CAAC,CAAC,SAAS;CAC5Y,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,0EAA0E,CAAC,CAAC,SAAS;CAChH,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS,0DAA0D,CAAC,CAAC,SAAS;CAClG,UAAU,EAAE,MAAM,EAAE,OAAO;EAC3B,MAAM,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAa;EAAM,CAAC,CAAC,CAAC,SAAS,+DAA+D;EAC9H,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,wBAAwB;CACvD,CAAC,CAAC,CAAC,SAAS,gCAAgC,CAAC,CAAC,CAAC,SAAS,sPAAsP;CAC5S,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,mDAAmD,CAAC,CAAC,SAAS;CACpG,aAAa,EAAE,OAAO,CAAC,CAAC,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ACtF,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACjE,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC7E,CAAC,CAAC,CAAC,SAAS,8CAA8C;AAc1D,MAAa,mCAAmC,OAAO,uCAAuC;CAC5F,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAlBkE,EAAE,OAAO;EAC3E,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,sCAAsC;EAC9D,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,+BAA+B;EAC1D,OAAO,iDAAiD,SAAS,CAAC,CAAC,SAAS;EAC5E,QAAQ,EAAE,MAAM,kDAAkD,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAClH,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,0CAA0C;EACtE,SAAS,EAAE,MAAM,6CAA6C,CAAC,CAAC,SAAS,4BAA4B;EACrG,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,gDAAgD;EACnF,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC7E,gBAAgB,EAAE,MAAM,mDAAmD,CAAC,CAAC,SAAS,4CAA4C,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EACxJ,mBAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3F,CAAC,CAAC,CAAC,SAAS,4CAOF;AACV,CAAC"}
@@ -0,0 +1,40 @@
1
+ const require_action = require("../action.cjs");
2
+ let zod = require("zod");
3
+ //#region src/actions/create-contextualized-embeddings.ts
4
+ const PerplexityaiCreateContextualizedEmbeddingsInput = zod.z.object({
5
+ input: zod.z.array(zod.z.array(zod.z.string())).describe("Nested array of texts: outer array = documents, inner array = ordered chunks from that document. Max 512 documents, max 16000 total chunks, max 32K tokens per document, max 120K combined tokens. Empty strings not allowed."),
6
+ model: zod.z.enum(["pplx-embed-context-v1-0.6b", "pplx-embed-context-v1-4b"]).describe("The contextualized embedding model. pplx-embed-context-v1-0.6b (1024 dims, $0.008/1M tokens) or pplx-embed-context-v1-4b (2560 dims, $0.05/1M tokens)."),
7
+ dimensions: zod.z.number().int().describe("Custom output dimensions via Matryoshka. Range: 128-1024 for 0.6b, 128-2560 for 4b. Defaults to full dimensions.").optional(),
8
+ encoding_format: zod.z.enum(["base64_int8", "base64_binary"]).default("base64_int8").describe("Encoding format for embeddings output.").optional()
9
+ }).describe("Request model for creating contextualized embeddings.\nGenerates document-aware embeddings for text chunks that share a source document.\nChunks within each document must be in order.");
10
+ const PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema = zod.z.object({
11
+ index: zod.z.number().int().describe("Index of this chunk within its document"),
12
+ object: zod.z.string().describe("Object type, always 'embedding'"),
13
+ embedding: zod.z.string().describe("Base64-encoded embedding vector")
14
+ }).describe("A single embedding result.");
15
+ const PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema = zod.z.object({
16
+ data: zod.z.array(PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema).describe("Embeddings for each chunk"),
17
+ index: zod.z.number().int().describe("Index of this document in the input array"),
18
+ object: zod.z.string().describe("Object type, always 'list'")
19
+ }).describe("Embeddings for all chunks of a single document.");
20
+ const PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema = zod.z.object({
21
+ total_tokens: zod.z.number().int().describe("Total tokens processed"),
22
+ prompt_tokens: zod.z.number().int().describe("Number of tokens in the input")
23
+ }).describe("Token usage information.");
24
+ const PerplexityaiCreateContextualizedEmbeddingsOutput = zod.z.object({
25
+ data: zod.z.array(PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema).describe("Embeddings grouped by document"),
26
+ model: zod.z.string().describe("Model used to generate embeddings"),
27
+ usage: PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema.nullable(),
28
+ object: zod.z.string().describe("Object type, always 'list'")
29
+ }).describe("Response model for contextualized embeddings.");
30
+ const perplexityaiCreateContextualizedEmbeddings = require_action.action("PERPLEXITYAI_CREATE_CONTEXTUALIZED_EMBEDDINGS", {
31
+ slug: "perplexityai-create-contextualized-embeddings",
32
+ name: "Create Contextualized Embeddings",
33
+ description: "Create Contextualized Embeddings (POST /v1/contextualizedembeddings). Generates document-aware embeddings where chunks from the same document share context. Unlike standard embeddings, these recognize sequential relationships within documents, improving retrieval quality. Models: pplx-embed-context-v1-0.6b (1024 dims) and pplx-embed-context-v1-4b (2560 dims). Both support Matryoshka dimension reduction and INT8/binary quantization.",
34
+ input: PerplexityaiCreateContextualizedEmbeddingsInput,
35
+ output: PerplexityaiCreateContextualizedEmbeddingsOutput
36
+ });
37
+ //#endregion
38
+ exports.perplexityaiCreateContextualizedEmbeddings = perplexityaiCreateContextualizedEmbeddings;
39
+
40
+ //# sourceMappingURL=create-contextualized-embeddings.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contextualized-embeddings.cjs","names":["z","action"],"sources":["../../src/actions/create-contextualized-embeddings.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PerplexityaiCreateContextualizedEmbeddingsInput: z.ZodTypeAny = z.object({\n input: z.array(z.array(z.string())).describe(\"Nested array of texts: outer array = documents, inner array = ordered chunks from that document. Max 512 documents, max 16000 total chunks, max 32K tokens per document, max 120K combined tokens. Empty strings not allowed.\"),\n model: z.enum([\"pplx-embed-context-v1-0.6b\", \"pplx-embed-context-v1-4b\"]).describe(\"The contextualized embedding model. pplx-embed-context-v1-0.6b (1024 dims, $0.008/1M tokens) or pplx-embed-context-v1-4b (2560 dims, $0.05/1M tokens).\"),\n dimensions: z.number().int().describe(\"Custom output dimensions via Matryoshka. Range: 128-1024 for 0.6b, 128-2560 for 4b. Defaults to full dimensions.\").optional(),\n encoding_format: z.enum([\"base64_int8\", \"base64_binary\"]).default(\"base64_int8\").describe(\"Encoding format for embeddings output.\").optional(),\n}).describe(\"Request model for creating contextualized embeddings.\\nGenerates document-aware embeddings for text chunks that share a source document.\\nChunks within each document must be in order.\");\nconst PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema: z.ZodTypeAny = z.object({\n index: z.number().int().describe(\"Index of this chunk within its document\"),\n object: z.string().describe(\"Object type, always 'embedding'\"),\n embedding: z.string().describe(\"Base64-encoded embedding vector\"),\n}).describe(\"A single embedding result.\");\nconst PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema).describe(\"Embeddings for each chunk\"),\n index: z.number().int().describe(\"Index of this document in the input array\"),\n object: z.string().describe(\"Object type, always 'list'\"),\n}).describe(\"Embeddings for all chunks of a single document.\");\nconst PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema: z.ZodTypeAny = z.object({\n total_tokens: z.number().int().describe(\"Total tokens processed\"),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the input\"),\n}).describe(\"Token usage information.\");\nexport const PerplexityaiCreateContextualizedEmbeddingsOutput: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema).describe(\"Embeddings grouped by document\"),\n model: z.string().describe(\"Model used to generate embeddings\"),\n usage: PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema.nullable(),\n object: z.string().describe(\"Object type, always 'list'\"),\n}).describe(\"Response model for contextualized embeddings.\");\n\nexport const perplexityaiCreateContextualizedEmbeddings = action(\"PERPLEXITYAI_CREATE_CONTEXTUALIZED_EMBEDDINGS\", {\n slug: \"perplexityai-create-contextualized-embeddings\",\n name: \"Create Contextualized Embeddings\",\n description: \"Create Contextualized Embeddings (POST /v1/contextualizedembeddings). Generates document-aware embeddings where chunks from the same document share context. Unlike standard embeddings, these recognize sequential relationships within documents, improving retrieval quality. Models: pplx-embed-context-v1-0.6b (1024 dims) and pplx-embed-context-v1-4b (2560 dims). Both support Matryoshka dimension reduction and INT8/binary quantization.\",\n input: PerplexityaiCreateContextualizedEmbeddingsInput,\n output: PerplexityaiCreateContextualizedEmbeddingsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,kDAAgEA,IAAAA,EAAE,OAAO;CACpF,OAAOA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,+NAA+N;CAC5Q,OAAOA,IAAAA,EAAE,KAAK,CAAC,8BAA8B,0BAA0B,CAAC,CAAC,CAAC,SAAS,wJAAwJ;CAC3O,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,kHAAkH,CAAC,CAAC,SAAS;CACnK,iBAAiBA,IAAAA,EAAE,KAAK,CAAC,eAAe,eAAe,CAAC,CAAC,CAAC,QAAQ,aAAa,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS;AAC/I,CAAC,CAAC,CAAC,SAAS,yLAAyL;AACrM,MAAM,mEAAiFA,IAAAA,EAAE,OAAO;CAC9F,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,yCAAyC;CAC1E,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iCAAiC;CAC7D,WAAWA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iCAAiC;AAClE,CAAC,CAAC,CAAC,SAAS,4BAA4B;AACxC,MAAM,sEAAoFA,IAAAA,EAAE,OAAO;CACjG,MAAMA,IAAAA,EAAE,MAAM,gEAAgE,CAAC,CAAC,SAAS,2BAA2B;CACpH,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,2CAA2C;CAC5E,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;AAC1D,CAAC,CAAC,CAAC,SAAS,iDAAiD;AAC7D,MAAM,6DAA2EA,IAAAA,EAAE,OAAO;CACxF,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,wBAAwB;CAChE,eAAeA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,+BAA+B;AAC1E,CAAC,CAAC,CAAC,SAAS,0BAA0B;AACtC,MAAa,mDAAiEA,IAAAA,EAAE,OAAO;CACrF,MAAMA,IAAAA,EAAE,MAAM,mEAAmE,CAAC,CAAC,SAAS,gCAAgC;CAC5H,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;CAC9D,OAAO,2DAA2D,SAAS;CAC3E,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;AAC1D,CAAC,CAAC,CAAC,SAAS,+CAA+C;AAE3D,MAAa,6CAA6CC,eAAAA,OAAO,iDAAiD;CAChH,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/create-contextualized-embeddings.d.ts
4
+ declare const PerplexityaiCreateContextualizedEmbeddingsInput: z.ZodTypeAny;
5
+ declare const PerplexityaiCreateContextualizedEmbeddingsOutput: z.ZodTypeAny;
6
+ declare const perplexityaiCreateContextualizedEmbeddings: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiCreateContextualizedEmbeddings };
9
+ //# sourceMappingURL=create-contextualized-embeddings.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contextualized-embeddings.d.cts","names":[],"sources":["../../src/actions/create-contextualized-embeddings.ts"],"mappings":";;;cAIa,+CAAA,EAAiD,CAAA,CAAE,UAKsI;AAAA,cAezL,gDAAA,EAAkD,CAAA,CAAE,UAKL;AAAA,cAE/C,0CAAA,gCAA0C,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/create-contextualized-embeddings.d.ts
4
+ declare const PerplexityaiCreateContextualizedEmbeddingsInput: z.ZodTypeAny;
5
+ declare const PerplexityaiCreateContextualizedEmbeddingsOutput: z.ZodTypeAny;
6
+ declare const perplexityaiCreateContextualizedEmbeddings: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiCreateContextualizedEmbeddings };
9
+ //# sourceMappingURL=create-contextualized-embeddings.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contextualized-embeddings.d.mts","names":[],"sources":["../../src/actions/create-contextualized-embeddings.ts"],"mappings":";;;cAIa,+CAAA,EAAiD,CAAA,CAAE,UAKsI;AAAA,cAezL,gDAAA,EAAkD,CAAA,CAAE,UAKL;AAAA,cAE/C,0CAAA,gCAA0C,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
@@ -0,0 +1,39 @@
1
+ import { action } from "../action.mjs";
2
+ import { z } from "zod";
3
+ //#region src/actions/create-contextualized-embeddings.ts
4
+ const PerplexityaiCreateContextualizedEmbeddingsInput = z.object({
5
+ input: z.array(z.array(z.string())).describe("Nested array of texts: outer array = documents, inner array = ordered chunks from that document. Max 512 documents, max 16000 total chunks, max 32K tokens per document, max 120K combined tokens. Empty strings not allowed."),
6
+ model: z.enum(["pplx-embed-context-v1-0.6b", "pplx-embed-context-v1-4b"]).describe("The contextualized embedding model. pplx-embed-context-v1-0.6b (1024 dims, $0.008/1M tokens) or pplx-embed-context-v1-4b (2560 dims, $0.05/1M tokens)."),
7
+ dimensions: z.number().int().describe("Custom output dimensions via Matryoshka. Range: 128-1024 for 0.6b, 128-2560 for 4b. Defaults to full dimensions.").optional(),
8
+ encoding_format: z.enum(["base64_int8", "base64_binary"]).default("base64_int8").describe("Encoding format for embeddings output.").optional()
9
+ }).describe("Request model for creating contextualized embeddings.\nGenerates document-aware embeddings for text chunks that share a source document.\nChunks within each document must be in order.");
10
+ const PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema = z.object({
11
+ index: z.number().int().describe("Index of this chunk within its document"),
12
+ object: z.string().describe("Object type, always 'embedding'"),
13
+ embedding: z.string().describe("Base64-encoded embedding vector")
14
+ }).describe("A single embedding result.");
15
+ const PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema = z.object({
16
+ data: z.array(PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema).describe("Embeddings for each chunk"),
17
+ index: z.number().int().describe("Index of this document in the input array"),
18
+ object: z.string().describe("Object type, always 'list'")
19
+ }).describe("Embeddings for all chunks of a single document.");
20
+ const PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema = z.object({
21
+ total_tokens: z.number().int().describe("Total tokens processed"),
22
+ prompt_tokens: z.number().int().describe("Number of tokens in the input")
23
+ }).describe("Token usage information.");
24
+ const perplexityaiCreateContextualizedEmbeddings = action("PERPLEXITYAI_CREATE_CONTEXTUALIZED_EMBEDDINGS", {
25
+ slug: "perplexityai-create-contextualized-embeddings",
26
+ name: "Create Contextualized Embeddings",
27
+ description: "Create Contextualized Embeddings (POST /v1/contextualizedembeddings). Generates document-aware embeddings where chunks from the same document share context. Unlike standard embeddings, these recognize sequential relationships within documents, improving retrieval quality. Models: pplx-embed-context-v1-0.6b (1024 dims) and pplx-embed-context-v1-4b (2560 dims). Both support Matryoshka dimension reduction and INT8/binary quantization.",
28
+ input: PerplexityaiCreateContextualizedEmbeddingsInput,
29
+ output: z.object({
30
+ data: z.array(PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema).describe("Embeddings grouped by document"),
31
+ model: z.string().describe("Model used to generate embeddings"),
32
+ usage: PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema.nullable(),
33
+ object: z.string().describe("Object type, always 'list'")
34
+ }).describe("Response model for contextualized embeddings.")
35
+ });
36
+ //#endregion
37
+ export { perplexityaiCreateContextualizedEmbeddings };
38
+
39
+ //# sourceMappingURL=create-contextualized-embeddings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contextualized-embeddings.mjs","names":[],"sources":["../../src/actions/create-contextualized-embeddings.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PerplexityaiCreateContextualizedEmbeddingsInput: z.ZodTypeAny = z.object({\n input: z.array(z.array(z.string())).describe(\"Nested array of texts: outer array = documents, inner array = ordered chunks from that document. Max 512 documents, max 16000 total chunks, max 32K tokens per document, max 120K combined tokens. Empty strings not allowed.\"),\n model: z.enum([\"pplx-embed-context-v1-0.6b\", \"pplx-embed-context-v1-4b\"]).describe(\"The contextualized embedding model. pplx-embed-context-v1-0.6b (1024 dims, $0.008/1M tokens) or pplx-embed-context-v1-4b (2560 dims, $0.05/1M tokens).\"),\n dimensions: z.number().int().describe(\"Custom output dimensions via Matryoshka. Range: 128-1024 for 0.6b, 128-2560 for 4b. Defaults to full dimensions.\").optional(),\n encoding_format: z.enum([\"base64_int8\", \"base64_binary\"]).default(\"base64_int8\").describe(\"Encoding format for embeddings output.\").optional(),\n}).describe(\"Request model for creating contextualized embeddings.\\nGenerates document-aware embeddings for text chunks that share a source document.\\nChunks within each document must be in order.\");\nconst PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema: z.ZodTypeAny = z.object({\n index: z.number().int().describe(\"Index of this chunk within its document\"),\n object: z.string().describe(\"Object type, always 'embedding'\"),\n embedding: z.string().describe(\"Base64-encoded embedding vector\"),\n}).describe(\"A single embedding result.\");\nconst PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateContextualizedEmbeddings_EmbeddingObjectSchema).describe(\"Embeddings for each chunk\"),\n index: z.number().int().describe(\"Index of this document in the input array\"),\n object: z.string().describe(\"Object type, always 'list'\"),\n}).describe(\"Embeddings for all chunks of a single document.\");\nconst PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema: z.ZodTypeAny = z.object({\n total_tokens: z.number().int().describe(\"Total tokens processed\"),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the input\"),\n}).describe(\"Token usage information.\");\nexport const PerplexityaiCreateContextualizedEmbeddingsOutput: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateContextualizedEmbeddings_DocumentEmbeddingsSchema).describe(\"Embeddings grouped by document\"),\n model: z.string().describe(\"Model used to generate embeddings\"),\n usage: PerplexityaiCreateContextualizedEmbeddings_UsageInfoSchema.nullable(),\n object: z.string().describe(\"Object type, always 'list'\"),\n}).describe(\"Response model for contextualized embeddings.\");\n\nexport const perplexityaiCreateContextualizedEmbeddings = action(\"PERPLEXITYAI_CREATE_CONTEXTUALIZED_EMBEDDINGS\", {\n slug: \"perplexityai-create-contextualized-embeddings\",\n name: \"Create Contextualized Embeddings\",\n description: \"Create Contextualized Embeddings (POST /v1/contextualizedembeddings). Generates document-aware embeddings where chunks from the same document share context. Unlike standard embeddings, these recognize sequential relationships within documents, improving retrieval quality. Models: pplx-embed-context-v1-0.6b (1024 dims) and pplx-embed-context-v1-4b (2560 dims). Both support Matryoshka dimension reduction and INT8/binary quantization.\",\n input: PerplexityaiCreateContextualizedEmbeddingsInput,\n output: PerplexityaiCreateContextualizedEmbeddingsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,kDAAgE,EAAE,OAAO;CACpF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CA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5H,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;EAC9D,OAAO,2DAA2D,SAAS;EAC3E,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;CAC1D,CAAC,CAAC,CAAC,SAAS,+CAOF;AACV,CAAC"}
@@ -0,0 +1,41 @@
1
+ const require_action = require("../action.cjs");
2
+ let zod = require("zod");
3
+ //#region src/actions/create-embeddings.ts
4
+ const PerplexityaiCreateEmbeddingsInput = zod.z.object({
5
+ input: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]),
6
+ model: zod.z.enum(["pplx-embed-v1-0.6b", "pplx-embed-v1-4b"]).describe("The embedding model to use. pplx-embed-v1-0.6b is smaller and faster, while pplx-embed-v1-4b is larger and more accurate."),
7
+ dimensions: zod.z.number().int().describe("Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).").optional(),
8
+ encoding_format: zod.z.enum(["base64_int8", "base64_binary"]).default("base64_int8").describe("Encoding format for embeddings output.").optional()
9
+ }).describe("Request model for creating embeddings.\nGenerates vector embeddings for independent texts (queries, sentences, documents).");
10
+ const PerplexityaiCreateEmbeddings_EmbeddingObjectSchema = zod.z.object({
11
+ index: zod.z.number().int().describe("Index of this embedding in the request input array"),
12
+ object: zod.z.string().describe("The object type, always 'embedding'"),
13
+ embedding: zod.z.string().describe("The embedding vector as a base64-encoded string")
14
+ }).describe("A single embedding result.");
15
+ const PerplexityaiCreateEmbeddings_CostInfoSchema = zod.z.object({
16
+ currency: zod.z.string().describe("Currency code (e.g., 'USD')"),
17
+ input_cost: zod.z.number().describe("Cost for input tokens"),
18
+ total_cost: zod.z.number().describe("Total cost for the request")
19
+ }).describe("Cost breakdown for the embeddings request.");
20
+ const PerplexityaiCreateEmbeddings_UsageInfoSchema = zod.z.object({
21
+ cost: PerplexityaiCreateEmbeddings_CostInfoSchema.nullable().optional(),
22
+ total_tokens: zod.z.number().int().describe("Total number of tokens processed"),
23
+ prompt_tokens: zod.z.number().int().describe("Number of tokens in the input texts")
24
+ }).describe("Token usage information for the embeddings request.");
25
+ const PerplexityaiCreateEmbeddingsOutput = zod.z.object({
26
+ data: zod.z.array(PerplexityaiCreateEmbeddings_EmbeddingObjectSchema).describe("List of embedding objects"),
27
+ model: zod.z.string().describe("The model used to generate embeddings"),
28
+ usage: PerplexityaiCreateEmbeddings_UsageInfoSchema.nullable(),
29
+ object: zod.z.string().describe("The object type, always 'list'")
30
+ }).describe("Response model for embeddings creation.\nContains the generated embeddings and usage information.");
31
+ const perplexityaiCreateEmbeddings = require_action.action("PERPLEXITYAI_CREATE_EMBEDDINGS", {
32
+ slug: "perplexityai-create-embeddings",
33
+ name: "CreateEmbeddings",
34
+ description: "Generate vector embeddings for independent texts (queries, sentences, documents). This action takes one or more input texts and generates vector embeddings using Perplexity AI's embedding models. Embeddings are useful for semantic search, similarity matching, and machine learning downstream tasks. Supported models: - pplx-embed-v1-0.6b: Smaller, faster model (1024 dimensions) - pplx-embed-v1-4b: Larger, more accurate model (2560 dimensions) The output embeddings are base64-encoded for efficient transmission. Use the dimensions parameter to reduce embedding size for faster processing when full precision is not required (Matryoshka representation).",
35
+ input: PerplexityaiCreateEmbeddingsInput,
36
+ output: PerplexityaiCreateEmbeddingsOutput
37
+ });
38
+ //#endregion
39
+ exports.perplexityaiCreateEmbeddings = perplexityaiCreateEmbeddings;
40
+
41
+ //# sourceMappingURL=create-embeddings.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-embeddings.cjs","names":["z","action"],"sources":["../../src/actions/create-embeddings.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PerplexityaiCreateEmbeddingsInput: z.ZodTypeAny = z.object({\n input: z.union([z.string(), z.array(z.string())]),\n model: z.enum([\"pplx-embed-v1-0.6b\", \"pplx-embed-v1-4b\"]).describe(\"The embedding model to use. pplx-embed-v1-0.6b is smaller and faster, while pplx-embed-v1-4b is larger and more accurate.\"),\n dimensions: z.number().int().describe(\"Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).\").optional(),\n encoding_format: z.enum([\"base64_int8\", \"base64_binary\"]).default(\"base64_int8\").describe(\"Encoding format for embeddings output.\").optional(),\n}).describe(\"Request model for creating embeddings.\\nGenerates vector embeddings for independent texts (queries, sentences, documents).\");\nconst PerplexityaiCreateEmbeddings_EmbeddingObjectSchema: z.ZodTypeAny = z.object({\n index: z.number().int().describe(\"Index of this embedding in the request input array\"),\n object: z.string().describe(\"The object type, always 'embedding'\"),\n embedding: z.string().describe(\"The embedding vector as a base64-encoded string\"),\n}).describe(\"A single embedding result.\");\nconst PerplexityaiCreateEmbeddings_CostInfoSchema: z.ZodTypeAny = z.object({\n currency: z.string().describe(\"Currency code (e.g., 'USD')\"),\n input_cost: z.number().describe(\"Cost for input tokens\"),\n total_cost: z.number().describe(\"Total cost for the request\"),\n}).describe(\"Cost breakdown for the embeddings request.\");\nconst PerplexityaiCreateEmbeddings_UsageInfoSchema: z.ZodTypeAny = z.object({\n cost: PerplexityaiCreateEmbeddings_CostInfoSchema.nullable().optional(),\n total_tokens: z.number().int().describe(\"Total number of tokens processed\"),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the input texts\"),\n}).describe(\"Token usage information for the embeddings request.\");\nexport const PerplexityaiCreateEmbeddingsOutput: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateEmbeddings_EmbeddingObjectSchema).describe(\"List of embedding objects\"),\n model: z.string().describe(\"The model used to generate embeddings\"),\n usage: PerplexityaiCreateEmbeddings_UsageInfoSchema.nullable(),\n object: z.string().describe(\"The object type, always 'list'\"),\n}).describe(\"Response model for embeddings creation.\\nContains the generated embeddings and usage information.\");\n\nexport const perplexityaiCreateEmbeddings = action(\"PERPLEXITYAI_CREATE_EMBEDDINGS\", {\n slug: \"perplexityai-create-embeddings\",\n name: \"CreateEmbeddings\",\n description: \"Generate vector embeddings for independent texts (queries, sentences, documents). This action takes one or more input texts and generates vector embeddings using Perplexity AI's embedding models. Embeddings are useful for semantic search, similarity matching, and machine learning downstream tasks. Supported models: - pplx-embed-v1-0.6b: Smaller, faster model (1024 dimensions) - pplx-embed-v1-4b: Larger, more accurate model (2560 dimensions) The output embeddings are base64-encoded for efficient transmission. Use the dimensions parameter to reduce embedding size for faster processing when full precision is not required (Matryoshka representation).\",\n input: PerplexityaiCreateEmbeddingsInput,\n output: PerplexityaiCreateEmbeddingsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,oCAAkDA,IAAAA,EAAE,OAAO;CACtE,OAAOA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC;CAChD,OAAOA,IAAAA,EAAE,KAAK,CAAC,sBAAsB,kBAAkB,CAAC,CAAC,CAAC,SAAS,2HAA2H;CAC9L,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,6KAA6K,CAAC,CAAC,SAAS;CAC9N,iBAAiBA,IAAAA,EAAE,KAAK,CAAC,eAAe,eAAe,CAAC,CAAC,CAAC,QAAQ,aAAa,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS;AAC/I,CAAC,CAAC,CAAC,SAAS,4HAA4H;AACxI,MAAM,qDAAmEA,IAAAA,EAAE,OAAO;CAChF,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,oDAAoD;CACrF,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qCAAqC;CACjE,WAAWA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iDAAiD;AAClF,CAAC,CAAC,CAAC,SAAS,4BAA4B;AACxC,MAAM,8CAA4DA,IAAAA,EAAE,OAAO;CACzE,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B;CAC3D,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACvD,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B;AAC9D,CAAC,CAAC,CAAC,SAAS,4CAA4C;AACxD,MAAM,+CAA6DA,IAAAA,EAAE,OAAO;CAC1E,MAAM,4CAA4C,SAAS,CAAC,CAAC,SAAS;CACtE,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,kCAAkC;CAC1E,eAAeA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,qCAAqC;AAChF,CAAC,CAAC,CAAC,SAAS,qDAAqD;AACjE,MAAa,qCAAmDA,IAAAA,EAAE,OAAO;CACvE,MAAMA,IAAAA,EAAE,MAAM,kDAAkD,CAAC,CAAC,SAAS,2BAA2B;CACtG,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uCAAuC;CAClE,OAAO,6CAA6C,SAAS;CAC7D,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gCAAgC;AAC9D,CAAC,CAAC,CAAC,SAAS,mGAAmG;AAE/G,MAAa,+BAA+BC,eAAAA,OAAO,kCAAkC;CACnF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/create-embeddings.d.ts
4
+ declare const PerplexityaiCreateEmbeddingsInput: z.ZodTypeAny;
5
+ declare const PerplexityaiCreateEmbeddingsOutput: z.ZodTypeAny;
6
+ declare const perplexityaiCreateEmbeddings: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiCreateEmbeddings };
9
+ //# sourceMappingURL=create-embeddings.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-embeddings.d.cts","names":[],"sources":["../../src/actions/create-embeddings.ts"],"mappings":";;;cAIa,iCAAA,EAAmC,CAAA,CAAE,UAKuF;AAAA,cAgB5H,kCAAA,EAAoC,CAAA,CAAE,UAK6D;AAAA,cAEnG,4BAAA,gCAA4B,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/create-embeddings.d.ts
4
+ declare const PerplexityaiCreateEmbeddingsInput: z.ZodTypeAny;
5
+ declare const PerplexityaiCreateEmbeddingsOutput: z.ZodTypeAny;
6
+ declare const perplexityaiCreateEmbeddings: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiCreateEmbeddings };
9
+ //# sourceMappingURL=create-embeddings.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-embeddings.d.mts","names":[],"sources":["../../src/actions/create-embeddings.ts"],"mappings":";;;cAIa,iCAAA,EAAmC,CAAA,CAAE,UAKuF;AAAA,cAgB5H,kCAAA,EAAoC,CAAA,CAAE,UAK6D;AAAA,cAEnG,4BAAA,gCAA4B,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
@@ -0,0 +1,40 @@
1
+ import { action } from "../action.mjs";
2
+ import { z } from "zod";
3
+ //#region src/actions/create-embeddings.ts
4
+ const PerplexityaiCreateEmbeddingsInput = z.object({
5
+ input: z.union([z.string(), z.array(z.string())]),
6
+ model: z.enum(["pplx-embed-v1-0.6b", "pplx-embed-v1-4b"]).describe("The embedding model to use. pplx-embed-v1-0.6b is smaller and faster, while pplx-embed-v1-4b is larger and more accurate."),
7
+ dimensions: z.number().int().describe("Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).").optional(),
8
+ encoding_format: z.enum(["base64_int8", "base64_binary"]).default("base64_int8").describe("Encoding format for embeddings output.").optional()
9
+ }).describe("Request model for creating embeddings.\nGenerates vector embeddings for independent texts (queries, sentences, documents).");
10
+ const PerplexityaiCreateEmbeddings_EmbeddingObjectSchema = z.object({
11
+ index: z.number().int().describe("Index of this embedding in the request input array"),
12
+ object: z.string().describe("The object type, always 'embedding'"),
13
+ embedding: z.string().describe("The embedding vector as a base64-encoded string")
14
+ }).describe("A single embedding result.");
15
+ const PerplexityaiCreateEmbeddings_CostInfoSchema = z.object({
16
+ currency: z.string().describe("Currency code (e.g., 'USD')"),
17
+ input_cost: z.number().describe("Cost for input tokens"),
18
+ total_cost: z.number().describe("Total cost for the request")
19
+ }).describe("Cost breakdown for the embeddings request.");
20
+ const PerplexityaiCreateEmbeddings_UsageInfoSchema = z.object({
21
+ cost: PerplexityaiCreateEmbeddings_CostInfoSchema.nullable().optional(),
22
+ total_tokens: z.number().int().describe("Total number of tokens processed"),
23
+ prompt_tokens: z.number().int().describe("Number of tokens in the input texts")
24
+ }).describe("Token usage information for the embeddings request.");
25
+ const perplexityaiCreateEmbeddings = action("PERPLEXITYAI_CREATE_EMBEDDINGS", {
26
+ slug: "perplexityai-create-embeddings",
27
+ name: "CreateEmbeddings",
28
+ description: "Generate vector embeddings for independent texts (queries, sentences, documents). This action takes one or more input texts and generates vector embeddings using Perplexity AI's embedding models. Embeddings are useful for semantic search, similarity matching, and machine learning downstream tasks. Supported models: - pplx-embed-v1-0.6b: Smaller, faster model (1024 dimensions) - pplx-embed-v1-4b: Larger, more accurate model (2560 dimensions) The output embeddings are base64-encoded for efficient transmission. Use the dimensions parameter to reduce embedding size for faster processing when full precision is not required (Matryoshka representation).",
29
+ input: PerplexityaiCreateEmbeddingsInput,
30
+ output: z.object({
31
+ data: z.array(PerplexityaiCreateEmbeddings_EmbeddingObjectSchema).describe("List of embedding objects"),
32
+ model: z.string().describe("The model used to generate embeddings"),
33
+ usage: PerplexityaiCreateEmbeddings_UsageInfoSchema.nullable(),
34
+ object: z.string().describe("The object type, always 'list'")
35
+ }).describe("Response model for embeddings creation.\nContains the generated embeddings and usage information.")
36
+ });
37
+ //#endregion
38
+ export { perplexityaiCreateEmbeddings };
39
+
40
+ //# sourceMappingURL=create-embeddings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-embeddings.mjs","names":[],"sources":["../../src/actions/create-embeddings.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PerplexityaiCreateEmbeddingsInput: z.ZodTypeAny = z.object({\n input: z.union([z.string(), z.array(z.string())]),\n model: z.enum([\"pplx-embed-v1-0.6b\", \"pplx-embed-v1-4b\"]).describe(\"The embedding model to use. pplx-embed-v1-0.6b is smaller and faster, while pplx-embed-v1-4b is larger and more accurate.\"),\n dimensions: z.number().int().describe(\"Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).\").optional(),\n encoding_format: z.enum([\"base64_int8\", \"base64_binary\"]).default(\"base64_int8\").describe(\"Encoding format for embeddings output.\").optional(),\n}).describe(\"Request model for creating embeddings.\\nGenerates vector embeddings for independent texts (queries, sentences, documents).\");\nconst PerplexityaiCreateEmbeddings_EmbeddingObjectSchema: z.ZodTypeAny = z.object({\n index: z.number().int().describe(\"Index of this embedding in the request input array\"),\n object: z.string().describe(\"The object type, always 'embedding'\"),\n embedding: z.string().describe(\"The embedding vector as a base64-encoded string\"),\n}).describe(\"A single embedding result.\");\nconst PerplexityaiCreateEmbeddings_CostInfoSchema: z.ZodTypeAny = z.object({\n currency: z.string().describe(\"Currency code (e.g., 'USD')\"),\n input_cost: z.number().describe(\"Cost for input tokens\"),\n total_cost: z.number().describe(\"Total cost for the request\"),\n}).describe(\"Cost breakdown for the embeddings request.\");\nconst PerplexityaiCreateEmbeddings_UsageInfoSchema: z.ZodTypeAny = z.object({\n cost: PerplexityaiCreateEmbeddings_CostInfoSchema.nullable().optional(),\n total_tokens: z.number().int().describe(\"Total number of tokens processed\"),\n prompt_tokens: z.number().int().describe(\"Number of tokens in the input texts\"),\n}).describe(\"Token usage information for the embeddings request.\");\nexport const PerplexityaiCreateEmbeddingsOutput: z.ZodTypeAny = z.object({\n data: z.array(PerplexityaiCreateEmbeddings_EmbeddingObjectSchema).describe(\"List of embedding objects\"),\n model: z.string().describe(\"The model used to generate embeddings\"),\n usage: PerplexityaiCreateEmbeddings_UsageInfoSchema.nullable(),\n object: z.string().describe(\"The object type, always 'list'\"),\n}).describe(\"Response model for embeddings creation.\\nContains the generated embeddings and usage information.\");\n\nexport const perplexityaiCreateEmbeddings = action(\"PERPLEXITYAI_CREATE_EMBEDDINGS\", {\n slug: \"perplexityai-create-embeddings\",\n name: \"CreateEmbeddings\",\n description: \"Generate vector embeddings for independent texts (queries, sentences, documents). This action takes one or more input texts and generates vector embeddings using Perplexity AI's embedding models. Embeddings are useful for semantic search, similarity matching, and machine learning downstream tasks. Supported models: - pplx-embed-v1-0.6b: Smaller, faster model (1024 dimensions) - pplx-embed-v1-4b: Larger, more accurate model (2560 dimensions) The output embeddings are base64-encoded for efficient transmission. Use the dimensions parameter to reduce embedding size for faster processing when full precision is not required (Matryoshka representation).\",\n input: PerplexityaiCreateEmbeddingsInput,\n output: PerplexityaiCreateEmbeddingsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,oCAAkD,EAAE,OAAO;CACtE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAChD,OAAO,EAAE,KAAK,CAAC,sBAAsB,kBAAkB,CAAC,CAAC,CAAC,SAAS,2HAA2H;CAC9L,YAAY,EAAE,OAA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S,gCAAgC;CAC9D,CAAC,CAAC,CAAC,SAAS,mGAOF;AACV,CAAC"}
@@ -0,0 +1,71 @@
1
+ const require_action = require("../action.cjs");
2
+ let zod = require("zod");
3
+ //#region src/actions/execute-agent.ts
4
+ const PerplexityaiExecuteAgentInput = zod.z.object({
5
+ input: zod.z.string().describe("The user's input/query to process."),
6
+ model: zod.z.string().describe("Model identifier (e.g. 'openai/gpt-5.2', 'perplexity/sonar'). Provider/model format. At least one of model, models, or preset is required.").optional(),
7
+ tools: zod.z.array(zod.z.union([
8
+ zod.z.object({
9
+ type: zod.z.string().default("web_search").describe("Must be 'web_search'").optional(),
10
+ filters: zod.z.object({
11
+ search_domain_filter: zod.z.array(zod.z.string()).nullable().optional(),
12
+ search_recency_filter: zod.z.string().nullable().optional(),
13
+ search_after_date_filter: zod.z.string().nullable().optional(),
14
+ last_updated_after_filter: zod.z.string().nullable().optional(),
15
+ search_before_date_filter: zod.z.string().nullable().optional(),
16
+ last_updated_before_filter: zod.z.string().nullable().optional()
17
+ }).describe("Filters for the web search tool.").nullable().optional(),
18
+ max_tokens: zod.z.number().int().nullable().optional(),
19
+ max_tokens_per_page: zod.z.number().int().nullable().optional()
20
+ }).describe("Web search tool configuration."),
21
+ zod.z.object({
22
+ type: zod.z.string().default("fetch_url").describe("Must be 'fetch_url'").optional(),
23
+ max_urls: zod.z.number().int().nullable().optional()
24
+ }).describe("URL fetching tool configuration."),
25
+ zod.z.object({
26
+ name: zod.z.string().describe("Name of the function"),
27
+ type: zod.z.string().default("function").describe("Must be 'function'").optional(),
28
+ strict: zod.z.boolean().nullable().optional(),
29
+ parameters: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().optional(),
30
+ description: zod.z.string().nullable().optional()
31
+ }).describe("Function calling tool configuration.")
32
+ ])).describe("Tools available to the agent: web_search, fetch_url, function.").optional(),
33
+ models: zod.z.array(zod.z.string()).describe("Fallback chain of models (min 1, max 5). API tries each in order if prior fails. At least one of model, models, or preset is required.").optional(),
34
+ preset: zod.z.string().describe("Preset configuration: 'fast-search', 'pro-search', 'deep-research'. 'deep-research' generates very long responses (10K-100K+ words). At least one of model, models, or preset is required.").optional(),
35
+ max_steps: zod.z.number().int().describe("Maximum number of agent steps (1-10).").optional(),
36
+ reasoning: zod.z.object({ effort: zod.z.string().describe("Reasoning effort: 'low', 'medium', 'high'") }).describe("Configuration for reasoning behavior.").optional(),
37
+ instructions: zod.z.string().describe("System instructions to guide the agent's behavior.").optional(),
38
+ response_format: zod.z.object({
39
+ type: zod.z.string().describe("Must be 'json_schema'"),
40
+ json_schema: zod.z.object({
41
+ name: zod.z.string().describe("Schema name (1-64 alphanumeric)"),
42
+ schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe("JSON schema definition"),
43
+ strict: zod.z.boolean().describe("Enforce strict validation").optional(),
44
+ description: zod.z.string().describe("Schema description").optional()
45
+ }).describe("JSON schema for structured output.").optional()
46
+ }).describe("Response format for structured output.").optional(),
47
+ max_output_tokens: zod.z.number().int().describe("Maximum output tokens.").optional(),
48
+ language_preference: zod.z.string().describe("Preferred response language as ISO 639-1 code.").optional()
49
+ }).describe("Request model for the Agent API.");
50
+ const PerplexityaiExecuteAgentOutput = zod.z.object({
51
+ id: zod.z.string().describe("Unique identifier for the response"),
52
+ error: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Error info if status is 'failed'").nullable().optional(),
53
+ model: zod.z.string().describe("Model used"),
54
+ usage: zod.z.record(zod.z.string(), zod.z.unknown()).describe("Token usage and cost information").nullable().optional(),
55
+ object: zod.z.string().describe("Object type, typically 'response'").nullable().optional(),
56
+ output: zod.z.array(zod.z.record(zod.z.string(), zod.z.unknown())).describe("Output items (messages, search results, function calls)").nullable().optional(),
57
+ status: zod.z.string().describe("Status: 'completed', 'failed', 'in_progress', 'requires_action'"),
58
+ created_at: zod.z.number().int().describe("Unix timestamp of creation").nullable().optional(),
59
+ output_text: zod.z.string().describe("Extracted text output (convenience field)").nullable().optional()
60
+ }).describe("Response model for the Agent API.");
61
+ const perplexityaiExecuteAgent = require_action.action("PERPLEXITYAI_EXECUTE_AGENT", {
62
+ slug: "perplexityai-execute-agent",
63
+ name: "Execute Agent",
64
+ description: "Create Agent Response (POST /v1/agent). Orchestrates multi-step agentic workflows with built-in tools (web search, URL fetching, function calling), reasoning, and multi-model support. Streaming is not supported by this action. At least one of 'model', 'models', or 'preset' must be provided. Available presets: 'fast-search', 'pro-search', 'deep-research'. The 'deep-research' preset generates very long responses (10K-100K+ words) with exhaustive multi-source analysis. Available models include Perplexity Sonar, OpenAI, Anthropic, Google, xAI, and NVIDIA models at direct provider rates. Use the List Models action to see available model identifiers.",
65
+ input: PerplexityaiExecuteAgentInput,
66
+ output: PerplexityaiExecuteAgentOutput
67
+ });
68
+ //#endregion
69
+ exports.perplexityaiExecuteAgent = perplexityaiExecuteAgent;
70
+
71
+ //# sourceMappingURL=execute-agent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-agent.cjs","names":["z","action"],"sources":["../../src/actions/execute-agent.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PerplexityaiExecuteAgentInput: z.ZodTypeAny = z.object({\n input: z.string().describe(\"The user's input/query to process.\"),\n model: z.string().describe(\"Model identifier (e.g. 'openai/gpt-5.2', 'perplexity/sonar'). Provider/model format. At least one of model, models, or preset is required.\").optional(),\n tools: z.array(z.union([z.object({\n type: z.string().default(\"web_search\").describe(\"Must be 'web_search'\").optional(),\n filters: z.object({\n search_domain_filter: z.array(z.string()).nullable().optional(),\n search_recency_filter: z.string().nullable().optional(),\n search_after_date_filter: z.string().nullable().optional(),\n last_updated_after_filter: z.string().nullable().optional(),\n search_before_date_filter: z.string().nullable().optional(),\n last_updated_before_filter: z.string().nullable().optional(),\n}).describe(\"Filters for the web search tool.\").nullable().optional(),\n max_tokens: z.number().int().nullable().optional(),\n max_tokens_per_page: z.number().int().nullable().optional(),\n}).describe(\"Web search tool configuration.\"), z.object({\n type: z.string().default(\"fetch_url\").describe(\"Must be 'fetch_url'\").optional(),\n max_urls: z.number().int().nullable().optional(),\n}).describe(\"URL fetching tool configuration.\"), z.object({\n name: z.string().describe(\"Name of the function\"),\n type: z.string().default(\"function\").describe(\"Must be 'function'\").optional(),\n strict: z.boolean().nullable().optional(),\n parameters: z.record(z.string(), z.unknown()).nullable().optional(),\n description: z.string().nullable().optional(),\n}).describe(\"Function calling tool configuration.\")])).describe(\"Tools available to the agent: web_search, fetch_url, function.\").optional(),\n models: z.array(z.string()).describe(\"Fallback chain of models (min 1, max 5). API tries each in order if prior fails. At least one of model, models, or preset is required.\").optional(),\n preset: z.string().describe(\"Preset configuration: 'fast-search', 'pro-search', 'deep-research'. 'deep-research' generates very long responses (10K-100K+ words). At least one of model, models, or preset is required.\").optional(),\n max_steps: z.number().int().describe(\"Maximum number of agent steps (1-10).\").optional(),\n reasoning: z.object({\n effort: z.string().describe(\"Reasoning effort: 'low', 'medium', 'high'\"),\n}).describe(\"Configuration for reasoning behavior.\").optional(),\n instructions: z.string().describe(\"System instructions to guide the agent's behavior.\").optional(),\n response_format: z.object({\n type: z.string().describe(\"Must be 'json_schema'\"),\n json_schema: z.object({\n name: z.string().describe(\"Schema name (1-64 alphanumeric)\"),\n schema: z.record(z.string(), z.unknown()).describe(\"JSON schema definition\"),\n strict: z.boolean().describe(\"Enforce strict validation\").optional(),\n description: z.string().describe(\"Schema description\").optional(),\n}).describe(\"JSON schema for structured output.\").optional(),\n}).describe(\"Response format for structured output.\").optional(),\n max_output_tokens: z.number().int().describe(\"Maximum output tokens.\").optional(),\n language_preference: z.string().describe(\"Preferred response language as ISO 639-1 code.\").optional(),\n}).describe(\"Request model for the Agent API.\");\nexport const PerplexityaiExecuteAgentOutput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique identifier for the response\"),\n error: z.record(z.string(), z.unknown()).describe(\"Error info if status is 'failed'\").nullable().optional(),\n model: z.string().describe(\"Model used\"),\n usage: z.record(z.string(), z.unknown()).describe(\"Token usage and cost information\").nullable().optional(),\n object: z.string().describe(\"Object type, typically 'response'\").nullable().optional(),\n output: z.array(z.record(z.string(), z.unknown())).describe(\"Output items (messages, search results, function calls)\").nullable().optional(),\n status: z.string().describe(\"Status: 'completed', 'failed', 'in_progress', 'requires_action'\"),\n created_at: z.number().int().describe(\"Unix timestamp of creation\").nullable().optional(),\n output_text: z.string().describe(\"Extracted text output (convenience field)\").nullable().optional(),\n}).describe(\"Response model for the Agent API.\");\n\nexport const perplexityaiExecuteAgent = action(\"PERPLEXITYAI_EXECUTE_AGENT\", {\n slug: \"perplexityai-execute-agent\",\n name: \"Execute Agent\",\n description: \"Create Agent Response (POST /v1/agent). Orchestrates multi-step agentic workflows with built-in tools (web search, URL fetching, function calling), reasoning, and multi-model support. Streaming is not supported by this action. At least one of 'model', 'models', or 'preset' must be provided. Available presets: 'fast-search', 'pro-search', 'deep-research'. The 'deep-research' preset generates very long responses (10K-100K+ words) with exhaustive multi-source analysis. Available models include Perplexity Sonar, OpenAI, Anthropic, Google, xAI, and NVIDIA models at direct provider rates. Use the List Models action to see available model identifiers.\",\n input: PerplexityaiExecuteAgentInput,\n output: PerplexityaiExecuteAgentOutput,\n});\n"],"mappings":";;;AAIA,MAAa,gCAA8CA,IAAAA,EAAE,OAAO;CAClE,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC;CAC/D,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4IAA4I,CAAC,CAAC,SAAS;CAClL,OAAOA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,MAAM;EAACA,IAAAA,EAAE,OAAO;GACjC,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,QAAQ,YAAY,CAAC,CAAC,SAAS,sBAAsB,CAAC,CAAC,SAAS;GACjF,SAASA,IAAAA,EAAE,OAAO;IAClB,sBAAsBA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SA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AC,SAAS,2CAA2C,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACpG,CAAC,CAAC,CAAC,SAAS,mCAAmC;AAE/C,MAAa,2BAA2BC,eAAAA,OAAO,8BAA8B;CAC3E,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/execute-agent.d.ts
4
+ declare const PerplexityaiExecuteAgentInput: z.ZodTypeAny;
5
+ declare const PerplexityaiExecuteAgentOutput: z.ZodTypeAny;
6
+ declare const perplexityaiExecuteAgent: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiExecuteAgent };
9
+ //# sourceMappingURL=execute-agent.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-agent.d.cts","names":[],"sources":["../../src/actions/execute-agent.ts"],"mappings":";;;cAIa,6BAAA,EAA+B,CAAA,CAAE,UA2CC;AAAA,cAClC,8BAAA,EAAgC,CAAA,CAAE,UAUC;AAAA,cAEnC,wBAAA,gCAAwB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/actions/execute-agent.d.ts
4
+ declare const PerplexityaiExecuteAgentInput: z.ZodTypeAny;
5
+ declare const PerplexityaiExecuteAgentOutput: z.ZodTypeAny;
6
+ declare const perplexityaiExecuteAgent: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
7
+ //#endregion
8
+ export { perplexityaiExecuteAgent };
9
+ //# sourceMappingURL=execute-agent.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-agent.d.mts","names":[],"sources":["../../src/actions/execute-agent.ts"],"mappings":";;;cAIa,6BAAA,EAA+B,CAAA,CAAE,UA2CC;AAAA,cAClC,8BAAA,EAAgC,CAAA,CAAE,UAUC;AAAA,cAEnC,wBAAA,gCAAwB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}