From 7775275046c956e8458921405ac257deeda86747 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Thu, 19 Feb 2026 14:53:40 -0300 Subject: Add function definition for file reading and create shell environment setup --- shell.nix | 15 +++++++++++++++ src/main.zig | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 shell.nix 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 {} }: + +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(); -- cgit v1.2.3