baml_go

package
v0.208.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "0.208.4"
)

Variables

View Source
var (
	ErrLoadLibrary          = errors.New("baml: failed loading shared library")
	ErrNotSupportedPlatform = errors.New("baml: platform not supported (only Linux and MacOS amd64/arm64)")
	ErrDownloadFailed       = errors.New("baml: failed to download shared library")
	ErrCacheDir             = errors.New("baml: failed to determine or create cache directory")
	ErrChecksumMismatch     = errors.New("baml: downloaded library checksum mismatch")
	ErrVersionMismatch      = errors.New("baml: library version mismatch")
	ErrInitialization       = errors.New("baml: initialization failed")
)

Functions

func BamlVersion

func BamlVersion() string

func CallFunctionFromC

func CallFunctionFromC(runtime unsafe.Pointer, functionName string, encodedArgs []byte, id uint32) (unsafe.Pointer, error)

func CallFunctionParseFromC added in v0.204.0

func CallFunctionParseFromC(runtime unsafe.Pointer, functionName string, encodedArgs []byte, id uint32) (unsafe.Pointer, error)

func CallFunctionStreamFromC

func CallFunctionStreamFromC(runtime unsafe.Pointer, functionName string, encodedArgs []byte, id uint32) (unsafe.Pointer, error)

func CancelFunctionCall added in v0.206.1

func CancelFunctionCall(id uint32)

func CreateBamlRuntime

func CreateBamlRuntime(rootPath string, srcFilesJson string, envVarsJson string) (unsafe.Pointer, error)

func DestroyBamlRuntime

func DestroyBamlRuntime(runtime unsafe.Pointer) error

func GetInitError added in v0.84.2

func GetInitError() error

func InvokeRuntimeCli

func InvokeRuntimeCli(args []string) (int, error)

func NewProgressWriter added in v0.84.2

func NewProgressWriter(dest io.Writer, totalSize int64, description string) *progressWriter

func RegisterCallbacks

func RegisterCallbacks(callbackFn unsafe.Pointer, errorFn unsafe.Pointer, onTickFn unsafe.Pointer) error

func SetSharedLibraryPath

func SetSharedLibraryPath(path string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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