Skip to content

Commit

Permalink
Update typespecs to allow for empty maps
Browse files Browse the repository at this point in the history
Because messages don't always have metadata, and functions are not
always called with arguments.
  • Loading branch information
jwilger committed Feb 15, 2024
1 parent 661edd6 commit d7ea9b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/gpt_agent/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit d7ea9b7

Please sign in to comment.