OpenAI Actions

Example: AI Chat Bot

AI Chat Bot

Bot responds using OpenAI GPT

Telegram Bot

Bot Update

message
userID

OpenAI

Send Prompt

model
gpt-4
instructions
You are a helpful assistant
input
message
responseText

Telegram Bot

Send Message

chatId
userID
text
responseText

Send Prompt to OpenAI

Send a text prompt to an OpenAI model and receive a response.

Inputs

InputTypeDescription
modelstringModel name (default: gpt-3.5-turbo). Options: gpt-4, gpt-4o, gpt-3.5-turbo
instructionsstringSystem prompt that sets the AI's behavior
inputstringThe user's message or prompt

Outputs

OutputTypeDescription
responseTextstringThe AI-generated response
usagejsonToken usage: {"prompt_tokens": N, "completion_tokens": N, "total_tokens": N}

Example Use Cases

  • Echo bot with AI: Drag Telegram message → input, send responseText back
  • Summarizer: Set instructions to "Summarize the following text", drag content → input
  • Translator: "Translate to English" as instructions
  • Data extractor: "Extract name, email, phone from this text. Return as JSON"