chat

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractQuery

func ExtractQuery(resp string) (string, error)

Types

type Client

type Client interface {
	Ask(ctx context.Context, messages []Message) (string, error)
}

type GeminiClient

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

func NewGeminiClient

func NewGeminiClient(model string) (*GeminiClient, error)

func (*GeminiClient) Ask

func (c *GeminiClient) Ask(ctx context.Context, messages []Message) (string, error)

type Message

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

type OpenAIClient

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

func NewOpenAIClient

func NewOpenAIClient(model string) (*OpenAIClient, error)

func (*OpenAIClient) Ask

func (c *OpenAIClient) Ask(ctx context.Context, messages []Message) (string, error)

type Service

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

func NewService

func NewService(model string) (*Service, error)

func (*Service) Ask

func (s *Service) Ask(ctx context.Context, messages []Message, queryMode bool) (string, error)

Jump to

Keyboard shortcuts

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