llm

package
v0.0.0-...-f03bf9e Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLM

type LLM interface {
	GetUserModel() string
	GetSystemModel() string
	GetAssistantModel() string

	// Completion chat with llm just once
	Completion(ctx context.Context, prompt prompts.PromptTemplate, parameters map[string]string) (answers []string, tokens map[string]int, err error)
	/*
		Chat: chat with llm with history.
		 history example: [
			  {"role": "user", "content": "Hello robot!"}
			  {"role": "assistant", "content": "Hello"}
			  {"role": "user", "content": "When is today?"}
			  {"role": "assistant", "content": "Today is Monday"}
		 ]
	*/
	Chat(ctx context.Context, stream bool, history []map[string]string, answers chan<- map[string]string) (tokens map[string]int, err error)
}

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

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