minds

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDatasourceRequest

type AddDatasourceRequest struct {
	Name            string `json:"name"`
	CheckConnection bool   `json:"check_connection"`
}

type ChatCompletionRequest

type ChatCompletionRequest struct {
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
	Stream   bool      `json:"stream"`
}

type ChatCompletionResponse

type ChatCompletionResponse struct {
	ID      string         `json:"id"`
	Object  string         `json:"object"`
	Created int64          `json:"created"`
	Model   string         `json:"model"`
	Choices []StreamChoice `json:"choices"`
}

type CreateRequest

type CreateRequest struct {
	Name            string   `json:"name"`
	DatasourceNames []string `json:"datasources"`
}

type Message

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

type MessageDelta

type MessageDelta struct {
	Role    string `json:"role,omitempty"`
	Content string `json:"content,omitempty"`
}

type Minds

type Minds struct {
	Config *restapi.RestAPI
}

func NewMinds

func NewMinds(api *restapi.RestAPI) *Minds

func (*Minds) AddDatasource

func (md *Minds) AddDatasource(name string, Datasource datasource.DatabaseConfig, checkConnection bool) error

func (*Minds) Completion

func (md *Minds) Completion(model, message string, stream bool) (string, <-chan string, error)

func (*Minds) Create

func (md *Minds) Create(name string, Datasources []datasource.DatabaseConfig) (string, error)

func (*Minds) Delete

func (md *Minds) Delete(name string) error

func (*Minds) Get

func (md *Minds) Get(name string) (*ResponseMind, error)

func (*Minds) List

func (md *Minds) List() ([]ResponseMind, error)

func (*Minds) Update

func (md *Minds) Update(Oldname, newName string, Datasources []datasource.DatabaseConfig) (string, error)

type ResponseMind

type ResponseMind struct {
	CreatedAt  string            `json:"created_at"`
	DsNames    []string          `json:"datasources"`
	ModelName  string            `json:"model_name"`
	Name       string            `json:"name"`
	Parameters map[string]string `json:"parameters"`
	Provider   string            `json:"provider"`
	UpdatedAt  string            `json:"updated_at"`
}

type StreamChoice

type StreamChoice struct {
	Delta MessageDelta `json:"delta"`
	Index int          `json:"index"`
}

Jump to

Keyboard shortcuts

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