### Chipp AI Custom Actions Getting Started Source: https://chipp.ai/docs/custom-actions/examples A guide to getting started with custom actions, outlining the initial steps required to set up and use them in Chipp AI. ```English Getting Started with Custom Actions To begin using custom actions, you typically need to define the action's trigger, its inputs and outputs, and the logic it will execute. This often involves creating a configuration file or using a dedicated interface within the Chipp AI platform. ``` -------------------------------- ### Chipp.ai Navigation and Getting Started Source: https://chipp.ai/docs/custom-actions/examples Provides guidance on navigating the Chipp.ai documentation and starting with the platform. Includes links to key sections like Getting Started, Parameter Configuration, and Testing. ```APIDOC Navigation: - Getting Started - Parameter Configuration - Manage Variables - Testing Guide - Next Steps ``` -------------------------------- ### Chipp API Quickstart Source: https://chipp.ai/docs/index A guide to getting started with the Chipp API quickly. It covers the essential steps for authentication and making your first API call. ```APIDOC Chipp API Quickstart: - Authentication: Learn how to authenticate requests using API keys. - First API Call: Step-by-step instructions to make your initial API request. ``` -------------------------------- ### Chipp AI Custom Actions Guide Source: https://chipp.ai/docs/custom-actions/getting-started A comprehensive guide to creating and managing Custom Actions in Chipp AI, covering configuration, variables, secrets, and testing. ```APIDOC Custom Actions: - What are Custom Actions?: An overview of Custom Actions and their purpose. - Getting Started with Custom Actions: Step-by-step instructions to begin using Custom Actions. - Parameter Configuration: How to define and configure parameters for your actions. - Variables and Secrets: Managing environment variables and sensitive information. - Testing and Debugging: Strategies for testing and debugging Custom Actions. - Integration Examples: Practical examples of integrating Custom Actions with other services. ``` -------------------------------- ### Chipp Custom Actions Getting Started Source: https://chipp.ai/docs/index A guide to creating your first custom action within minutes, covering the fundamentals of API integration and parameter configuration. ```APIDOC Chipp Custom Actions Getting Started: - First Custom Action: Step-by-step process for creating a new custom action. - API Integration Basics: Learn the core concepts of integrating with APIs. - Parameter Configuration: Understand how to set up action parameters. ``` -------------------------------- ### Chipp AI API Reference Source: https://chipp.ai/docs/custom-actions/getting-started Provides details on the Chipp AI API, including authentication, endpoints, and streaming capabilities. ```APIDOC API Reference: - Quickstart: Guides for initial setup and usage. - Authentication: Details on how to authenticate API requests. - API Reference: Comprehensive list of available API endpoints and their functionalities. - Streaming: Information on utilizing the streaming API for real-time data. ``` -------------------------------- ### Chipp API Response Example Source: https://chipp.ai/docs/api/quickstart An example of a successful response from the Chipp API, including a chat session ID and the assistant's message. ```APIDOC {"chatSessionId":"550e8400-e29b-41d4-a716-446655440000","choices":[{"message":{"role":"assistant","content":"Response text here"}}]} ``` -------------------------------- ### Import cURL Command Source: https://chipp.ai/docs/custom-actions/getting-started Demonstrates how to import a cURL command to auto-populate action details such as method, headers, and body parameters. Placeholders within the command can be defined with example values and AI instructions. ```bash curl -X POST https://api.example.com/messages \ -H "Authorization: Bearer {{var.API_KEY}}"\ -H "Content-Type: application/json"\ -d '{ "to": "{{email}}", "subject": "{{subject}}", "body": "{{message}}" }' ``` -------------------------------- ### Create a Custom Action Source: https://chipp.ai/docs/custom-actions/getting-started Defines the basic fields for creating a custom action, including title, description, method, and URL. It also details how to add query parameters with AI generation capabilities. ```APIDOC Title: Search Users Description: Search for users in the database by name or email Method: GET URL: https://api.example.com/users Parameters: Source: Let AI generate Key: query Type: String Example: john.doe@example.com AI Instructions: Search term based on user's request Required: ✓ ``` -------------------------------- ### Action Dependencies for Multi-step Workflows Source: https://chipp.ai/docs/custom-actions/getting-started Explains how to create multi-step workflows by defining action dependencies, where the output of one action can be used as input for another. This enables sequential execution of actions based on user requests. ```APIDOC Step 1 - Get User ID: Name: Get Current User URL: https://api.example.com/me Returns: {"data": {"id": "user_123", "name": "John"}} Step 2 - Get User Details: Name: Get User Orders URL: https://api.example.com/users/{{userId}}/orders Parameter configuration: Source: Output from another Action Action: Get Current User JSONPath: $.data.id (extracts "user_123" from Step 1) ``` -------------------------------- ### Define and Use Variables Source: https://chipp.ai/docs/custom-actions/getting-started Explains how to define reusable values in the Variables tab, such as API keys and base URLs, and how to reference them in action configurations using the `{{var.}}` syntax. ```APIDOC Variables: API_KEY = sk-abc123... BASE_URL = https://api.example.com Usage in Action: URL: {{var.BASE_URL}}/users Header: Authorization: Bearer {{var.API_KEY}} ``` -------------------------------- ### Chipp.ai Integration Examples Source: https://chipp.ai/docs/custom-actions/examples Provides examples of integrating Chipp.ai with various external services. This includes setting up notifications, handling data, and managing workflows across different platforms. ```APIDOC Integration Examples: - Slack Notifications - SendGrid Email - Google Sheets (Read Data, Append Data) - Webhook with Dependencies - OpenAI Completions - CRM Integration - Stripe Payment - Weather API - GitHub Integration ``` -------------------------------- ### Chipp.ai Usage Examples Source: https://chipp.ai/docs/custom-actions/examples Illustrates how to use Chipp.ai integrations with practical usage examples. This section helps users understand how to leverage the features for specific tasks. ```APIDOC Usage Examples: - Google Sheets: Read Data, Append Data - Weather API: Usage Examples - GitHub Integration: Parameter Configuration ``` -------------------------------- ### JSONPath Examples Source: https://chipp.ai/docs/custom-actions/getting-started Provides examples of JSONPath expressions used to extract specific data from API responses, including accessing top-level fields, nested fields, array items, and all items in an array. ```APIDOC $.id $.data.user.id $.items[0].name $.teams[*].id ``` -------------------------------- ### Text Data Example Source: https://chipp.ai/docs/custom-actions/parameters Shows an example of text data, including strings and URLs. ```JSON { "name": "John Doe", "url": "https://example.com" } ``` -------------------------------- ### Chipp AI Custom Actions Integration Examples Source: https://chipp.ai/docs/custom-actions/examples Illustrative examples of how to integrate custom actions with other services or workflows within Chipp AI. ```English Integration Examples This section provides practical examples of integrating custom actions. For instance, an action could be created to fetch data from an external API, process it, and return the results to a Chipp AI workflow. Another example might involve sending notifications via a messaging service based on certain conditions. ``` -------------------------------- ### Boolean Data Example Source: https://chipp.ai/docs/custom-actions/parameters Demonstrates examples of boolean values (true/false). ```JSON { "active": true, "verified": false } ``` -------------------------------- ### Example Usage of System Variables in cURL Source: https://chipp.ai/docs/custom-actions/getting-started Illustrates how to use system variables like `{{system.user_id}}` and `{{system.timestamp}}` within a cURL command to pass contextual information to an API endpoint. ```bash curl -X POST https://api.example.com/analyze \ -H "Content-Type: application/json"\ -H "X-User-ID: {{system.user_id}}"\ -d '{ "timestamp": "{{system.timestamp}}", "messages": {{system.message_history}} }' ``` -------------------------------- ### Chipp API Continue Conversation Example Source: https://chipp.ai/docs/api/quickstart Demonstrates how to continue a conversation with the Chipp API by including the `chatSessionId` from a previous response in the new request. ```APIDOC {"model":"myapp-123","chatSessionId":"550e8400-e29b-41d4-a716-446655440000","messages":[{"role":"user","content":"Follow up"}]} ``` -------------------------------- ### Chipp.ai Workflow Steps Source: https://chipp.ai/docs/custom-actions/examples Outlines the steps involved in setting up and executing workflows with Chipp.ai, such as creating users and sending emails. ```APIDOC Workflow Steps: - Step 1: Create User - Step 2: Send Welcome Email ``` -------------------------------- ### Numeric Data Example Source: https://chipp.ai/docs/custom-actions/parameters Illustrates examples of integer and decimal numeric data. ```JSON { "count": 42, "price": 19.99 } ``` -------------------------------- ### Bad Example: Subject Line Generation Source: https://chipp.ai/docs/custom-actions/parameters Shows a poor example of a prompt for generating an email subject line, lacking detail and specificity. ```APIDOC Bad Example: `Make a subject` ``` -------------------------------- ### Array Data Example Source: https://chipp.ai/docs/custom-actions/parameters Illustrates an example of a JSON array containing strings and numbers. ```JSON { "tags": [ "api", "integration", "automation" ], "ids": [ 1, 2, 3 ] } ``` -------------------------------- ### Chipp Custom Actions Integration Examples Source: https://chipp.ai/docs/index A collection of common integration patterns and real-world examples for custom actions, including integrations with Slack, SendGrid, and databases. ```APIDOC Chipp Custom Actions Integration Examples: - Common Patterns: Explore typical integration scenarios. - Real-world Use Cases: Examples with Slack, SendGrid, databases, and more. ``` -------------------------------- ### Chipp.ai Configuration and Parameters Source: https://chipp.ai/docs/custom-actions/examples Details the configuration options and parameters available for various Chipp.ai integrations. This section covers how to set up and customize integrations for different services. ```APIDOC Configuration and Parameters: - Slack Notifications Configuration - OpenAI Completions Configuration - SendGrid Email Configuration - Google Sheets Configuration - CRM Integration Configuration - Stripe Payment Configuration - Weather API Configuration - GitHub Integration Configuration ``` -------------------------------- ### System Variables Source: https://chipp.ai/docs/custom-actions/getting-started Details the available system variables that provide runtime context, including `message_history`, `user_id`, and `timestamp`. These can be used in action configurations to access conversation data, user information, and time context. ```APIDOC {{system.message_history}} - Returns the full conversation as an array - Format: OpenAI Chat Completions API format - Use case: Send conversation context to analysis APIs - Example: "[{"role": "user", "content": "Hello"}, {"role": "assistant", "content": "Hi there"}]" {{system.user_id}} - Returns the unique ID of the current user - Format: String identifier - Use case: Track actions by user, personalize responses - Example: "user_abc123" {{system.timestamp}} - Returns the current Unix timestamp in seconds - Format: String number - Use case: Log when actions occur, time-based operations - Example: "1713552052" ``` -------------------------------- ### Chipp AI Custom Actions Overview Source: https://chipp.ai/docs/custom-actions/examples Provides an introduction to custom actions in Chipp AI, explaining what they are and how they can be utilized within the platform. ```English What are Custom Actions? Custom Actions allow you to extend the functionality of Chipp AI by defining specific tasks or operations that can be triggered within your workflows. They enable integration with external services, custom logic, and data manipulation. ``` -------------------------------- ### Good Example: Subject Line Generation Source: https://chipp.ai/docs/custom-actions/parameters Provides a good example of a prompt for generating a professional email subject line, emphasizing length and content. ```APIDOC Good Example: `Generate a professional email subject line (max 100 chars) based on the email content. Include the recipient's name if mentioned.` ``` -------------------------------- ### URL Template Example Source: https://chipp.ai/docs/custom-actions/parameters Illustrates a URL template with placeholders for dynamic user and post IDs, showing how variables are substituted. ```APIDOC URL Template: https://api.example.com/users/{{userId}}/posts/{{postId}} Result: https://api.example.com/users/123/posts/456 ``` -------------------------------- ### API Error Handling and Best Practices Source: https://chipp.ai/docs/custom-actions/examples Demonstrates how to handle API errors, respect rate limits, and implement security and performance best practices when interacting with APIs. Includes examples of error responses, request throttling, and secure credential management. ```APIDOC API Error Response Example: ```json {"success":false,"error":"API key invalid. Please check your credentials."} ``` Rate Limiting Best Practices: - Add delays between requests. - Implement exponential backoff. - Cache responses when possible. Security Best Practices: - Use HTTPS endpoints only. - Store credentials as secret variables. - Never log sensitive data. - Validate all inputs. Performance Best Practices: - Paginate large result sets. - Use field selection to minimize data. - Implement timeouts (30s max). - Cache frequently accessed data. Testing Best Practices: - Test with various inputs. - Verify error handling. - Check edge cases. - Monitor response times. ``` -------------------------------- ### Chipp API Chat Completions with OpenAI SDK Source: https://chipp.ai/docs/api/quickstart This JavaScript snippet shows how to use the OpenAI SDK to make requests to the Chipp API. It configures the SDK with the API key and base URL, then creates a chat completion request. ```javascript import OpenAI from'openai'; const openai = new OpenAI({ apiKey: process.env.CHIPP_API_KEY, baseURL:'https://app.chipp.ai/api/v1' }); const response = await openai.chat.completions.create({ model:'myapp-123', messages:[{role:'user',content:'Hello'}] }); ``` -------------------------------- ### Nested JSON Structure Example Source: https://chipp.ai/docs/custom-actions/parameters Shows an example of a nested JSON object containing tags and properties. ```JSON { "metadata": { "tags": [ "important", "urgent" ], "properties": { "color": "blue" } } } ``` -------------------------------- ### Variable Syntax Example Source: https://chipp.ai/docs/custom-actions/testing Illustrates the correct syntax for variable replacement using `{{var.NAME}}`. ```text Variables not replaced Syntax error Check `{{var.NAME}}` format ``` -------------------------------- ### Chipp AI Custom Actions Testing and Debugging Source: https://chipp.ai/docs/custom-actions/examples Guidance on testing and debugging custom actions to ensure they function correctly and efficiently. ```English Testing and Debugging Thorough testing is crucial for custom actions. Chipp AI provides tools or methods to test your actions with sample inputs, inspect their outputs, and debug any issues that arise. This may involve logging mechanisms or a dedicated testing environment. ``` -------------------------------- ### Fetch Weather Data Source: https://chipp.ai/docs/custom-actions/examples Example of fetching weather data for a specified city using the OpenWeatherMap API. Requires the city name and an API key, and allows specifying units (e.g., metric). ```curl curl -X GET "https://api.openweathermap.org/data/2.5/weather" \ -G \ --data-urlencode "q={{city}}"\ --data-urlencode "appid={{var.WEATHER_API_KEY}}"\ --data-urlencode "units=metric" ``` -------------------------------- ### Example API Request (cURL) Source: https://chipp.ai/docs/api/authentication A cURL command example demonstrating how to make a request to the Chipp AI API, including the Authorization header and JSON payload. ```bash curl https://app.chipp.ai/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "myapp-123", "messages": [{"role": "user", "content": "Hello!"}] }' ``` -------------------------------- ### Error Response Example Source: https://chipp.ai/docs/custom-actions/testing Example of a graceful failure response indicating a resource was not found. ```json { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "User with ID 123 not found" } } ``` -------------------------------- ### OpenAI SDK Streaming Example Source: https://chipp.ai/docs/api/streaming Example of streaming chat completions using the OpenAI SDK for Node.js. It configures the SDK with the Chipp.ai base URL and iterates over the stream. ```javascript import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: process.env.CHIPP_API_KEY, baseURL: 'https://app.chipp.ai/api/v1' }); async function streamWithSDK() { const stream = await openai.chat.completions.create({ model: 'myapp-123', messages: [{ role: 'user', content: 'Hello!' }], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content || ''); } } ``` -------------------------------- ### Real-World Data Flow Example Source: https://chipp.ai/docs/custom-actions/parameters Demonstrates a practical scenario of creating a support ticket by passing an organization ID extracted from user details. ```APIDOC **Real-World Example:** **Scenario:** Create a support ticket for a user's organization **Action 1: Get User Details** * Returns: `{"user": {"id": "u123", "org_id": "org456", "name": "John"}}` **Action 2: Create Ticket** * Parameter: `organization_id` * Source: Output from another Action * Action: Get User Details * JSONPath: `$.user.org_id` * Result: Parameter receives "org456" ``` -------------------------------- ### Test Response Example Source: https://chipp.ai/docs/custom-actions/testing Example of a successful test request response, showing status, results, and response time. ```JSON {"status":200,"response":{"results":[{"id":123,"title":"Customer Support Guide"}],"total":42},"time":"234ms"} ``` -------------------------------- ### JSONPath Examples Source: https://chipp.ai/docs/custom-actions/parameters Provides examples of JSONPath syntax for extracting data from JSON structures, including top-level fields, nested fields, array items, and filtering. ```APIDOC JSONPath Examples: $.id// Top-level field: {"id": "123"} → "123" $.data.user.email// Nested field: {"data": {"user": {"email": "a@b.com"}}} → "a@b.com" $.items[0].name// First array item: {"items": [{"name": "First"}]} → "First" $.items[*].id// All IDs: {"items": [{"id": 1}, {"id": 2}]} → [1, 2] $.data.users[?(@.active)]// Filtered: active users only ``` -------------------------------- ### Multi-step Workflow: Create User and Send Email Source: https://chipp.ai/docs/custom-actions/examples Demonstrates a multi-step workflow where a user is created via an API, and then an email is sent using the created user's ID. This showcases action dependencies and passing data between steps. ```curl curl -X POST https://api.example.com/users \ -H "Content-Type: application/json"\ -H "Authorization: Bearer {{var.API_KEY}}"\ -d '{ "name": "{{userName}}", "email": "{{userEmail}}" }' ``` ```json Returns: `{"data": {"id": "user_123", "email": "john@example.com"}}` ``` ```curl curl -X POST https://api.example.com/emails \ -H "Content-Type: application/json"\ -H "Authorization: Bearer {{var.API_KEY}}"\ -d '{ "user_id": "{{userId}}", "template": "welcome", "send_at": "{{system.timestamp}}" }' ``` -------------------------------- ### Python Streaming Example Source: https://chipp.ai/docs/api/streaming Example of how to stream chat completions using Python with the requests library. It iterates over the response lines and prints the content from each data chunk. ```python import requests import json import os response = requests.post('https://app.chipp.ai/api/v1/chat/completions', headers={'Content-Type':'application/json','Authorization':f'Bearer {os.environ["CHIPP_API_KEY"]}'}, json={'model':'myapp-123','messages':[{'role':'user','content':'Hello!'}],'stream':True}, stream=True) for line in response.iter_lines(): if line: line = line.decode('utf-8') if line.startswith('data: '): data = line[6:] if data == '[DONE]': break try: chunk = json.loads(data) content = chunk['choices'][0]['delta'].get('content', '') print(content, end='', flush=True) except: pass ``` -------------------------------- ### Send Transactional Emails via SendGrid Source: https://chipp.ai/docs/custom-actions/examples Example for sending transactional emails using the SendGrid API. It requires a SendGrid API key, sender email and name, recipient email, subject, and email body. ```curl curl -X POST https://api.sendgrid.com/v3/mail/send \ -H "Authorization: Bearer {{var.SENDGRID_API_KEY}}"\ -H "Content-Type: application/json"\ -d '{ "personalizations": [{ "to": [{"email": "{{recipientEmail}}"}], "subject": "{{subject}}" }], "from": { "email": "{{var.FROM_EMAIL}}", "name": "{{var.FROM_NAME}}" }, "content": [{ "type": "text/html", "value": "{{emailBody}}" }]'} ``` ```shell SENDGRID_API_KEY = SG.abc123... FROM_EMAIL = noreply@example.com FROM_NAME = Your Company ``` -------------------------------- ### JavaScript Streaming Example Source: https://chipp.ai/docs/api/streaming Example of how to stream chat completions using JavaScript with the Fetch API. It reads the response body chunk by chunk and processes the content. ```javascript async function streamChat(model, messages) { const response = await fetch('https://app.chipp.ai/api/v1/chat/completions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${process.env.CHIPP_API_KEY}` }, body: JSON.stringify({ model, messages, stream: true }) }); const reader = response.body.getReader(); const decoder = new TextDecoder(); while (true) { const { done, value } = await reader.read(); if (done) break; const chunk = decoder.decode(value); const lines = chunk.split('\n'); for (const line of lines) { if (line.startsWith('data: ')) { const data = line.slice(6); if (data === '[DONE]') return; try { const parsed = JSON.parse(data); const content = parsed.choices[0]?.delta?.content || ''; process.stdout.write(content); } catch (e) { // Skip parsing errors } } } } } ``` -------------------------------- ### Send Slack Messages via Webhook Source: https://chipp.ai/docs/custom-actions/examples Example of sending messages to Slack channels using a webhook. Requires a Slack webhook ID and allows specifying the message content and target channel. ```curl curl -X POST https://hooks.slack.com/services/{{var.SLACK_WEBHOOK_ID}} -H "Content-Type: application/json" -d '{ "text": "{{message}}", "channel": "{{channel}}", "username": "Chipp Bot" }' ``` -------------------------------- ### Chipp API Chat Completions Source: https://chipp.ai/docs/api/quickstart This snippet demonstrates how to interact with the Chipp API's chat completions endpoint using cURL. It includes the necessary headers for authorization and content type, along with a sample request body. ```curl curl https://app.chipp.ai/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY"\ -H "Content-Type: application/json"\ -d '{ "model": "myapp-123", "messages": [{"role": "user", "content": "Hello"}] }' ``` -------------------------------- ### Chipp API Endpoint Details Source: https://chipp.ai/docs/api/quickstart Provides key details for the Chipp API chat completions endpoint, including the HTTP method, URL, model format, authentication method, and expected request body structure. ```APIDOC POST https://app.chipp.ai/api/v1/chat/completions Model: Your app's ID (format: `appname-123`) Auth: Bearer token in header Body: OpenAI-compatible format ``` -------------------------------- ### Chipp AI Custom Actions Parameter Configuration Source: https://chipp.ai/docs/custom-actions/examples Details on how to configure parameters for custom actions, including data types, default values, and validation rules. ```English Parameter Configuration When defining a custom action, you can specify input parameters that the action will receive. This includes defining the parameter name, its expected data type (e.g., string, integer, boolean), whether it's required, and any default value. Validation rules can also be applied to ensure data integrity. ``` -------------------------------- ### Chat Session Management Source: https://chipp.ai/docs/api/reference Instructions on how to manage chat sessions, including starting a new session and continuing an existing one. ```APIDOC To start a new session, omit `chatSessionId`. To continue an existing session, include the `chatSessionId` from a previous response. Previous messages are loaded automatically. ``` -------------------------------- ### Preview Parameter Resolution with URL Template Source: https://chipp.ai/docs/custom-actions/parameters Demonstrates how to preview parameter resolution by defining a URL template and test values, showing the final GET request. ```APIDOC # Configuration URL: https://api.example.com/{{endpoint}} Query: search={{query}} # Test Values endpoint: "users" query: "john" # Result GET https://api.example.com/users?search=john ``` -------------------------------- ### Call OpenAI API for Advanced Processing Source: https://chipp.ai/docs/custom-actions/examples Demonstrates how to interact with the OpenAI API for advanced text processing. It uses the chat completions endpoint and requires an OpenAI API key, conversation context, and a token limit. ```curl curl -X POST https://api.openai.com/v1/chat/completions \ -H "Authorization: Bearer {{var.OPENAI_API_KEY}}"\ -H "Content-Type: application/json"\ -d '{ "model": "gpt-4", "messages": {{system.message_history}}, "temperature": 0.7, "max_tokens": {{maxTokens}} }' ``` -------------------------------- ### Chipp AI Custom Actions Variables and Secrets Source: https://chipp.ai/docs/custom-actions/examples Explains how to manage variables and secrets within custom actions for secure and dynamic operation. ```English Variables and Secrets Custom actions can leverage variables for dynamic values and secrets for sensitive information like API keys or passwords. These are typically managed through a secure vault or environment variable system provided by Chipp AI, ensuring that credentials are not hardcoded. ``` -------------------------------- ### Built-in System Variables and Usage Example Source: https://chipp.ai/docs/custom-actions/variables Showcases the available built-in system variables and provides an example of how to construct a JSON payload using `message_history`, `user_id`, and `timestamp`. ```APIDOC # Built-in variables: # {{system.message_history}}: Full conversation history (Array) # {{system.user_id}}: Current user's unique ID (String) # {{system.timestamp}}: Unix timestamp (seconds) (String) # Example usage in JSON payload: { "messages": {{system.message_history}}, "metadata": { "user": "{{system.user_id}}", "timestamp": "{{system.timestamp}}", "source": "custom_action" } } ``` -------------------------------- ### Create Issues in GitHub Repositories Source: https://chipp.ai/docs/custom-actions/examples Demonstrates creating issues in GitHub repositories via the API. Requires a GitHub token, repository owner, repository name, issue title, body, and optional labels and assignees. ```curl curl -X POST https://api.github.com/repos/{{var.GITHUB_OWNER}}/{{var.GITHUB_REPO}}/issues \ -H "Authorization: Bearer {{var.GITHUB_TOKEN}}"\ -H "Content-Type: application/json"\ -d '{ "title": "{{issueTitle}}", "body": "{{issueBody}}", "labels": {{labels}}, "assignees": {{assignees}} }' ``` -------------------------------- ### Chat Completions API Response Source: https://chipp.ai/docs/api/reference Example of a successful response from the Chat Completions endpoint, including response structure and usage details. ```APIDOC { "chatSessionId": "550e8400-e29b-41d4-a716-446655440000", "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1699451234, "model": "myapp-123", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 15, "total_tokens": 25 } } ``` -------------------------------- ### Detailed Request Logging Source: https://chipp.ai/docs/custom-actions/testing Example of detailed logging for a POST request, including the URL, headers, and body. ```APIDOC POST https://api.example.com/endpoint Headers: Authorization: Bearer [REDACTED] Content-Type: application/json Body: {"query":"test search", "filters":{"status":"active"}} ``` -------------------------------- ### Read and Write Data to Google Sheets Source: https://chipp.ai/docs/custom-actions/examples Code snippets for interacting with Google Sheets API to read data from a specified range and append new data. Requires a Google API key and the sheet ID. ```curl curl -X GET "https://sheets.googleapis.com/v4/spreadsheets/{{var.SHEET_ID}}/values/{{range}}" -H "Authorization: Bearer {{var.GOOGLE_API_KEY}}" ``` ```curl curl -X POST "https://sheets.googleapis.com/v4/spreadsheets/{{var.SHEET_ID}}/values/{{range}}:append" -H "Authorization: Bearer {{var.GOOGLE_API_KEY}}" -H "Content-Type: application/json" -d '{ "values": [[ "{{system.timestamp}}", "{{system.user_id}}", "{{data}}" ]] }' ``` -------------------------------- ### Create Payment Intents via Stripe API Source: https://chipp.ai/docs/custom-actions/examples Code for creating payment intents using the Stripe API. Requires a Stripe secret key, amount, and customer ID. The amount is specified in cents. ```curl curl -X POST https://api.stripe.com/v1/payment_intents \ -u "{{var.STRIPE_SECRET_KEY}}:" -H "Content-Type: application/x-www-form-urlencoded" -d "amount={{amount}}¤cy=usd&customer={{customerId}}" ``` -------------------------------- ### Test Request Data Structure Source: https://chipp.ai/docs/custom-actions/testing Example of input data for testing AI-generated parameters in custom actions. ```JSON {"searchQuery":"customer support","limit":10,"includeArchived":false} ``` -------------------------------- ### Environment-Specific Variable Configuration Source: https://chipp.ai/docs/custom-actions/variables Provides examples of how to configure variables like `API_DOMAIN` and `ENVIRONMENT` differently for development and production environments. ```APIDOC # Development API_DOMAIN = api.dev.example.com ENVIRONMENT = development # Production API_DOMAIN = api.example.com ENVIRONMENT = production ``` -------------------------------- ### Tenant-Specific Variable Examples Source: https://chipp.ai/docs/custom-actions/variables Demonstrates how to use variables to store tenant-specific identifiers such as `WORKSPACE_ID`, `TENANT_KEY`, and `ORG_ID`. ```APIDOC WORKSPACE_ID = ws_123456 TENANT_KEY = tenant_abc ORG_ID = org_789 ``` -------------------------------- ### 401 Unauthorized Error Handling Source: https://chipp.ai/docs/custom-actions/testing Example of a 401 Unauthorized error response and solutions for checking API key variables and header formats. ```JSON {"error":"Invalid API key"} ``` -------------------------------- ### Create High Priority Ticket via Custom Action Source: https://chipp.ai/docs/custom-actions/overview Example of a custom action to create a high-priority support ticket. It uses a POST request to a helpdesk API with ticket details in the JSON payload. ```APIDOC POST https://api.helpdesk.com/tickets Payload: title: "Login authentication failing" priority: "high" description: "Users unable to log in since 3pm" ``` -------------------------------- ### Custom Action JSON Body Source: https://chipp.ai/docs/custom-actions/parameters Illustrates the JSON data structure to be sent in the request body for POST, PUT, and PATCH methods in custom actions. It includes examples of using variables like userName and userEmail, and system properties like timestamp. ```APIDOC JSON data sent in POST, PUT, and PATCH requests. ``` {"name":"{{userName}}","email":"{{userEmail}}","metadata":{"source":"chipp","timestamp":"{{system.timestamp}}"}} ``` ``` -------------------------------- ### Sample Values for AI Learning Source: https://chipp.ai/docs/custom-actions/parameters Demonstrates how sample values for parameters teach the AI about expected formats and conventions. ```APIDOC Sample values teach the AI about format expectations: Parameter | Sample Value | AI Learns ---|---|--- `phone` | `+1-555-0123` | Include country code with dashes `date` | `2024-03-15` | Use ISO 8601 format `slug` | `my-blog-post` | Lowercase with hyphens ``` -------------------------------- ### Look Up Customer Order Status via Custom Action Source: https://chipp.ai/docs/custom-actions/overview Example of a custom action to retrieve order status for a specific customer. It uses a GET request to an API endpoint with the customer ID as a query parameter. ```APIDOC GET https://api.yourstore.com/orders?customer_id=12345 ``` -------------------------------- ### Tips for Data Flow and JSONPath Source: https://chipp.ai/docs/custom-actions/parameters Provides helpful tips for using JSONPath and AI-powered context, including testing and understanding action dependencies. ```APIDOC Tips: * JSONPath is optional - the Context field alone often works perfectly * Test JSONPath at jsonpath.com with sample data if you need precision * Actions with dependencies show a link icon in your action list * The AI is smart about finding the right values based on your context description ``` -------------------------------- ### Error Context Relay Example Source: https://chipp.ai/docs/custom-actions/testing Example of error context that an AI can receive and relay, such as an invalid recipient address for an email. ```json { "error": "Unable to send email: recipient address invalid" } ``` -------------------------------- ### API Endpoint: Get User Details Source: https://chipp.ai/docs/custom-actions/testing Retrieves detailed information for a specific user using their ID. This action depends on the output from the 'Get User' action. ```APIDOC GET /api/users/123/details → Uses output from Action 1 ``` -------------------------------- ### Chipp Custom Actions Overview Source: https://chipp.ai/docs/index An introduction to Custom Actions in Chipp, explaining how they enable AI assistants to connect with any API or service without requiring code. ```APIDOC Chipp Custom Actions Overview: - Functionality: Connect AI assistants to external APIs and services. - No-Code Integration: Build powerful integrations without writing traditional code. ``` -------------------------------- ### Update Customer Records in CRM Source: https://chipp.ai/docs/custom-actions/examples Example of updating customer records in a CRM system using a PATCH request. It allows updating fields like last contact time, last message, and status, requiring a CRM API key and contact ID. ```curl curl -X PATCH https://api.crm.com/v2/contacts/{{contactId}} \ -H "Authorization: Bearer {{var.CRM_API_KEY}}"\ -H "Content-Type: application/json"\ -d '{ "properties": { "last_contact": "{{system.timestamp}}", "last_message": "{{summary}}", "status": "{{status}}" } }' ``` -------------------------------- ### Full Response Inspection Source: https://chipp.ai/docs/custom-actions/testing Example of inspecting a full API response, including status, headers, and body. ```APIDOC {"status":200,"headers":{"content-type":"application/json","x-request-id":"req_123"},"body":{"success":true,"data":[...]}} ``` -------------------------------- ### API Endpoint: Get User Source: https://chipp.ai/docs/custom-actions/testing Retrieves user information. Returns a JSON object containing the user's ID. ```APIDOC GET /api/user → Returns {"id":123} ``` -------------------------------- ### Variable Resolution and Placeholder Filling Source: https://chipp.ai/docs/custom-actions/testing Demonstrates how variables and placeholders are resolved in the configuration URL and headers during testing. ```Shell # ConfigurationURL: {{var.BASE_URL}}/api/{{endpoint}}Header: Bearer {{var.API_KEY}}# Test PreviewURL: https://api.example.com/api/users Header: Bearer sk-abc123... # ✓ Variables resolved# ✓ Placeholders filled# ✓ Syntax correct ``` -------------------------------- ### Flat Parameter Keys and Resulting JSON Source: https://chipp.ai/docs/custom-actions/parameters Demonstrates how flat parameter keys are used to construct a JSON object, specifying the response format and schema details. ```JSON response_format.type ="json_schema" response_format.json_schema.strict =true response_format.json_schema.name ="analyze" # Resulting JSON {"response_format":{"type":"json_schema", "json_schema":{"strict": true, "name":"analyze"}}} ``` -------------------------------- ### Combining Different Parameter Sources Source: https://chipp.ai/docs/custom-actions/parameters Illustrates how to combine various parameter sources, including API keys, user IDs, AI-generated queries, fixed values, and dependencies, into a single JSON object. ```JSON { "api_key":"{{var.API_KEY}}",// Variable "user_id":"{{system.user_id}}",// System "query":"{{searchTerm}}",// AI generated "limit":10,// Fixed "org_id":"{{previousAction.org_id}}"// Dependency } ``` -------------------------------- ### AI Determines Optional Parameters Source: https://chipp.ai/docs/custom-actions/parameters Shows how AI can dynamically decide whether to include optional parameters based on user input or specific instructions, ensuring relevance and efficiency. ```JSON { "filter":{ "source":"Let AI generate", "required":false, "instructions":"Include only if user specifies filtering criteria" } } ``` -------------------------------- ### Platform-Provided Runtime Variables Source: https://chipp.ai/docs/custom-actions/parameters Lists system-provided runtime variables available for use, such as message history, user ID, and timestamps. ```APIDOC Variable | Type | Description ---|---|--- `{{system.message_history}}` | Array | Full conversation history `{{system.user_id}}` | String | Current user's ID `{{system.timestamp}}` | String | Unix timestamp **Use for** : User context, audit trails, conversation analysis ``` -------------------------------- ### API Requirements Source: https://chipp.ai/docs/api/reference Prerequisites for accessing the API, including plan requirements and API key. ```APIDOC Requirements: - Pro plan or higher (Free accounts cannot access the API) - Valid API key from your application's Share tab ``` -------------------------------- ### Application-Level Reusable Variables Source: https://chipp.ai/docs/custom-actions/parameters Shows how to define reusable variables at the application level, often used for API keys or workspace IDs, resolving to a variable reference. ```APIDOC Setting | Value ---|--- **Source** | Variable **Variable** | `API_KEY` **Resolves to** | `{{var.API_KEY}}` **Use for** : API keys, base URLs, workspace IDs ``` -------------------------------- ### Send Slack Message via Custom Action Source: https://chipp.ai/docs/custom-actions/overview Example of a custom action to send a message to Slack. It uses a POST request to a Slack webhook URL with the message content in the request body. ```APIDOC POST https://hooks.slack.com/services/YOUR_WEBHOOK Payload: text: "The Q4 report is ready for review" ``` -------------------------------- ### Custom Action API Endpoint Configuration Source: https://chipp.ai/docs/custom-actions/overview Configuration details for setting up an API endpoint for a custom action, including supported HTTP methods. ```APIDOC API Endpoint: URL: https://api.yourservice.com/endpoint Methods: GET, POST, PUT, PATCH, DELETE ``` -------------------------------- ### AI Placeholders and Variable Usage Source: https://chipp.ai/docs/custom-actions/variables Demonstrates how AI placeholders are used to represent dynamic data like user IDs, search queries, and email subjects. It also shows how to reference application and system variables within the platform. ```Chipp.AI Syntax # AI will generate these{{userId}}# AI determines user ID{{searchQuery}}# AI creates search term{{emailSubject}}# AI writes subject# These use variables/system{{var.API_KEY}}# Application variable{{system.user_id}}# System variable ``` -------------------------------- ### Custom Action Authentication Methods Source: https://chipp.ai/docs/custom-actions/overview Overview of supported authentication methods for custom actions, including API keys, bearer tokens, and basic authentication. ```APIDOC Authentication: - API keys (stored encrypted) - Bearer tokens (in headers) - Basic auth supported ``` -------------------------------- ### Custom Action Dynamic URL Segments Source: https://chipp.ai/docs/custom-actions/parameters Explains the configuration for dynamic URL segments that are replaced at runtime for custom actions. ```APIDOC Dynamic URL segments replaced at runtime. ``` ``` -------------------------------- ### Custom Action HTTP Headers Source: https://chipp.ai/docs/custom-actions/parameters Defines the HTTP headers to be sent with a custom action request. It demonstrates the use of variables like API_KEY and system properties like user_id. ```APIDOC HTTP headers sent with your request. ``` {"Authorization":"Bearer {{var.API_KEY}}","Content-Type":"application/json","X-User-ID":"{{system.user_id}}"} ``` ``` -------------------------------- ### Data Flow Between Actions (JSONPath) Source: https://chipp.ai/docs/custom-actions/parameters Explains how to use the output of one action as input for another, using JSONPath for precise data extraction. ```APIDOC **How it works:** 1. The prerequisite action runs first and returns data 2. The JSONPath selector extracts the needed value (or uses full response if blank) 3. The extracted value replaces the parameter in your current action 4. If the prerequisite hasn't run yet, the AI automatically runs it first **Configuration Fields:** Setting | Description | Example ---|---|--- **Source** | Select "Output from another Action" **Action** | Choose which action's output to use | `Get User Profile` **JSONPath** | Path to extract specific value (optional) | `$.data.organization.id` **Context** | Instructions for AI on how to use the output | `Use the user's primary organization` ```