[BREAKING_CHANGES] Fix update message payload (#699)
* add custom marshaller, documentation and isolate tests * fix linter * wrap payload as expected from the API and update test * modify input to accept map[string]string only
This commit is contained in:
@@ -139,11 +139,11 @@ func (c *Client) RetrieveMessage(
|
||||
func (c *Client) ModifyMessage(
|
||||
ctx context.Context,
|
||||
threadID, messageID string,
|
||||
metadata map[string]any,
|
||||
metadata map[string]string,
|
||||
) (msg Message, err error) {
|
||||
urlSuffix := fmt.Sprintf("/threads/%s/%s/%s", threadID, messagesSuffix, messageID)
|
||||
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix),
|
||||
withBody(metadata), withBetaAssistantV1())
|
||||
withBody(map[string]any{"metadata": metadata}), withBetaAssistantV1())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user