Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 9, 2024
1 parent 0ea9eac commit 98393d9
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 270 deletions.
44 changes: 22 additions & 22 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ func (c *Client) ChatStream(
) (*core.Stream[v2.StreamedChatResponse], error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/chat"
endpointURL := baseURL + "/v1/chat"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -187,14 +187,14 @@ func (c *Client) Chat(
) (*v2.NonStreamedChatResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/chat"
endpointURL := baseURL + "/v1/chat"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -318,14 +318,14 @@ func (c *Client) GenerateStream(
) (*core.Stream[v2.GenerateStreamedResponse], error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/generate"
endpointURL := baseURL + "/v1/generate"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -445,14 +445,14 @@ func (c *Client) Generate(
) (*v2.Generation, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/generate"
endpointURL := baseURL + "/v1/generate"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -576,14 +576,14 @@ func (c *Client) Embed(
) (*v2.EmbedResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/embed"
endpointURL := baseURL + "/v1/embed"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -703,14 +703,14 @@ func (c *Client) Rerank(
) (*v2.RerankResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/rerank"
endpointURL := baseURL + "/v1/rerank"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -831,14 +831,14 @@ func (c *Client) Classify(
) (*v2.ClassifyResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/classify"
endpointURL := baseURL + "/v1/classify"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -962,14 +962,14 @@ func (c *Client) Summarize(
) (*v2.SummarizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/summarize"
endpointURL := baseURL + "/v1/summarize"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -1089,14 +1089,14 @@ func (c *Client) Tokenize(
) (*v2.TokenizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/tokenize"
endpointURL := baseURL + "/v1/tokenize"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -1216,14 +1216,14 @@ func (c *Client) Detokenize(
) (*v2.DetokenizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/detokenize"
endpointURL := baseURL + "/v1/detokenize"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -1342,14 +1342,14 @@ func (c *Client) CheckApiKey(
) (*v2.CheckApiKeyResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/check-api-key"
endpointURL := baseURL + "/v1/check-api-key"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down
24 changes: 12 additions & 12 deletions connectors/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func (c *Client) List(
) (*v2.ListConnectorsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/connectors"
endpointURL := baseURL + "/v1/connectors"

queryParams, err := core.QueryValues(request)
if err != nil {
Expand Down Expand Up @@ -180,14 +180,14 @@ func (c *Client) Create(
) (*v2.CreateConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/connectors"
endpointURL := baseURL + "/v1/connectors"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -308,14 +308,14 @@ func (c *Client) Get(
) (*v2.GetConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/connectors/%v", id)
endpointURL := core.EncodeURL(baseURL+"/v1/connectors/%v", id)

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -435,14 +435,14 @@ func (c *Client) Delete(
) (v2.DeleteConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/connectors/%v", id)
endpointURL := core.EncodeURL(baseURL+"/v1/connectors/%v", id)

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -563,14 +563,14 @@ func (c *Client) Update(
) (*v2.UpdateConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/connectors/%v", id)
endpointURL := core.EncodeURL(baseURL+"/v1/connectors/%v", id)

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -692,14 +692,14 @@ func (c *Client) OAuthAuthorize(
) (*v2.OAuthAuthorizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/connectors/%v/oauth/authorize", id)
endpointURL := core.EncodeURL(baseURL+"/v1/connectors/%v/oauth/authorize", id)

queryParams, err := core.QueryValues(request)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/request_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (r *RequestOptions) cloneHeader() http.Header {
headers := r.HTTPHeader.Clone()
headers.Set("X-Fern-Language", "Go")
headers.Set("X-Fern-SDK-Name", "github.com/cohere-ai/cohere-go/v2")
headers.Set("X-Fern-SDK-Version", "v2.9.0")
headers.Set("X-Fern-SDK-Version", "v2.10.0")
return headers
}

Expand Down
20 changes: 10 additions & 10 deletions datasets/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ func (c *Client) List(
) (*v2.DatasetsListResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/datasets"
endpointURL := baseURL + "/v1/datasets"

queryParams, err := core.QueryValues(request)
if err != nil {
Expand Down Expand Up @@ -183,14 +183,14 @@ func (c *Client) Create(
) (*v2.DatasetsCreateResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/datasets"
endpointURL := baseURL + "/v1/datasets"

queryParams, err := core.QueryValues(request)
if err != nil {
Expand Down Expand Up @@ -348,14 +348,14 @@ func (c *Client) GetUsage(
) (*v2.DatasetsGetUsageResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/datasets/usage"
endpointURL := baseURL + "/v1/datasets/usage"

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -474,14 +474,14 @@ func (c *Client) Get(
) (*v2.DatasetsGetResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/datasets/%v", id)
endpointURL := core.EncodeURL(baseURL+"/v1/datasets/%v", id)

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down Expand Up @@ -600,14 +600,14 @@ func (c *Client) Delete(
) (map[string]interface{}, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.com/v1"
baseURL := "https://api.cohere.com"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := core.EncodeURL(baseURL+"/datasets/%v", id)
endpointURL := core.EncodeURL(baseURL+"/v1/datasets/%v", id)

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

Expand Down
Loading

0 comments on commit 98393d9

Please sign in to comment.