mistralai

package module
v0.0.0-...-91169ee Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 7 Imported by: 0

README

Mistralai

A simple to use MISTRAL AI client for interacting with Mistralai API

Prerequisite

Make sure you have Golang installed and make sure to have a ".env" file in the project directory after cloning. the file content should look like this:

ENDPOINT=https://api.mistral.ai/v1/chat/completions
API_KEY=Your Key
MODEL=mistral-tiny
ROLE=user

change the value of the API_KEY from "Your key" to your actual misralai API Key. you can change the value of other element in the file but not must, only if you want to

Install and RUN

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(fileName string)

func Request

func Request(msg string)

Types

type ResponseChoices

type ResponseChoices struct {
	FinishReason string
	Index        int
	Message      ResponseMessage
}

type ResponseData

type ResponseData struct {
	ID      string
	Object  string
	Created float64
	Model   string
	Choices []ResponseChoices
	Usage   map[string]interface{}
}

type ResponseMessage

type ResponseMessage struct {
	Content string
	Role    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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