### Cogfy npm Package Authentication Example Source: https://docs.cogfy.com/api-reference/authentication The recommended way to interact with the Cogfy API is by using the official 'cogfy' npm package. This example demonstrates initializing the Cogfy client with your API key and making a call to list collections. ```javascript import { Cogfy } from 'cogfy' const cogfy = new Cogfy({ apiKey: process.env.COGFY_API_KEY }) const collections = await cogfy.collections.list() ``` -------------------------------- ### Operation Schema Definition Example Source: https://docs.cogfy.com/operations This example demonstrates the structure of an operation schema, detailing its `displayName`, `description`, `inputs`, and `output`. It shows how to define input parameters with their types and requirements, and the expected return type. ```TypeScript export const schema = { displayName: 'Slugify', description: 'Convert a string to a URL-friendly slug', inputs: { text: { displayName: 'Text', type: 'text', required: true } }, output: { type: 'text' } } as const ``` -------------------------------- ### Node.js Fetch API Authentication Example Source: https://docs.cogfy.com/api-reference/authentication This example shows how to make a direct API call using the built-in 'fetch' function in Node.js. It includes setting the 'Api-Key' header with your credential to authenticate the request for fetching collections. ```javascript const response = await fetch( 'https://api.cogfy.com/collections', { headers: { 'Api-Key': process.env.COGFY_API_KEY } } ) const collections = await response.json() ``` -------------------------------- ### Configure Cogfy Theme Settings Source: https://docs.cogfy.com/fab Provides an example of optional UI settings for Cogfy, demonstrating how to configure color and text properties for the theme. ```javascript themeSettings: { color: '#FFF', text: '#000' } ``` -------------------------------- ### CloudAMQP Get Instance Info API Source: https://docs.cogfy.com/tools/cloudamqp/getInstanceInfo Retrieves detailed information for a given CloudAMQP instance. This API endpoint is part of the Cogfy tools, specifically for managing CloudAMQP services. It requires the CloudAMQP instance identifier as input. ```APIDOC Tool: CloudAMQP Endpoint: Get instance info Description: Get information about a CloudAMQP instance. Inputs: - CloudAMQP instance identifier (Required) Type: string (implied) Description: The unique identifier for the CloudAMQP instance. Related Operations: - Get instance info by id (Next) - CloudAMQP (Previous) ``` -------------------------------- ### CloudAMQP Get Instance Info API Source: https://docs.cogfy.com/operations/cloudamqp/getInstanceInfo Retrieves detailed information about a specific CloudAMQP instance. Requires the instance ID as input. ```APIDOC CloudAMQP: Get instance info: Description: Get information about an instance Inputs: CloudAMQPcloudamqp: The CloudAMQP service identifier. Instance IDtext: The unique identifier for the CloudAMQP instance. Output: text: Returns textual information about the instance. ``` -------------------------------- ### Get content Tool API Source: https://docs.cogfy.com/tools/getContent Details the 'Get content' tool, which retrieves content from a specified source. It outlines the required input parameters for its operation. ```APIDOC Tool: Get content Description: Retrieves content from a specified source, such as a field. This tool can be used to fetch content dynamically during the chat flow. Inputs: - Contenttext (Required): Type: string Description: The content to be retrieved. This could be a field name or a specific identifier for the content source. ``` -------------------------------- ### Get GOV.BR User Info Source: https://docs.cogfy.com/tools/govbr/getUserInfo Retrieves information about a GOV.BR user. This endpoint is part of the GOV.BR integration tools within Cogfy. ```APIDOC Endpoint: /tools/govbr/getUserInfo Method: GET Description: Gets information about the GOV.BR user. Inputs: - govbr: GOV.BR object (Required) Represents the GOV.BR authentication context or credentials. Returns: User information object (details not specified). Related Endpoints: - GET /tools/govbr/getGovbrAuthUrl - GET /tools/govbr/getNiveis ``` -------------------------------- ### Define and Register Custom Tool Source: https://docs.cogfy.com/tools Demonstrates how developers can define and register a custom tool within the Cogfy chat engine. It includes setting instructions, defining a tool with a name, description, and asynchronous method, and configuring the OpenAI model. The example also shows how to run the chat engine with user messages. ```javascript import { ChatEngineBuilder } from '@indigohive/cogfy-chat-engine' const app = new ChatEngineBuilder() .instructions({ instructions: 'You are a helpful assistant that talks like a pirate' }) .tool({ name: 'getDate', description: 'Get the current date', method: async (ctx, args) => { const date = new Date().toISOString() return { content: date } } }) .openai({ model: 'gpt-4o-mini', openai: { apiKey: process.env.OPENAI_API_KEY } }) .build() ;(async function main () { const result = await app.run({ messages: [ { role: 'user', content: 'What time is it now in Japan?' } ] }) console.log(result.messages) console.log(JSON.stringify(result.trace, null, 2)) })() ``` -------------------------------- ### Get GOV.BR Níveis Source: https://docs.cogfy.com/tools/govbr/getNiveis Retrieves the citizen's GOV.BR account level. This endpoint is part of the GOV.BR integration, requiring specific input parameters. ```APIDOC Endpoint: /tools/govbr/getNiveis Description: Get the citizen GOV.BR account level. Inputs: - GOV.BRgovbrRequired: Represents the required GOV.BR parameter, likely an identifier or token for authentication/authorization. ``` -------------------------------- ### Cogfy Chat Engine with Middlewares Source: https://docs.cogfy.com/middlewares This example demonstrates initializing and using the Cogfy chat engine. It configures the engine with essential middlewares like instructions, chat history management, and an OpenAI integration for natural language processing. The code then executes a sample chat interaction and logs the response and execution trace. ```typescript import { ChatEngineBuilder } from '@indigohive/cogfy-chat-engine' const app = new ChatEngineBuilder() .instructions({ instructions: 'You are a helpful assistant' }) .history({ maxCount: 20 }) .openai({ model: 'gpt-4o-mini', openai: { apiKey: process.env.OPENAI_API_KEY } }) .build() ;(async function main () { const result = await app.run({ messages: [ { role: 'user', content: 'Hello' } ] }) console.log(result.messages) console.log(JSON.stringify(result.trace, null, 2)) })() ``` -------------------------------- ### Use Predefined Tool in Chat Engine Source: https://docs.cogfy.com/tools Shows how to use a predefined tool, like `getDate`, within the Cogfy chat engine. It involves importing the tool, registering it using `tool(getDate.tool())`, configuring the engine, and running it with a user query. ```javascript import { ChatEngineBuilder, getDate } from '@indigohive/cogfy-chat-engine' const app = new ChatEngineBuilder() .instructions({ instructions: 'You are a helpful assistant that talks like a pirate' }) .tool(getDate.tool()) .openai({ model: 'gpt-4o-mini', openai: { apiKey: process.env.OPENAI_API_KEY } }) .build() ;(async function main () { const result = await app.run({ messages: [ { role: 'user', content: 'What time is it now in Japan?' } ] }) console.log(result.messages) console.log(JSON.stringify(result.trace, null, 2)) })() ``` -------------------------------- ### Get GOV.BR Auth URL API Source: https://docs.cogfy.com/tools/govbr/getGovbrAuthUrl Generates the GOV.BR authorization URL required for the consent page. It takes connection details and environment as input. ```APIDOC Get GOV.BR Auth URL: Description: Get GOV.BR authorization URL for consent page landing Inputs: Connection: field (type: field) Environment: text (options: Staging, Production; default: Staging) ``` -------------------------------- ### Heroku Get App Operation Source: https://docs.cogfy.com/operations/heroku/getApp Retrieves an application from Heroku. This operation requires the App ID to identify the specific application. The output is the application data, typically as text. ```APIDOC Operation: Heroku Get App Description: Get an app from Heroku. Inputs: - HerokuherokuRequired: The Heroku integration identifier. This field is required. - App ID textRequired: The unique identifier for the Heroku application. This field is required. Output: - text: The retrieved application data. ``` -------------------------------- ### Instructions Middleware Parameters Source: https://docs.cogfy.com/middlewares/instructions Defines the parameters for the Cogfy Instructions middleware, used to configure system instructions for AI chat engines. It includes text for instructions and a mode for applying them. ```APIDOC Instructions Middleware: Parameters: instructionstext: string - Description: The system instructions to guide the AI model's behavior. modetext: string - Description: Specifies how the instructions should be applied. - Options: "overwrite", "append" - Default: "overwrite" ``` -------------------------------- ### Typesense Get Synonym API Operation Source: https://docs.cogfy.com/operations/typesense/getSynonym Retrieves a specific synonym from a designated collection within Typesense. This operation requires the collection name and the synonym identifier. ```APIDOC Operation: Get synonym Description: Get a synonym from a collection in Typesense. Inputs: - Typesense (type: typesense, required: true) - Collection (type: text, required: true) - Synonym (type: text, required: true) Output: - json Related Operations: - Get document (/operations/typesense/getDocument) - List collections (/operations/typesense/listCollections) ``` -------------------------------- ### CloudAMQP Instance Info API Source: https://docs.cogfy.com/tools/cloudamqp Provides API endpoints to retrieve information about CloudAMQP instances. Includes methods to get general instance details and specific details by instance ID. ```APIDOC GET /tools/cloudamqp/getInstanceInfo Description: Retrieves general information about CloudAMQP instances. Parameters: None specified. Returns: Detailed information about CloudAMQP instances. GET /tools/cloudamqp/getInstanceInfoById Description: Retrieves specific information about a CloudAMQP instance using its ID. Parameters: - id: The unique identifier of the CloudAMQP instance. Returns: Detailed information about the specified CloudAMQP instance. ``` -------------------------------- ### Google Calendar Get Event API Source: https://docs.cogfy.com/operations/googleCalendar/getEvent Retrieves a specific event from a Google Calendar. Requires the Calendar ID and the Event ID to fetch the event details. ```APIDOC Operation: Get event Description: Get an event from a Google Calendar. Inputs: - googleCalendarRequired: (Type: Google Calendar) - Specifies the Google Calendar service to use. - calendarId: (Type: text) - The unique identifier for the Google Calendar. - eventId: (Type: text, Required) - The unique identifier for the event to retrieve. Output: - (Type: json) - The details of the retrieved event in JSON format. ``` -------------------------------- ### OpenAI Model Usage and Pricing Source: https://docs.cogfy.com/cogfy-credits Details the credit consumption for various OpenAI models based on input/output tokens or audio minutes. Usage is calculated per 1,000 units. ```APIDOC OpenAIModel: __init__(model_name: str, type: str = 'tokens') model_name: The name of the OpenAI model (e.g., 'o1-pro', 'gpt-4-turbo', 'whisper'). type: The type of usage unit ('tokens' for text, 'audio' for speech). Usage: - o1-pro: - ('tokens':'output'): 1,200 credits per 1,000 tokens - o1-pro-2025-03-19: - ('tokens':'input'): 300 credits per 1,000 tokens - ('tokens':'output'): 1,200 credits per 1,000 tokens - o3-mini-2025-01-31: - ('tokens':'input'): 3 credits per 1,000 tokens - ('tokens':'output'): 9 credits per 1,000 tokens - o1-mini-2024-09-12: - ('tokens':'input'): 3 credits per 1,000 tokens - ('tokens':'output'): 9 credits per 1,000 tokens - whisper: - ('audio'): 12 credits per 1 minute - gpt-3.5-turbo-0126: - ('tokens':'output'): 3 credits per 1,000 tokens - gpt-4-turbo: - ('tokens':'input'): 20 credits per 1,000 tokens - ('tokens':'output'): 60 credits per 1,000 tokens - gpt-4-turbo-2024-04-09: - ('tokens':'input'): 20 credits per 1,000 tokens - ('tokens':'output'): 60 credits per 1,000 tokens - gpt-4.5-preview-2025-02-27: - ('tokens':'input'): 150 credits per 1,000 tokens - ('tokens':'output'): 300 credits per 1,000 tokens - gpt-4o-2024-11-20: - ('tokens':'input'): 5 credits per 1,000 tokens - gpt-4.1-nano: - ('tokens':'input'): 0.5 credits per 1,000 tokens - ('tokens':'output'): 1 credit per 1,000 tokens - o3-2025-04-16: - ('tokens':'input'): 20 credits per 1,000 tokens - ('tokens':'output'): 80 credits per 1,000 tokens - o4-mini-2025-04-16: - ('tokens':'input'): 3 credits per 1,000 tokens - ('tokens':'output'): 9 credits per 1,000 tokens - o3: - ('tokens':'input'): 20 credits per 1,000 tokens - ('tokens':'output'): 80 credits per 1,000 tokens - o4-mini: - ('tokens':'input'): 3 credits per 1,000 tokens - ('tokens':'output'): 9 credits per 1,000 tokens - gpt-4.1-nano-2025-04-14: - ('tokens':'input'): 0.5 credits per 1,000 tokens - ('tokens':'output'): 1 credit per 1,000 tokens - gpt-4.1: - ('tokens':'input'): 4 credits per 1,000 tokens - ('tokens':'output'): 16 credits per 1,000 tokens - gpt-4.1-mini: - ('tokens':'input'): 1 credit per 1,000 tokens - gpt-4o-mini-tts: - ('tokens':'input'): 2 credits per 1,000 tokens - ('tokens':'audio'): 30,000 credits per 1,000 minute - gpt-4.1-2025-04-14: - ('tokens':'input'): 4 credits per 1,000 tokens - ('tokens':'output'): 16 credits per 1,000 tokens - gpt-4.1-mini-2025-04-14: - ('tokens':'input'): 1 credit per 1,000 tokens - ('tokens':'output'): 4 credits per 1,000 tokens Parameters: model_name (str): The specific OpenAI model identifier. type (str): The type of usage unit, typically 'tokens' or 'audio'. quantity (int/float): The amount of units consumed (e.g., 1000 tokens, 1 minute). Returns: int: The number of Cogfy credits consumed for the given usage. ``` -------------------------------- ### Get JSON content Tool Source: https://docs.cogfy.com/tools/getJsonContent Retrieves specific content from a JSON object using a provided key. This tool is essential for parsing and extracting data from JSON structures within the Cogfy platform. ```APIDOC Tool: Get JSON content Description: Retrieves content from a JSON object based on the provided key. Inputs: - JSON: The JSON object from which to retrieve content. This input is required. - Key: The specific key within the JSON object to extract the value for. (Implicitly required for functionality) Outputs: - The value associated with the provided key in the JSON object. Example Usage: (Conceptual - actual implementation details would be in code) let jsonData = { "user": { "name": "Alice", "id": 123 } }; let userName = GetJSONContent(jsonData, "user.name"); // Assuming dot notation for nested keys // userName would be "Alice" Dependencies: - None explicitly mentioned, but relies on valid JSON input. Limitations: - Assumes the provided key exists within the JSON object. - Handling of nested keys or complex data structures might depend on implementation details not specified here. ``` -------------------------------- ### OpenAI Text Generation Models Source: https://docs.cogfy.com/cogfy-credits Pricing for OpenAI's suite of text generation models, including GPT-4 variants, GPT-3.5, and other specialized models. Pricing is based on input and output tokens. ```APIDOC OpenAI Text Generation Models: GPT-4o Series: - gpt-4o (input): $5.00 per 1,000 tokens - gpt-4o (output): $20.00 per 1,000 tokens - gpt-4o-mini (input): $0.50 per 1,000 tokens - gpt-4o-mini (output): $2.00 per 1,000 tokens - gpt-4o-2024-08-06 (input): $5.00 per 1,000 tokens - gpt-4o-2024-08-06 (output): $20.00 per 1,000 tokens - gpt-4o-2024-05-13 (input): $10.00 per 1,000 tokens - gpt-4o-2024-05-13 (output): $30.00 per 1,000 tokens - gpt-4o-mini-2024-07-18 (input): $0.50 per 1,000 tokens - gpt-4o-mini-2024-07-18 (output): $2.00 per 1,000 tokens GPT-4 Series: - gpt-4.1-mini (output): $4.00 per 1,000 tokens - gpt-4.5-preview (output): $300.00 per 1,000 tokens - gpt-4.5-preview (input): $150.00 per 1,000 tokens Other Models: - o1 (input): $30.00 per 1,000 tokens - o1 (output): $120.00 per 1,000 tokens - o1-mini (input): $3.00 per 1,000 tokens - o1-mini (output): $9.00 per 1,000 tokens - o1-2024-12-17 (input): $30.00 per 1,000 tokens - o1-2024-12-17 (output): $120.00 per 1,000 tokens - o1-preview-2024-09-12 (input): $30.00 per 1,000 tokens - o1-preview-2024-09-12 (output): $120.00 per 1,000 tokens - o1-pro (input): $300.00 per 1,000 tokens - o3-mini (input): $3.00 per 1,000 tokens - o3-mini (output): $9.00 per 1,000 tokens - gpt-3.5-turbo (input): $1.00 per 1,000 tokens - gpt-3.5-turbo (output): $3.00 per 1,000 tokens - gpt-3.5-turbo-0125 (input): $1.00 per 1,000 tokens - gpt-4o-2024-11-20 (output): $20.00 per 1,000 tokens ``` -------------------------------- ### Get Google Calendar Auth URL Source: https://docs.cogfy.com/tools/getGoogleCalendarAuthUrl Retrieves the Google authorization URL for user consent to access Google Calendar data. This is a key step in integrating Google Calendar functionality. ```APIDOC Tool: Get Google Calendar Auth URL Description: Get Google authorization URL for consent page landing. Inputs: Connection fieldfield: Specifies the connection details required to initiate the authorization flow. Usage: This tool is used to generate a URL that a user will visit to grant Cogfy permission to access their Google Calendar. Related Tools: - Get date - Get JSON content ``` -------------------------------- ### Cogfy Settings: fabSettings Configuration Source: https://docs.cogfy.com/fab Illustrates the optional `fabSettings` object within `window.cogfySettings`. This configuration allows customization of the FAB's user experience, including its default state, tooltip message, timer, and icon. ```json { "defaultOpen": "open", "tooltipMessage": "Hello! How may I help you?", "tooltipTimer": 5000, "iconUrl": "https://ibb.co/v4PXM3C" } ``` -------------------------------- ### CloudAMQP Get Instance Info by ID Source: https://docs.cogfy.com/tools/cloudamqp/getInstanceInfoById Retrieves detailed information about a specific CloudAMQP instance using its unique identifier. This operation is part of the CloudAMQP toolset within Cogfy. ```APIDOC Tool: CloudAMQP Operation: Get instance info by id Description: Get information about a CloudAMQP instance by id. Inputs: - Cloud AMQP (cloudamqp): Required - Type: object - Description: Represents the CloudAMQP service configuration. - Instance ID (text): Required - Type: string - Description: The unique identifier for the CloudAMQP instance. Example Usage: // Assuming 'cloudamqp' is a configured CloudAMQP service object // and 'instanceId' is the ID of the instance you want to query. const instanceInfo = await cogfy.tools.cloudamqp.getInstanceInfoById(cloudamqp, instanceId); console.log(instanceInfo); Related Operations: - Get instance info: Retrieves a list of all CloudAMQP instances. ``` -------------------------------- ### OpenAI Image Generation Models Source: https://docs.cogfy.com/cogfy-credits Pricing details for OpenAI's DALL-E image generation models, specifying costs based on image size and quality. ```APIDOC OpenAI Image Generation Models: DALL-E 3: - dall-e-3 (size: 1024x1792, quality: standard): $160.00 per 1 image - dall-e-3 (size: 1024x1024, quality: hd): $160.00 per 1 image - dall-e-3 (size: 1024x1792, quality: hd): $240.00 per 1 image - dall-e-3 (size: 1024x1024, quality: standard): $80.00 per 1 image DALL-E 2: - dall-e-2 (size: 256x256): $32.00 per 1 image - dall-e-2 (size: 512x512): $36.00 per 1 image - dall-e-2 (size: 1024x1024): $40.00 per 1 image ``` -------------------------------- ### Infosimples Get CRMV Status Operation Source: https://docs.cogfy.com/operations/infosimples/getCrmvStatus Retrieves the status of a CRMV (Cadastro de Registro de Veículo Automotor) from Infosimples. This operation requires specific identification details for the entity. ```APIDOC Operation: Get CRMV Status Description: Get the status of a CRMV. Inputs: - Infosimples (Required): Specifies the integration service. - CRMV (Required, text): The CRMV identifier. - UF (Required, text): The state (Unidade Federativa) abbreviation. - Inscrição (Required, text): The registration number. - Options: - Pessoa Física (0) - Pessoa Jurídica (1) Output: - text: The status of the CRMV. ``` -------------------------------- ### CloudAMQP Get Instance Info Operation Source: https://docs.cogfy.com/operations/cloudamqp/listInstances Retrieves detailed information about a specific CloudAMQP instance. This operation is crucial for monitoring and managing your CloudAMQP resources within the Cogfy platform. ```APIDOC Operation: Get instance info Service: CloudAMQP Description: Get information about an instance. Inputs: - CloudAMQPcloudamqp: Required. Specifies the CloudAMQP service configuration. Output: - text: Returns the instance information in text format. ``` -------------------------------- ### Define and Use a Tool with Parameters in Cogfy Chat Engine Source: https://docs.cogfy.com/tools This example demonstrates how to define a custom tool named 'calculateSum' within the Cogfy Chat Engine. It specifies parameters 'a' and 'b' for numerical input and provides a method to calculate their sum, returning the result to the chat. The snippet also shows how to build the engine and run a user message that triggers this tool. ```javascript import { ChatEngineBuilder } from '@indigohive/cogfy-chat-engine' const app = new ChatEngineBuilder() .instructions({ instructions: 'You are a helpful assistant' }) .tool({ name: 'calculateSum', description: 'Calculate the sum of two numbers', parameters: { type: 'object', properties: { a: { type: 'number' }, b: { type: 'number' } }, required: ['a', 'b'] }, method: async (ctx, args) => { const sum = args.a + args.b return { content: `The sum is ${sum}` } } }) .build() ;(async function main () { const result = await app.run({ messages: [ { role: 'user', content: 'Calculate the sum of 5 and 3' } ] }) console.log(result.messages) console.log(JSON.stringify(result.trace, null, 2)) })() ``` -------------------------------- ### Cogfy Settings: chatSettings Configuration Source: https://docs.cogfy.com/fab Provides an example of the required `chatSettings` object within `window.cogfySettings`. It details the structure for `collectionId`, `createChatCommand` (including `fieldId`, `recordId`, `properties`, `messages`), and `assistantProperties`. ```json { "collectionId": "06e80e6f-b23c-405f-9581-265498801b6b", "createChatCommand": { "fieldId": "ceffc175-a630-4a3c-a573-85d741d8a173", "recordId": "bf8bd861-d813-487e-bdb8-84fdcba0366f", "properties": { "85a00a5d-56fa-4891-bd40-ac2e1e533207": { "type": "text", "text": { "value": "Text value" } } }, "messages": [ { "role": "assistant", "content": "Hello! How may I help you?" }, { "role": "user", "content": "What is Bhaskara equation used for?" } ] }, "assistantProperties": { "name": "Cogfy", "avatarUrl": "https://ibb.co/v4PXM3C" } } ``` -------------------------------- ### Typesense: Get Document Operation Source: https://docs.cogfy.com/operations/typesense/getDocument Retrieves a specific document from a designated collection within Typesense. This operation requires the collection name and the unique identifier of the document to be fetched. The output is returned in JSON format. ```APIDOC Operation: Get document Description: Get a document from a collection in Typesense Inputs: Typesense Collection: text (Required) Document ID: text (Required) Output: json ``` -------------------------------- ### Lemonfox AI Model Pricing Source: https://docs.cogfy.com/cogfy-credits Details on Lemonfox's AI models, including pricing for audio transcription and text-to-speech services. ```APIDOC Lemonfox Models: Audio Transcription (Per Minute): - whisper-1 (): $6.00 per 1 minute Text-to-Speech (Per 1,000 Characters): - tts-1 (): $5.00 per 1,000 characters ``` -------------------------------- ### CloudAMQP Operations Source: https://docs.cogfy.com/operations/cloudamqp Provides access to CloudAMQP instance information and management. Includes methods to retrieve details about specific instances and lists of all available instances. ```APIDOC Operation: Get CloudAMQP Instance Info Path: /operations/cloudamqp/getInstanceInfo Description: Retrieves detailed information for a specific CloudAMQP instance. Operation: List CloudAMQP Instances Path: /operations/cloudamqp/listInstances Description: Retrieves a list of all available CloudAMQP instances. ``` -------------------------------- ### Get CRO Status - Infosimples API Source: https://docs.cogfy.com/operations/infosimples/getCroStatus Retrieves the status of a CRO (Cadastro de Relações Operacionais) from the Infosimples service. This operation requires the CRO identifier and the UF (Unidade Federativa) to fetch the status. The output is a text string indicating the status. ```APIDOC Operation: Get CRO status Description: Get the status of a CRO Inputs: Infosimples: CRO: text (Required) UF: text (Required) Output: text (Required) ``` -------------------------------- ### OpenAI Create Chat Completion API Source: https://docs.cogfy.com/operations/openai/createChatCompletion API documentation for generating a chat completion response using OpenAI models via the Cogfy platform. It details the necessary inputs, available model options, and output structure. ```APIDOC OpenAI: Create Chat Completion: Description: Generate a response for a given chat input using the AI model. Inputs: OpenAIopenaiRequired: The OpenAI service identifier. ModeltextRequired: The specific OpenAI model to use. Options: + gpt-4o + gpt-4o-mini + gpt-4.1 + gpt-4.1-mini + gpt-4.1-nano + o1-mini + o3-mini MessagesjsonRequired: An array of message objects representing the chat history. Temperaturenumber: Controls randomness. Lower values make output more focused and deterministic (e.g., 0.7). Top Pnumber: An alternative to sampling with temperature, called nucleus sampling. The model considers only tokens comprising the top P probability mass. (e.g., 1). Max completion tokensnumber: The maximum number of tokens to generate in the completion. Toolsjson: A list of tools the model may call. Tool choicejson: Controls which tool the model is allowed to use. Seed (Beta)number: If specified, our system will make a best effort to sample deterministically, such as when repeating a given temperature and top_p, and when sampling from a given context. However, the output is not guaranteed to be deterministic. Response formatjson: Controls the format of the response, e.g., JSON mode. Output: json: The generated chat completion response. ``` -------------------------------- ### Substring API Source: https://docs.cogfy.com/operations/whatsApp/sendMediaMessage Extracts a portion of a string based on start and end indices. ```APIDOC Substring: Description: Extract a part of a string. Inputs: Input String: text (Required) Start Index: integer (Required) End Index: integer (Required) Output: text (Substring) ```