Remove hardcoded assistants version (#719)

This commit is contained in:
Danai Antoniou
2024-04-24 12:59:50 +01:00
committed by GitHub
parent c6a63ed19a
commit 8d15a377ec
6 changed files with 44 additions and 45 deletions

View File

@@ -51,7 +51,7 @@ type ThreadDeleteResponse struct {
// CreateThread creates a new thread.
func (c *Client) CreateThread(ctx context.Context, request ThreadRequest) (response Thread, err error) {
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(threadsSuffix), withBody(request),
withBetaAssistantV1())
withBetaAssistantVersion(c.config.AssistantVersion))
if err != nil {
return
}
@@ -64,7 +64,7 @@ func (c *Client) CreateThread(ctx context.Context, request ThreadRequest) (respo
func (c *Client) RetrieveThread(ctx context.Context, threadID string) (response Thread, err error) {
urlSuffix := threadsSuffix + "/" + threadID
req, err := c.newRequest(ctx, http.MethodGet, c.fullURL(urlSuffix),
withBetaAssistantV1())
withBetaAssistantVersion(c.config.AssistantVersion))
if err != nil {
return
}
@@ -81,7 +81,7 @@ func (c *Client) ModifyThread(
) (response Thread, err error) {
urlSuffix := threadsSuffix + "/" + threadID
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix), withBody(request),
withBetaAssistantV1())
withBetaAssistantVersion(c.config.AssistantVersion))
if err != nil {
return
}
@@ -97,7 +97,7 @@ func (c *Client) DeleteThread(
) (response ThreadDeleteResponse, err error) {
urlSuffix := threadsSuffix + "/" + threadID
req, err := c.newRequest(ctx, http.MethodDelete, c.fullURL(urlSuffix),
withBetaAssistantV1())
withBetaAssistantVersion(c.config.AssistantVersion))
if err != nil {
return
}