openai

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOpenAiEngine

func IsOpenAiEngine(engine string) bool

Types

type ExecuteToolStep added in v0.2.24

type ExecuteToolStep struct {
	Tools map[string]interface{}
}

func (ExecuteToolStep) Start added in v0.2.24

func (e ExecuteToolStep) Start(
	ctx context.Context,
	input ToolCompletionResponse,
) (steps.StepResult[map[string]interface{}], error)

type Step

type Step struct {
	Settings *settings.StepSettings
	// contains filtered or unexported fields
}

func NewStep added in v0.2.24

func NewStep(settings *settings.StepSettings) *Step

func (*Step) Interrupt added in v0.2.24

func (csf *Step) Interrupt()

func (*Step) Publish added in v0.2.24

func (csf *Step) Publish(publisher message.Publisher, topic string) error

func (*Step) Start

func (csf *Step) Start(
	ctx context.Context,
	messages []*geppetto_context.Message,
) (steps.StepResult[string], error)

type ToolCallMerger added in v0.2.24

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

func NewToolCallMerger added in v0.2.24

func NewToolCallMerger() *ToolCallMerger

func (*ToolCallMerger) AddToolCalls added in v0.2.24

func (tcm *ToolCallMerger) AddToolCalls(toolCalls []go_openai.ToolCall)

func (*ToolCallMerger) GetToolCalls added in v0.2.24

func (tcm *ToolCallMerger) GetToolCalls() []go_openai.ToolCall

type ToolCompletionResponse added in v0.2.24

type ToolCompletionResponse struct {
	Role      string               `json:"role"`
	Content   string               `json:"content"`
	ToolCalls []go_openai.ToolCall `json:"tool_calls"`
}

type ToolStep added in v0.2.24

type ToolStep struct {
	Settings *settings.StepSettings
	Tools    []go_openai.Tool
}

func (*ToolStep) SetStreaming added in v0.2.24

func (csf *ToolStep) SetStreaming(b bool)

func (*ToolStep) Start added in v0.2.24

type Transcription added in v0.2.18

type Transcription struct {
	File     string                `json:"file"`
	Response *openai.AudioResponse `json:"response"`
	// contains filtered or unexported fields
}

type TranscriptionClient added in v0.2.18

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

func NewTranscriptionClient added in v0.2.18

func NewTranscriptionClient(apiKey, model, prompt, language string, temperature float32) *TranscriptionClient

func (*TranscriptionClient) TranscribeFile added in v0.2.18

func (tc *TranscriptionClient) TranscribeFile(mp3FilePath string, out chan<- Transcription, wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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