baml_go

package
v0.87.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VERSION = "0.87.2"
)

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 CallFunctionStreamFromC

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

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) error

func SetSharedLibraryPath

func SetSharedLibraryPath(path string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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