hostcalls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ChatCompletionNoTools

func ChatCompletionNoTools(inv *hcommon.InvocationInfo, args interface{}) (interface{}, error)

func ChatCompletionWithTools

func ChatCompletionWithTools(inv *hcommon.InvocationInfo, args interface{}) (interface{}, error)

func Embeddings

func Embeddings(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func GetToolById

func GetToolById(task task.Task, tid hcommon.ToolId) (*hcommon.ToolRegistry, bool)

func GetToolByName

func GetToolByName(task task.Task, name string) (*hcommon.ToolRegistry, bool)

func GetToolset

func GetToolset(task task.Task, tsid hcommon.ToolsetId) (*hcommon.ToolsetRegistry, bool)

func Input

func Input(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func MessagePassingLookup

func MessagePassingLookup(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func MessagePassingRegister

func MessagePassingRegister(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func MessagePassingSend

func MessagePassingSend(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func MessagePassingUnregister

func MessagePassingUnregister(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func NewTool

func NewTool(inv *hcommon.InvocationInfo, args interface{}) (interface{}, error)

func NewToolset

func NewToolset(inv *hcommon.InvocationInfo, args interface{}) (interface{}, error)

func Record

func Record(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func Speak

func Speak(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func SpeechToText

func SpeechToText(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func TextToImage

func TextToImage(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func TextToSpeech

func TextToSpeech(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func ToolsetInstallBuiltins

func ToolsetInstallBuiltins(inv *hcommon.InvocationInfo, args interface{}) (interface{}, error)

func Transform

func Transform(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func TransformConfig

func TransformConfig(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func VectorStoreCreate

func VectorStoreCreate(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func VectorStoreDelete

func VectorStoreDelete(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func VectorStoreInsert

func VectorStoreInsert(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

func VectorStoreSearch

func VectorStoreSearch(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

Types

type ChatCompletionMemory

type ChatCompletionMemory struct {
	Messages []ChatMessage `json:"messages"`
}

func NewChatCompletionMemory

func NewChatCompletionMemory() *ChatCompletionMemory

func (*ChatCompletionMemory) AddMessage

func (m *ChatCompletionMemory) AddMessage(msg ChatMessage)

func (*ChatCompletionMemory) Clear

func (m *ChatCompletionMemory) Clear()

func (*ChatCompletionMemory) GetMessages

func (m *ChatCompletionMemory) GetMessages() []ChatMessage

type ChatMessage

type ChatMessage struct {
	Index    int                    `json:"index"`
	Metadata map[string]interface{} `json:"metadata"`
	Content  string                 `json:"content"`
}

type EmbeddingFunc

type EmbeddingFunc func(inv *hostcalls.InvocationInfo, args interface{}) (interface{}, error)

type MessagePassingRegistry

type MessagePassingRegistry struct {
	// contains filtered or unexported fields
}

type TransformRegistry

type TransformRegistry struct {
	// contains filtered or unexported fields
}

type VectorStore

type VectorStore struct {
	Name   string
	NextID uint64
}

type VectorStoreRegistry

type VectorStoreRegistry struct {
	Stores []*VectorStore
	Client *qdrant.Client
}

func NewVectorStoreRegistry

func NewVectorStoreRegistry() (*VectorStoreRegistry, error)

func (*VectorStoreRegistry) Create

func (r *VectorStoreRegistry) Create(storeName string, dimensions uint64) (int, error)

func (*VectorStoreRegistry) Delete

func (r *VectorStoreRegistry) Delete(vid int) error

func (*VectorStoreRegistry) Insert

func (r *VectorStoreRegistry) Insert(vid int, vector []float32, payload []byte) error

func (*VectorStoreRegistry) Search

func (r *VectorStoreRegistry) Search(vid int, vector []float32, limit uint64) ([]*VectorStoreSearchResult, error)

type VectorStoreSearchResult

type VectorStoreSearchResult struct {
	Vector []float32
	Data   []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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