mclient

package
v0.0.0-...-ef5b5f7 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultModelRequestsPattern

func GetDefaultModelRequestsPattern() []commons.ModelRequest

func GetFastModelRequestsPattern

func GetFastModelRequestsPattern() []commons.ModelRequest

Types

type Mistral

type Mistral struct {
	*mistral.ClientWithResponses
}

func (*Mistral) Ask

func (mc *Mistral) Ask(ctx context.Context, question string, model string) (string, error)

func (*Mistral) AskWithContext

func (mc *Mistral) AskWithContext(
	ctx context.Context,
	question string,
	model string,
	formattedContext string,
) (ResponseWithContext, error)

func (*Mistral) GetFormattedContext

func (mc *Mistral) GetFormattedContext(ctx context.Context, question string) ([]models.QAPair, error)

type ModelClient

type ModelClient interface {
	// Ask отправляет запрос к модели
	Ask(ctx context.Context, question string, model string) (string, error)
	// AskWithContext отправляет запрос к модели с использованием контекста
	AskWithContext(ctx context.Context, question string, model string, formattedContext string) (ResponseWithContext, error)
	// GetFormattedContext -
	GetFormattedContext(ctx context.Context, question string) ([]models.QAPair, error)
}

func NewMistralClient

func NewMistralClient() (ModelClient, error)

type ResponseWithContext

type ResponseWithContext struct {
	Answer      string
	Context     string
	ExtraPrompt string
}

Directories

Path Synopsis
Package mistral provides primitives to interact with the openapi HTTP API.
Package mistral provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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