llm

package
v0.0.0-...-de2ca29 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelClaude_3_Haiku    = Model(anthropic.ModelClaude_3_Haiku_20240307)
	ModelClaude_3_5_Sonnet = Model(anthropic.ModelClaude3_5SonnetLatest)
)
View Source
const (
	MessageRoleSystem    = MessageRole(openai.ChatMessageRoleSystem)
	MessageRoleUser      = MessageRole(openai.ChatMessageRoleUser)
	MessageRoleAssistant = MessageRole(openai.ChatMessageRoleAssistant)
	MessageRoleFunction  = MessageRole(openai.ChatMessageRoleFunction)
	MessageRoleTool      = MessageRole(openai.ChatMessageRoleTool)
)
View Source
const (
	ModelLlama3_2_1B = Model("llama3.2-1b")
	ModelLlama3_2_3B = Model("llama3.2-3b")
	ModelGPT4o       = Model(openai.GPT4o)
)
View Source
const (
	ModelGemini_1_5_Flash = Model("gemini-1.5-flash")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnthropicClient

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

func NewAnthropicClient

func NewAnthropicClient(opts NewAnthropicClientOptions) *AnthropicClient

func (*AnthropicClient) Prompt

func (c *AnthropicClient) Prompt(ctx context.Context, system string, messages []Message, w io.Writer) error

type GoogleClient

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

func NewGoogleClient

func NewGoogleClient(opts NewGoogleClientOptions) *GoogleClient

func (*GoogleClient) Prompt

func (c *GoogleClient) Prompt(ctx context.Context, system string, messages []Message, w io.Writer) error

type Message

type Message struct {
	Content string
	Name    string
	Role    MessageRole
}

type MessageRole

type MessageRole string

type Model

type Model string

func (Model) String

func (m Model) String() string

type NewAnthropicClientOptions

type NewAnthropicClientOptions struct {
	Log   *snorkel.Logger
	Model Model
	Token string
}

type NewGoogleClientOptions

type NewGoogleClientOptions struct {
	Log   *snorkel.Logger
	Model Model
	Token string
}

type NewOpenAIClientOptions

type NewOpenAIClientOptions struct {
	BaseURL string
	Log     *snorkel.Logger
	Model   Model
	Token   string
}

type OpenAIClient

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

func NewOpenAIClient

func NewOpenAIClient(opts NewOpenAIClientOptions) *OpenAIClient

func (*OpenAIClient) Prompt

func (c *OpenAIClient) Prompt(ctx context.Context, system string, messages []Message, w io.Writer) error

Jump to

Keyboard shortcuts

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