Blueprints

Send a prompt to OpenAI's ChatCompletion API

Source

yaml
id: openai
namespace: company.team

tasks:
  - id: prompt
    type: io.kestra.plugin.openai.ChatCompletion
    apiKey: "{{ secret('OPENAI_API_KEY') }}"
    model: gpt-4
    prompt: Explain in one sentence why data engineers build data pipelines

  - id: use_output
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.prompt.choices | jq('.[].message.content') | first }}"

About this blueprint

AI

This flow will send a prompt to OpenAI. You can select the desired model and additional configuration such as temperature. The next task shows how you can retrieve the message content from the API response.

Chat Completion

Log

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra