diff options
| author | t <t@tjp.lol> | 2026-07-07 11:29:23 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-07 12:15:28 -0600 |
| commit | 621d7fee0ace729f8d44126032d2c6e13f72ee7f (patch) | |
| tree | a2938b0a9e5c0930e8644721abbe94875df9ff08 /libpanto-go/README.md | |
| parent | 0fa6d4209ff9b4a95e7d1955887aa4c73ee3423c (diff) | |
Remove the in-repo libpanto sources and binding projects from pantograph.
Consume libpantograph through the Zig package URL at
code.tjp.lol/libpantograph.git, including the Lua module artifact used by
CLI extensions.
Diffstat (limited to 'libpanto-go/README.md')
| -rw-r--r-- | libpanto-go/README.md | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/libpanto-go/README.md b/libpanto-go/README.md deleted file mode 100644 index 063f800..0000000 --- a/libpanto-go/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# libpanto-go - -Idiomatic Go bindings for `libpanto-c` via cgo. - -## Build - -Build the C ABI first: - -```sh -cd ../libpanto-c -zig build -``` - -Then use the Go package from this directory: - -```sh -go test ./... -``` - -At runtime, make sure `../libpanto-c/zig-out/lib` (or the installed equivalent) is on your platform's dynamic library path. - -## Example - -```go -panto.Init() -defer panto.Deinit() - -agent, err := panto.NewAgent(panto.Config{ - Provider: panto.ProviderConfig{ - OpenAIChat: &panto.OpenAIChatConfig{ - APIKey: os.Getenv("OPENAI_API_KEY"), - BaseURL: "https://api.openai.com/v1", - Model: "gpt-4.1-mini", - }, - }, -}) -if err != nil { /* handle */ } -defer agent.Close() - -stream, err := agent.Run(panto.UserMessage(panto.TextBlock("hello"))) -if err != nil { /* handle */ } -defer stream.Close() - -for ev := range stream.Iter() { - // ev is an Event interface; type-switch on the concrete event, or branch - // on ev.EventType(). Breaking out of the loop is safe: the session store - // is current at every step. - switch ev := ev.(type) { - case panto.ContentDeltaEvent: - fmt.Print(ev.Delta) - case panto.MessageCompleteEvent: - // full message at agent.Conversation().Message(ev.MessageIndex) - } -} -if err := stream.Err(); err != nil { /* handle */ } -``` |
