localclient

package
v0.1.2-alpha Latest Latest
Warning

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

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

Documentation

Overview

Package localclient provides a client for local LLMs.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyResponse = errors.New("empty response")

ErrEmptyResponse is returned when the OpenAI API returns an empty response.

Functions

This section is empty.

Types

type Client

type Client struct {
	BinPath      string
	Args         []string
	GlobalAsArgs bool
}

Client is a client for a local LLM.

func New

func New(binPath string, globalAsArgs bool, args ...string) (*Client, error)

New returns a new local client.

func (*Client) CreateCompletion

func (c *Client) CreateCompletion(ctx context.Context, r *CompletionRequest) (*Completion, error)

CreateCompletion creates a completion.

type Completion

type Completion struct {
	Text string `json:"text"`
}

Completion is a completion.

type CompletionRequest

type CompletionRequest struct {
	Prompt string `json:"prompt"`
}

CompletionRequest is a request to create a completion.

Jump to

Keyboard shortcuts

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