ChatCompletion
yaml
type: "io.kestra.plugin.perplexity.chatcompletion"
Examples
yaml
id: perplexity_chat
namespace: company.team
tasks:
- id: ask_ai
type: io.kestra.plugin.perplexity.ChatCompletion
apiKey: '{{ secret("PERPLEXITY_API_KEY") }}'
model: sonar
messages:
- type: USER
content: "What is Kestra?"
temperature: 0.7
yaml
id: perplexity_structured
namespace: company.name
tasks:
- id: chat_completion_structured
type: io.kestra.plugin.perplexity.ChatCompletion
apiKey: '{{ secret("PERPLEXITY_API_KEY") }}'
model: sonar
messages:
- type: USER
content: "Make a JSON todo from this casual note: schedule team check-in next week; tags: work, planning;"
jsonResponseSchema: |
{
"type": "object",
"additionalProperties": false,
"required": ["title", "done", "tags"],
"properties": {
"title": { "type": "string" },
"done": { "type": "boolean" },
"tags": { "type": "array", "items": { "type": "string" } },
"notes": { "type": "string" }
}
}
Properties
apiKey *Requiredstring
model *Requiredstring
frequencyPenalty numberstring
Default
0.0
jsonResponseSchema string
maxTokens integerstring
presencePenalty numberstring
Default
0.0
stream booleanstring
Default
false
temperature numberstring
Default
0.2
topK integerstring
Default
0
topP numberstring
Default
0.9
Outputs
outputText string
rawResponse string
Definitions
io.kestra.plugin.perplexity.ChatCompletion-ChatMessage
content string
type string
Possible Values
SYSTEM
ASSISTANT
USER