api: add stringifier for Tool (#5891)

This commit is contained in:
Jeffrey Morgan 2024-07-29 13:35:16 -07:00 committed by GitHub
parent 68ee42f995
commit 46e6327e0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,6 +114,11 @@ func (t Tools) String() string {
return string(bts) 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 // Message is a single message in a chat sequence. The message contains the
// role ("system", "user", or "assistant"), the content and an optional list // role ("system", "user", or "assistant"), the content and an optional list
// of images. // of images.