Skip to content

Commit

Permalink
add beta header to msg calls now that sashabaranov#545 is merged
Browse files Browse the repository at this point in the history
  • Loading branch information
urjitbhatia committed Nov 8, 2023
1 parent 46f7798 commit 17673a1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (c *Client) ListMessage(ctx context.Context, threadID string,
}

urlSuffix := fmt.Sprintf("/threads/%s%s%s", threadID, messagesSuffix, encodedValues)
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix))
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix), withBetaAssistantV1())
if err != nil {
return
}
Expand All @@ -116,7 +116,7 @@ func (c *Client) RetrieveMessage(
threadID, messageID string,
) (msg Message, err error) {
urlSuffix := fmt.Sprintf("/threads/%s%s/%s", threadID, messagesSuffix, messageID)
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix))
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix), withBetaAssistantV1())
if err != nil {
return
}
Expand All @@ -132,7 +132,8 @@ func (c *Client) ModifyMessage(
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), withBody(metadata))
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix),
withBody(metadata), withBetaAssistantV1())
if err != nil {
return
}
Expand All @@ -147,7 +148,7 @@ func (c *Client) RetrieveMessageFile(
threadID, messageID, fileID string,
) (file MessageFile, err error) {
urlSuffix := fmt.Sprintf("/threads/%s%s/%s/files/%s", threadID, messagesSuffix, messageID, fileID)
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix))
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix), withBetaAssistantV1())
if err != nil {
return
}
Expand All @@ -162,7 +163,7 @@ func (c *Client) ListMessageFiles(
threadID, messageID string,
) (files MessageFilesList, err error) {
urlSuffix := fmt.Sprintf("/threads/%s%s/%s/files", threadID, messagesSuffix, messageID)
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix))
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix), withBetaAssistantV1())
if err != nil {
return
}
Expand Down

0 comments on commit 17673a1

Please sign in to comment.