perplexity

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AgentPayloadType = "perplexity.agent.response"

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentAnnotation

type AgentAnnotation struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

AgentAnnotation is a citation annotation in the agent response.

type AgentContent

type AgentContent struct {
	Type        string            `json:"type"`
	Text        string            `json:"text"`
	Annotations []AgentAnnotation `json:"annotations"`
}

AgentContent is a single content block in an agent output item.

type AgentCost

type AgentCost struct {
	TotalCost float64 `json:"total_cost"`
}

AgentCost holds cost information from usage.

type AgentOutput

type AgentOutput struct {
	Content []AgentContent `json:"content"`
}

AgentOutput is a single output item in the agent response.

type AgentRequest

type AgentRequest struct {
	Preset       string      `json:"preset,omitempty"`
	Model        string      `json:"model,omitempty"`
	Input        string      `json:"input"`
	Instructions string      `json:"instructions,omitempty"`
	Tools        []AgentTool `json:"tools,omitempty"`
	Temperature  float64     `json:"temperature,omitempty"`
}

AgentRequest represents the request body for POST /v1/responses.

type AgentResponse

type AgentResponse struct {
	ID     string        `json:"id"`
	Model  string        `json:"model"`
	Status string        `json:"status"`
	Output []AgentOutput `json:"output"`
	Usage  *AgentUsage   `json:"usage,omitempty"`
}

AgentResponse represents the response from POST /v1/responses.

type AgentTool

type AgentTool struct {
	Type string `json:"type"`
}

AgentTool represents a tool in an agent request.

type AgentUsage

type AgentUsage struct {
	InputTokens  int       `json:"input_tokens"`
	OutputTokens int       `json:"output_tokens"`
	TotalTokens  int       `json:"total_tokens"`
	Cost         AgentCost `json:"cost"`
}

AgentUsage holds token and cost usage from the agent response.

type Client

type Client struct {
	APIKey string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) CreateAgentResponse

func (c *Client) CreateAgentResponse(req AgentRequest) (*AgentResponse, error)

func (*Client) ListModels

func (c *Client) ListModels() ([]Model, error)

func (*Client) Verify

func (c *Client) Verify() error

type Configuration

type Configuration struct {
	APIKey string `json:"apiKey"`
}

type Model

type Model struct {
	ID      string `json:"id"`
	OwnedBy string `json:"owned_by"`
}

type ModelsResponse

type ModelsResponse struct {
	Object string  `json:"object"`
	Data   []Model `json:"data"`
}

ModelsResponse represents the response from GET /v1/models.

type Perplexity

type Perplexity struct{}

func (*Perplexity) Actions

func (p *Perplexity) Actions() []core.Action

func (*Perplexity) Cleanup

func (*Perplexity) Components

func (p *Perplexity) Components() []core.Component

func (*Perplexity) Configuration

func (p *Perplexity) Configuration() []configuration.Field

func (*Perplexity) Description

func (p *Perplexity) Description() string

func (*Perplexity) HandleAction

func (p *Perplexity) HandleAction(ctx core.IntegrationActionContext) error

func (*Perplexity) HandleRequest

func (p *Perplexity) HandleRequest(ctx core.HTTPRequestContext)

func (*Perplexity) Icon

func (p *Perplexity) Icon() string

func (*Perplexity) Instructions

func (p *Perplexity) Instructions() string

func (*Perplexity) Label

func (p *Perplexity) Label() string

func (*Perplexity) ListResources

func (p *Perplexity) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Perplexity) Name

func (p *Perplexity) Name() string

func (*Perplexity) Sync

func (p *Perplexity) Sync(ctx core.SyncContext) error

func (*Perplexity) Triggers

func (p *Perplexity) Triggers() []core.Trigger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL