From d7ea9b7ce603f7767b5e20ca43e2c1fc8e7f1838 Mon Sep 17 00:00:00 2001 From: John Wilger Date: Thu, 15 Feb 2024 15:56:26 -0800 Subject: [PATCH] Update typespecs to allow for empty maps Because messages don't always have metadata, and functions are not always called with arguments. --- lib/gpt_agent/types.ex | 4 ++-- mix.exs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gpt_agent/types.ex b/lib/gpt_agent/types.ex index 6efb13a..cb13cda 100644 --- a/lib/gpt_agent/types.ex +++ b/lib/gpt_agent/types.ex @@ -18,13 +18,13 @@ defmodule GptAgent.Types do @type thread_id() :: nonblank_string() @type file_id() :: nonblank_string() - @type message_metadata() :: %{String.t() => Jason.Encoder.t()} + @type message_metadata() :: %{optional(String.t()) => Jason.Encoder.t()} precond message_metadata: &validate_message_metadata/1 @type tool_output() :: nonblank_string() @type tool_name() :: nonblank_string() @type tool_call_id() :: nonblank_string() - @type tool_arguments() :: %{String.t() => Jason.Encoder.t()} + @type tool_arguments() :: %{optional(String.t()) => Jason.Encoder.t()} @type success() :: :ok @type success(t) :: {:ok, t} diff --git a/mix.exs b/mix.exs index 4d2a7ae..3f11a99 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule GptAgent.MixProject do def project do [ app: :gpt_agent, - version: "7.0.0", + version: "7.0.1", elixir: "~> 1.16", start_permanent: Mix.env() == :prod, aliases: aliases(),