chatter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package chatter contains adapters for interacting with chat models.

Each chatter adapter should have a constructor, and configuration structure which can be directly embedded into the application's configuration, and support the common port interfaces needed by the application service layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console interface {
	GetPrompt() string
	Print(text string)
	Println(a ...string)
	Printf(format string, args ...any)
}

type Gemini

type Gemini struct {
	APIKey string
	Model  string
}

type GeminiChatter

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

func NewGeminiChatter

func NewGeminiChatter(ctx context.Context, gCfg Gemini) (*GeminiChatter, error)

func (*GeminiChatter) Close

func (c *GeminiChatter) Close() error

func (*GeminiChatter) MakeSynchronousTextQuery

func (c *GeminiChatter) MakeSynchronousTextQuery(ctx context.Context, console Console, prompt string) (string, error)

func (*GeminiChatter) Model

func (c *GeminiChatter) Model() string

type OpenAI

type OpenAI struct {
	APIKey string
	Model  string
}

type OpenAIChatter

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

func NewOpenAIChatter

func NewOpenAIChatter(cCfg OpenAI) (*OpenAIChatter, error)

func (*OpenAIChatter) Close

func (c *OpenAIChatter) Close() error

func (*OpenAIChatter) MakeSynchronousTextQuery

func (c *OpenAIChatter) MakeSynchronousTextQuery(ctx context.Context, console Console, prompt string) (string, error)

func (*OpenAIChatter) Model

func (c *OpenAIChatter) Model() string

Jump to

Keyboard shortcuts

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