summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell.nix15
-rw-r--r--src/main.zig35
2 files changed, 50 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..aff439f
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,15 @@
+{ pkgs ? import <nixpkgs> {} }:
+
+pkgs.mkShell {
+ buildInputs = with pkgs; [
+ zig_0_15 # Zig 0.15.2
+ curl # HTTP requests / debugging
+ jq # JSON pretty-printing / debugging
+ git # Version control
+ zls # Zig Language Server (LSP)
+ ];
+
+ shellHook = ''
+ echo "Zig $(zig version) ready"
+ '';
+}
diff --git a/src/main.zig b/src/main.zig
index 7f7c16a..89c0bc4 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -32,6 +32,41 @@ pub fn main() !void {
.messages = &[_]struct { role: []const u8, content: []const u8 }{
.{ .role = "user", .content = prompt_str },
},
+ .tools = &[_]struct {
+ type: []const u8,
+ function: struct {
+ name: []const u8,
+ description: []const u8,
+ parameters: struct {
+ type: []const u8,
+ properties: struct {
+ file_path: struct {
+ type: []const u8,
+ description: []const u8,
+ },
+ },
+ required: []const []const u8,
+ },
+ },
+ }{
+ .{
+ .type = "function",
+ .function = .{
+ .name = "Read",
+ .description = "Read and return the contents of a file",
+ .parameters = .{
+ .type = "object",
+ .properties = .{
+ .file_path = .{
+ .type = "string",
+ .description = "The path to the file to read",
+ },
+ },
+ .required = &[_][]const u8{"file_path"},
+ },
+ },
+ },
+ },
});
const body = body_out.written();