Documentation
¶
Index ¶
- Constants
- func AIClientFromObject(obj object.Object) mcpai.Client
- func GetChatStreamClass() *object.Class
- func GetOpenAIClientClass() *object.Class
- func GetPipelineClass() *object.Class
- func GetResponseStreamClass() *object.Class
- func Register(registrar interface{ ... }, cfg ...*netsecurity.Config)
- func WrapClient(c ai.Client) object.Object
- type ChatStreamInstance
- type ClientInstance
- type PipelineInstance
- type ResponseStreamInstance
Constants ¶
const ( AILibraryName = "scriptling.ai" AILibraryDesc = "AI and LLM functions for interacting with multiple AI provider APIs" )
Variables ¶
This section is empty.
Functions ¶
func AIClientFromObject ¶ added in v0.2.23
AIClientFromObject extracts the underlying ai.Client from a Scriptling object.Instance created by ai.Client(...). Returns nil if the object is not a valid AI client instance.
func GetChatStreamClass ¶
func GetOpenAIClientClass ¶
GetOpenAIClientClass returns the OpenAI Client class (thread-safe singleton)
func GetPipelineClass ¶ added in v0.9.0
GetPipelineClass returns the Pipeline class singleton.
func GetResponseStreamClass ¶ added in v0.2.0
GetResponseStreamClass returns the ResponseStream class (thread-safe singleton)
func Register ¶
func Register(registrar interface{ RegisterLibrary(*object.Library) }, cfg ...*netsecurity.Config)
Register registers the ai library with the given registrar. cfg is an optional outbound network policy: when provided (non-nil), every client created via ai.Client() — including its remote MCP servers — is restricted to it (an invalid policy fails closed rather than falling back to unrestricted access). Omitting cfg preserves the previous, unrestricted behaviour.
First call with no cfg builds and caches the unrestricted library; subsequent calls just register it. A call with cfg always builds a fresh, guard-bound library.
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 PipelineInstance ¶ added in v0.9.0
type PipelineInstance struct {
// contains filtered or unexported fields
}
PipelineInstance holds the state for a running pipeline. Workers are started immediately at construction and drain the queue until it is closed by flush() / complete().
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