Akcje OpenAI

Przykład: Chatbot AI

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

Wyślij tekstowy prompt do modelu OpenAI i otrzymaj odpowiedź.

Wejścia

WejścieTypOpis
modelstringNazwa modelu (domyślnie: gpt-3.5-turbo). Opcje: gpt-4, gpt-4o, gpt-3.5-turbo
instructionsstringPrompt systemowy określający zachowanie AI
inputstringWiadomość lub prompt użytkownika

Wyjścia

WyjścieTypOpis
responseTextstringOdpowiedź wygenerowana przez AI
usagejsonZużycie tokenów: {"prompt_tokens": N, "completion_tokens": N, "total_tokens": N}

Przykładowe zastosowania

  • Bot echo z AI: Przeciągnij wiadomość Telegram → input, odeślij responseText z powrotem
  • Podsumowywacz: Ustaw instructions na "Summarize the following text", przeciągnij treść → input
  • Tłumacz: "Translate to English" jako instructions
  • Ekstraktor danych: "Extract name, email, phone from this text. Return as JSON"