Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
Model encapsulates an instantiated Mistral client, the client options used to instantiate the client, and a callback handler provided by Langchain Go.
func (*Model) Call ¶
func (m *Model) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error)
Call implements the langchaingo llms.Model interface.
func (*Model) GenerateContent ¶
func (m *Model) GenerateContent(ctx context.Context, langchainMessages []llms.MessageContent, options ...llms.CallOption) (*llms.ContentResponse, error)
GenerateContent implements the langchaingo llms.Model interface.
type Option ¶
type Option func(*clientOptions)
func WithAPIKey ¶
Passes the API Key (token) to the Mistral client. Defaults to os.getEnv("MISTRAL_API_KEY").
func WithCallbacksHandler ¶
Sets the Langchain callbacks handler to use for the Model being instantiated. Defaults to callbacks.SimpleHandler.
func WithEndpoint ¶
Sets the API endpoint for the Model being instantiated, defaults to "https://api.mistral.ai" (subject to change; this default is pulled from the mistral-go client library, https://github.com/Gage-Technologies/mistral-go).
func WithMaxRetries ¶
Sets the maximum number of retries the client is permitted to perform, used in case a call to the model's API fails.
func WithModel ¶
Sets the model name for the Model being instantiated. Defaults to "open-mistral-7b". See https://docs.mistral.ai/platform/endpoints/ for a full list of supported models.
func WithTimeout ¶
Sets the timeout duration for the client. This determines how long the client will wait for a response from the model's API before timing out.