From 37e834c02e623c9400bf25792ce97c7ff168c0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C4=B1l=20M=C4=B1s=C4=B1rl=C4=B1o=C4=9Flu?= Date: Wed, 26 Feb 2025 02:10:22 +0300 Subject: [PATCH] refactor: change metadata type from map[string]string to map[string]any --- chat.go | 2 +- messages.go | 2 +- messages_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chat.go b/chat.go index 995860c40..3a79b8900 100644 --- a/chat.go +++ b/chat.go @@ -262,7 +262,7 @@ type ChatCompletionRequest struct { // Controls effort on reasoning for reasoning models. It can be set to "low", "medium", or "high". ReasoningEffort string `json:"reasoning_effort,omitempty"` // Metadata to store with the completion. - Metadata map[string]string `json:"metadata,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` } type StreamOptions struct { diff --git a/messages.go b/messages.go index 3852d2e37..31844ef82 100644 --- a/messages.go +++ b/messages.go @@ -162,7 +162,7 @@ func (c *Client) RetrieveMessage( func (c *Client) ModifyMessage( ctx context.Context, threadID, messageID string, - metadata map[string]string, + metadata map[string]any, ) (msg Message, err error) { urlSuffix := fmt.Sprintf("/threads/%s/%s/%s", threadID, messagesSuffix, messageID) req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix), diff --git a/messages_test.go b/messages_test.go index b25755f98..3abc58718 100644 --- a/messages_test.go +++ b/messages_test.go @@ -233,7 +233,7 @@ func TestMessages(t *testing.T) { } msg, err = client.ModifyMessage(ctx, threadID, messageID, - map[string]string{ + map[string]any{ "foo": "bar", }) checks.NoError(t, err, "ModifyMessage error")