Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions packages/asana/snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"CREATE": {
"Add Task to Section of Project": {
"description": "Adds a Task to a Section of a Project.",
"code": ""
},
"Create Comment/Story": {
"description": "Adds a comment or story to a task.",
"code": "// Add a comment / story to a task.\ncreateTaskStory(\n // 1) The task's globally unique id.\n $.data.taskGid,\n {\n // 2) The comment body (HTML supported when html_text is used).\n text: 'Status update: imported from the upstream system.',\n }\n);"
},
"Create Duplicate Task": {
"description": "Duplicates an existing task.",
"code": ""
},
"Create Project": {
"description": "Adds a new project.",
"code": ""
},
"Create Section": {
"description": "Creates a new section within a project.",
"code": ""
},
"Create Task": {
"description": "Creates a new task in Asana with specified details.",
"code": "// Create a new task.\ncreateTask({\n // The task's title.\n name: 'Follow up with patient',\n // Long-form description (optional).\n notes: `Imported from upstream system on ${new Date().toISOString()}`,\n // Workspace gid this task lives in.\n workspace: $.configuration.workspaceGid,\n // Optional: place the task into a project on creation.\n projects: [$.data.projectGid],\n // Optional: assign to a user gid.\n assignee: $.data.assigneeGid,\n // Optional ISO date string.\n due_on: '2026-06-01',\n});"
},
"Create Task From Template": {
"description": "Creates a new task in Asana from a selected template.",
"code": ""
},
"Update Task": {
"description": "Updates multiple properties of an existing Asana task.",
"code": "// Update properties on an existing task.\nupdateTask(\n // 1) Task gid.\n $.data.taskGid,\n // 2) Fields to change.\n {\n name: 'Updated task title',\n completed: true,\n notes: 'Closed after upstream sync.',\n }\n);"
},
"API Request (Beta)": {
"description": "Raw HTTP request with authentication.",
"code": "// Make an arbitrary request against the Asana API.\n// Path is relative to the Asana base URL.\nrequest('/workspaces', {\n method: 'GET',\n query: { limit: 10 },\n});"
}
},
"SEARCH": {
"Find All Tasks From Project": {
"description": "Searches for all tasks in a specific project with optional filters.",
"code": "// List tasks in a project.\ngetTasks(\n // 1) Project gid.\n $.data.projectGid,\n // 2) Query params.\n {\n // Fields to return per task.\n opt_fields: 'name,notes,assignee,completed,due_on',\n // Cap the result size.\n limit: 100,\n }\n);"
},
"Find Project": {
"description": "Finds an existing project.",
"code": ""
},
"Find Section in Project": {
"description": "Finds an existing section within a workspace project.",
"code": ""
},
"Find Task Comments": {
"description": "Finds comments for a specific task.",
"code": ""
},
"Find Tasks in Workspace": {
"description": "Searches for tasks in a workspace using Asana's search API (premium only).",
"code": "// Search tasks across a workspace using Asana's typeahead/search API.\n// Note: this endpoint requires a premium Asana plan.\nsearchTask(\n // 1) The search term (matches task name).\n $.data.searchTerm,\n // 2) Query params (assignee, completed, etc).\n {\n 'assignee.any': $.data.assigneeGid,\n completed: false,\n }\n);"
},
"Find User": {
"description": "Finds an existing user of your Asana account.",
"code": ""
}
}
}
18 changes: 18 additions & 0 deletions packages/bigquery/snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"CREATE": {
"Insert Row": {
"description": "Add a row to a BigQuery table.",
"code": "// Load file(s) into a BigQuery table.\n// The adaptor batches rows from disk; for one-off row inserts you typically\n// write the row(s) to a local file first and point `load` at it.\nload(\n // 1) Path to the local directory containing files to load.\n './tmp/files',\n // 2) GCP project id.\n $.configuration.projectId,\n // 3) Dataset id.\n 'my_dataset',\n // 4) Target table id.\n 'my_table',\n {\n // Column types (BQ schema string).\n schema: 'name:STRING,email:STRING,amount:NUMERIC',\n // Append rather than replace.\n writeDisposition: 'WRITE_APPEND',\n // Skip header row(s) if loading CSV.\n skipLeadingRows: 1,\n createDisposition: 'CREATE_IF_NEEDED',\n }\n);"
}
},
"SEARCH": {
"Find Row": {
"description": "Find a specific row in a BigQuery table.",
"code": ""
},
"Run a Query": {
"description": "Execute a SQL query against your BigQuery dataset.",
"code": ""
}
}
}
110 changes: 110 additions & 0 deletions packages/chatgpt/snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"CREATE": {
"Analyze Image Content With Vision (Legacy)": {
"description": "Upload an image and send a message or question about it. Powered by Chat Completions API.",
"code": "// Ask a question about an image via Chat Completions.\n// Override `messages` to attach an image part alongside the text.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: 'Describe what is happening in this image.' },\n { type: 'image_url', image_url: { url: $.data.imageUrl } },\n ],\n },\n ],\n});"
},
"Analyze Images": {
"description": "(Recommended) Upload an image(s) and send a message or question about it. Powered by Responses API.",
"code": "// Analyze an image via the Responses API.\n// Override `input` to attach an image alongside the text prompt.\ndeepResearch(null, {\n model: 'gpt-4o',\n // No web search needed for pure image analysis.\n tools: [],\n input: [\n {\n role: 'user',\n content: [\n { type: 'input_text', text: 'Describe what is happening in this image.' },\n { type: 'input_image', image_url: $.data.imageUrl },\n ],\n },\n ],\n});"
},
"Analyze Text": {
"description": "(Recommended) Summarize, classify, and analyze text. Powered by Responses API.",
"code": "// Analyze a block of text via the Responses API.\ndeepResearch(\n `Analyze the following text. Return the key themes, tone and any action items.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o',\n // No web search needed; disable the default tool.\n tools: [],\n }\n);"
},
"Analyze Text Sentiment (Legacy)": {
"description": "Generate an analysis of the overall sentiment of a block of text. Powered by Chat Completions API.",
"code": "// Return a sentiment label + score for a block of text.\nprompt(\n `Rate the sentiment of the text below. Reply as JSON:\\n{ \"label\": \"positive\" | \"neutral\" | \"negative\", \"score\": number between -1 and 1 }\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n // Force the model to emit valid JSON.\n response_format: { type: 'json_object' },\n }\n);"
},
"Check Moderations": {
"description": "Classifies if text is potentially harmful.",
"code": ""
},
"Classify Text (Legacy)": {
"description": "Classify your text into one of your provided categories. Powered by Chat Completions API.",
"code": "// Classify text into one of the supplied categories.\nconst categories = ['billing', 'support', 'sales', 'other'];\n\nprompt(\n `Pick the single best category for the message below. Reply with the\\ncategory string only, nothing else.\\n\\nCATEGORIES: ${categories.join(', ')}\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n }\n);"
},
"Conversation": {
"description": "(Recommended) Send a chat to OpenAI, optionally storing messages for continuous conversation. This enhanced action can also help with web search, file search, and advanced tooling such as MCP. Powered by Responses API.",
"code": "// Send a chat turn via the Responses API, with tools enabled.\n// Default tool is web_search_preview; override `tools` to use file_search, MCP, etc.\ndeepResearch(\n $.data.userMessage,\n {\n model: 'gpt-4o',\n tools: [{ type: 'web_search_preview' }],\n }\n);"
},
"Conversation (Legacy)": {
"description": "Sends a Chat to OpenAI and generates a Completion, optionally storing messages as we do. Powered by Chat Completions API.",
"code": "// Multi-turn chat via Chat Completions. Provide the full message history.\n// `prompt`'s first arg is ignored when `messages` is overridden.\nprompt(null, {\n model: 'gpt-4o-mini',\n messages: [\n { role: 'system', content: 'You are a concise assistant.' },\n ...($.state.history || []),\n { role: 'user', content: $.data.userMessage },\n ],\n temperature: 0.5,\n});"
},
"Convert Text to Speech": {
"description": "Converts a given text to speech.",
"code": ""
},
"Create Embedding": {
"description": "Generate vector embeddings for text input.",
"code": ""
},
"Create Image Edit": {
"description": "Creates a new image by editing an existing image with a prompt.",
"code": ""
},
"Create Transcription": {
"description": "Creates a new transcription, using Whisper, from an audio or video file.",
"code": ""
},
"Create Translation": {
"description": "Creates a new translation.",
"code": ""
},
"Create Video": {
"description": "Create a new video generation job using Sora. Returns a video job ID that can be used to check the render status.",
"code": ""
},
"Extract Structured Data": {
"description": "(Recommended) Improved structured data extraction with better formatting options and more reliable schema adherence. Powered by Responses API.",
"code": "// Extract structured fields via the Responses API, constrained to a JSON schema.\ndeepResearch(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o',\n tools: [],\n text: {\n format: {\n type: 'json_schema',\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);"
},
"Extract Structured Data (Legacy)": {
"description": "Sends unstructured text and returns structured data using OpenAI's \"Function Calling\" capability. Powered by Chat Completions API.",
"code": "// Extract structured fields from unstructured text via Chat Completions.\n// The model is constrained to a JSON schema; result lands on state.data.\nprompt(\n `Extract the contact details from the message below.\\n\\nMESSAGE:\\n${$.data.message}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0,\n response_format: {\n type: 'json_schema',\n json_schema: {\n name: 'contact',\n schema: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n email: { type: 'string' },\n phone: { type: 'string' },\n },\n required: ['name'],\n additionalProperties: false,\n },\n },\n },\n }\n);"
},
"Generate An Image": {
"description": "Generates an image using a relevant OpenAI model.",
"code": ""
},
"Send Prompt": {
"description": "Sends a prompt to OpenAI and generates a completion. Note: this uses the legacy OpenAI Completions API. We recommend using Conversation or Conversation With Assistant actions instead, which are powered by the latest OpenAI APIs.",
"code": "// Send a free-form prompt. Note: this adaptor calls Chat Completions under\n// the hood, not the legacy text-completions endpoint.\nprompt(\n `What are three risks to watch for in the following plan?\\n\\n${$.data.plan}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.5,\n }\n);"
},
"Summarize Text (Legacy)": {
"description": "Enter a block of text and generate a summary. Powered by Chat Completions API.",
"code": "// Summarize a chunk of text.\nprompt(\n `Summarize the text below in 3 short bullet points.\\n\\nTEXT:\\n${$.data.text}`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.2,\n }\n);"
},
"Write an Email": {
"description": "Writes the content of an email based on your provided prompt for use in a subsequent step.",
"code": "// Draft an email body for use in a later send step.\nprompt(\n `Write a friendly email to ${$.data.recipientName} confirming their\\nappointment on ${$.data.appointmentDate}. Sign it from \\\"OpenFn Team\\\".`,\n {\n model: 'gpt-4o-mini',\n temperature: 0.7,\n }\n);"
},
"API Request (Beta)": {
"description": "This is an advanced action which makes a raw HTTP request that includes this integration's authentication.",
"code": ""
}
},
"SEARCH": {
"Find Conversation": {
"description": "Find a conversation for native OpenAI conversation management.",
"code": ""
},
"Find File": {
"description": "Finds a file by filename. Optionally, create a file if none are found.",
"code": ""
},
"Find Response": {
"description": "Find a stored Responses API result by response ID for audit trails and debugging.",
"code": ""
},
"Get Video": {
"description": "Retrieve the status and details of a video generation job created with Sora. Use this to check if a video is ready for download.",
"code": ""
},
"Search Embeddings": {
"description": "This best matches a query string (like \"big animal\") to a list of document strings (like \"mouse\", \"cat\", \"buffalo\", and \"blue whale\").",
"code": ""
}
}
}
30 changes: 30 additions & 0 deletions packages/claude/snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"CREATE": {
"Delete File": {
"description": "Delete a file from Anthropic",
"code": ""
},
"Download File": {
"description": "Download file content from Anthropic",
"code": ""
},
"Send Message": {
"description": "Sends a message to Claude and the model generates the next message in the conversation, storing the messages as you go.",
"code": "// Send a prompt to Claude.\n// The model's reply is written to state.data.\nprompt(\n // 1) The message text. Reference upstream state with $.\n `Summarize this text: ${JSON.stringify($.data)}`,\n {\n // 2) Model id. Defaults to the latest Sonnet if omitted.\n model: 'claude-sonnet-4-6',\n // 3) Maximum tokens to generate in the reply.\n max_tokens: 1024,\n // 4) 0.0 = analytical / deterministic, 1.0 = creative.\n temperature: 0.7,\n }\n);"
},
"Upload File": {
"description": "Upload a file to Anthropic",
"code": ""
}
},
"SEARCH": {
"Get File Metadata": {
"description": "Get metadata for a specific file",
"code": ""
},
"List Files": {
"description": "List all files uploaded to Anthropic",
"code": ""
}
}
}
Loading
Loading