zig-ai
FOLLGAD/zig-ai
-
OpenAI SDK with streaming support
20 20 0 0
3
openai, zig, zig-package
build.zig.zon
build.zig
View on Github
FOLLGAD/zig-ai
OpenAI SDK with streaming support
A simple OpenAI API client for Zig with streaming support.
Find examples in the examples
directory.
$ zig fetch --save git+https://github.com/FOLLGAD/zig-ai
and add zig-ai
to your build.zig
file:
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "stream-cli",
.root_source_file = b.path("examples/stream-cli.zig"),
.target = target,
.optimize = optimize,
});
const module = b.dependency("zig-ai", .{
.root_source_file = b.path("src/llm.zig"),
});
exe.root_module.addImport("zig-ai", module.module("zig-ai"));
}
See the examples
directory for usage examples.