openai

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ResponsePayloadType = "openai.response"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

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

func (*Client) CreateResponse

func (c *Client) CreateResponse(model, input string) (*OpenAIResponse, 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 CreateResponse

type CreateResponse struct{}

func (*CreateResponse) Actions

func (c *CreateResponse) Actions() []core.Action

func (*CreateResponse) Cancel

func (c *CreateResponse) Cancel(ctx core.ExecutionContext) error

func (*CreateResponse) Color

func (c *CreateResponse) Color() string

func (*CreateResponse) Configuration

func (c *CreateResponse) Configuration() []configuration.Field

func (*CreateResponse) Description

func (c *CreateResponse) Description() string

func (*CreateResponse) Documentation

func (c *CreateResponse) Documentation() string

func (*CreateResponse) ExampleOutput

func (c *CreateResponse) ExampleOutput() map[string]any

func (*CreateResponse) Execute

func (c *CreateResponse) Execute(ctx core.ExecutionContext) error

func (*CreateResponse) HandleAction

func (c *CreateResponse) HandleAction(ctx core.ActionContext) error

func (*CreateResponse) HandleWebhook

func (c *CreateResponse) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*CreateResponse) Icon

func (c *CreateResponse) Icon() string

func (*CreateResponse) Label

func (c *CreateResponse) Label() string

func (*CreateResponse) Name

func (c *CreateResponse) Name() string

func (*CreateResponse) OutputChannels

func (c *CreateResponse) OutputChannels(configuration any) []core.OutputChannel

func (*CreateResponse) ProcessQueueItem

func (c *CreateResponse) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*CreateResponse) Setup

func (c *CreateResponse) Setup(ctx core.SetupContext) error

type CreateResponseRequest

type CreateResponseRequest struct {
	Model string `json:"model"`
	Input string `json:"input"`
}

type CreateResponseSpec

type CreateResponseSpec struct {
	Model string `json:"model"`
	Input string `json:"input"`
}

type Model

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

type ModelsResponse

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

type OpenAI

type OpenAI struct{}

func (*OpenAI) CleanupWebhook

func (o *OpenAI) CleanupWebhook(ctx core.CleanupWebhookContext) error

func (*OpenAI) CompareWebhookConfig

func (o *OpenAI) CompareWebhookConfig(a, b any) (bool, error)

func (*OpenAI) Components

func (o *OpenAI) Components() []core.Component

func (*OpenAI) Configuration

func (o *OpenAI) Configuration() []configuration.Field

func (*OpenAI) Description

func (o *OpenAI) Description() string

func (*OpenAI) HandleRequest

func (o *OpenAI) HandleRequest(ctx core.HTTPRequestContext)

func (*OpenAI) Icon

func (o *OpenAI) Icon() string

func (*OpenAI) Instructions

func (o *OpenAI) Instructions() string

func (*OpenAI) Label

func (o *OpenAI) Label() string

func (*OpenAI) ListResources

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

func (*OpenAI) Name

func (o *OpenAI) Name() string

func (*OpenAI) SetupWebhook

func (o *OpenAI) SetupWebhook(ctx core.SetupWebhookContext) (any, error)

func (*OpenAI) Sync

func (o *OpenAI) Sync(ctx core.SyncContext) error

func (*OpenAI) Triggers

func (o *OpenAI) Triggers() []core.Trigger

type OpenAIResponse

type OpenAIResponse struct {
	ID         string           `json:"id"`
	Model      string           `json:"model"`
	OutputText string           `json:"output_text"`
	Output     []ResponseOutput `json:"output"`
	Usage      *ResponseUsage   `json:"usage,omitempty"`
}

type ResponseContent

type ResponseContent struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ResponseOutput

type ResponseOutput struct {
	Type    string            `json:"type"`
	Role    string            `json:"role"`
	Content []ResponseContent `json:"content"`
}

type ResponsePayload

type ResponsePayload struct {
	ID       string          `json:"id"`
	Model    string          `json:"model"`
	Text     string          `json:"text"`
	Usage    *ResponseUsage  `json:"usage,omitempty"`
	Response *OpenAIResponse `json:"response"`
}

type ResponseUsage

type ResponseUsage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
	TotalTokens  int `json:"total_tokens"`
}

Jump to

Keyboard shortcuts

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