ai

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AILibraryName = "scriptling.ai"
	AILibraryDesc = "AI and LLM functions for interacting with multiple AI provider APIs"
)

Variables

This section is empty.

Functions

func GetChatStreamClass

func GetChatStreamClass() *object.Class

func GetOpenAIClientClass

func GetOpenAIClientClass() *object.Class

GetOpenAIClientClass returns the OpenAI Client class (thread-safe singleton)

func GetResponseStreamClass added in v0.2.0

func GetResponseStreamClass() *object.Class

GetResponseStreamClass returns the ResponseStream class (thread-safe singleton)

func Register

func Register(registrar interface{ RegisterLibrary(*object.Library) })

Register registers the ai library with the given registrar First call builds the library, subsequent calls just register it

func WrapClient

func WrapClient(c ai.Client) object.Object

WrapClient wraps an AI client as a scriptling Object that can be passed into a script via SetObjectVar. This allows multiple clients to be used simultaneously.

Types

type ChatStreamInstance

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

ChatStreamInstance wraps an AI chat stream for use in scriptling

type ClientInstance

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

ClientInstance wraps an AI client for use in scriptling

type ResponseStreamInstance added in v0.2.0

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

ResponseStreamInstance wraps an AI response stream for use in scriptling

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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