From 46e6327e0f85b046f5f92995d7f59146d347cd70 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Mon, 29 Jul 2024 13:35:16 -0700 Subject: [PATCH] api: add stringifier for `Tool` (#5891) --- api/types.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/types.go b/api/types.go index 35121813..ea5161ff 100644 --- a/api/types.go +++ b/api/types.go @@ -114,6 +114,11 @@ func (t Tools) String() string { return string(bts) } +func (t Tool) String() string { + bts, _ := json.Marshal(t) + return string(bts) +} + // Message is a single message in a chat sequence. The message contains the // role ("system", "user", or "assistant"), the content and an optional list // of images.