openai

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnector

func NewConnector() (*sdk.ConnectorPlugin, error)

Types

type ChatCompletionChoiceResponse

type ChatCompletionChoiceResponse struct {
	FinishReason string                        `json:"finish_reason"`
	Index        int64                         `json:"index"`
	Message      ChatCompletionMessageResponse `json:"message"`
	Logprobs     interface{}                   `json:"logprobs"`
}

type ChatCompletionMessageResponse

type ChatCompletionMessageResponse struct {
	Content string `json:"content"`
	Role    string `json:"role"`
}

type ChatCompletionResponse

type ChatCompletionResponse struct {
	ID                string                         `json:"id"`
	Object            string                         `json:"object"`
	Created           int64                          `json:"created"`
	Model             string                         `json:"model"`
	SystemFingerprint string                         `json:"system_fingerprint"`
	Choices           []ChatCompletionChoiceResponse `json:"choices"`
	Usage             ChatCompletionUsageResponse    `json:"usage"`
}

type ChatCompletionUsageResponse

type ChatCompletionUsageResponse struct {
	CompletionTokens int64 `json:"completion_tokens"`
	PromptTokens     int64 `json:"prompt_tokens"`
	TotalTokens      int64 `json:"total_tokens"`
}

type GeneratedImageResponse

type GeneratedImageResponse struct {
	URL string `json:"url"`
}

type ImageGenerationResponse

type ImageGenerationResponse struct {
	Created int64                    `json:"created"`
	Data    []GeneratedImageResponse `json:"data"`
}

type ModelListResponse

type ModelListResponse struct {
	Object string          `json:"object"`
	Data   []ModelResponse `json:"data"`
}

type ModelResponse

type ModelResponse struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int64  `json:"created"`
	OwnedBy string `json:"owned_by"`
}

type PromptChatGPTOperation

type PromptChatGPTOperation struct {
	// contains filtered or unexported fields
}

func NewPromptChatGPT

func NewPromptChatGPT() *PromptChatGPTOperation

func (*PromptChatGPTOperation) GetInfo

func (*PromptChatGPTOperation) Run

func (*PromptChatGPTOperation) Test

type PromptChatGPTOperationInput

type PromptChatGPTOperationInput struct {
	Model            string   `json:"model"`
	Prompt           string   `json:"prompt"`
	MaxTokens        *int     `json:"max_tokens,omitempty"`
	FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` // -2.0 to 2.0
	PresencePenalty  *float64 `json:"presence_penalty,omitempty"`  // -2.0 to 2.0
	Seed             *int     `json:"seed,omitempty"`              // random integer
	Temperature      *float64 `json:"temperature,omitempty"`       // 0 to 2.0
	TopP             *float64 `json:"top_p,omitempty"`             // not said, but it's an alternative to Temperature, so probably 0 to 2.0
}

Jump to

Keyboard shortcuts

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