Skip to content

Commit

Permalink
SDK regeneration (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] committed May 22, 2024
1 parent e3be8ce commit 38fd3f2
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 42 deletions.
22 changes: 11 additions & 11 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (c *Client) ChatStream(
) (*core.Stream[v2.StreamedChatResponse], error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func (c *Client) Chat(
) (*v2.NonStreamedChatResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func (c *Client) GenerateStream(
) (*core.Stream[v2.GenerateStreamedResponse], error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -249,7 +249,7 @@ func (c *Client) Generate(
) (*v2.Generation, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -324,7 +324,7 @@ func (c *Client) Embed(
) (*v2.EmbedResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -395,7 +395,7 @@ func (c *Client) Rerank(
) (*v2.RerankResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -453,7 +453,7 @@ func (c *Client) Classify(
) (*v2.ClassifyResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -528,7 +528,7 @@ func (c *Client) Summarize(
) (*v2.SummarizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -585,7 +585,7 @@ func (c *Client) Tokenize(
) (*v2.TokenizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -656,7 +656,7 @@ func (c *Client) Detokenize(
) (*v2.DetokenizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -712,7 +712,7 @@ func (c *Client) CheckApiKey(
) (*v2.CheckApiKeyResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down
12 changes: 6 additions & 6 deletions connectors/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *Client) List(
) (*v2.ListConnectorsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func (c *Client) Create(
) (*v2.CreateConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -204,7 +204,7 @@ func (c *Client) Get(
) (*v2.GetConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func (c *Client) Delete(
) (v2.DeleteConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -368,7 +368,7 @@ func (c *Client) Update(
) (*v2.UpdateConnectorResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -455,7 +455,7 @@ func (c *Client) OAuthAuthorize(
) (*v2.OAuthAuthorizeResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
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.8.0")
headers.Set("X-Fern-SDK-Version", "v2.8.1")
return headers
}

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

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func (c *Client) Create(
) (*v2.DatasetsCreateResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -209,7 +209,7 @@ func (c *Client) GetUsage(
) (*v2.DatasetsGetUsageResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -265,7 +265,7 @@ func (c *Client) Get(
) (*v2.DatasetsGetResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -321,7 +321,7 @@ func (c *Client) Delete(
) (map[string]interface{}, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down
8 changes: 4 additions & 4 deletions embedjobs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (c *Client) List(
) (*v2.ListEmbedJobResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (c *Client) Create(
) (*v2.CreateEmbedJobResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -188,7 +188,7 @@ func (c *Client) Get(
) (*v2.EmbedJob, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -266,7 +266,7 @@ func (c *Client) Cancel(
) error {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down
2 changes: 1 addition & 1 deletion environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ package api
var Environments = struct {
Production string
}{
Production: "https://api.cohere.ai/v1",
Production: "https://api.cohere.com/v1",
}
14 changes: 7 additions & 7 deletions finetuning/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *Client) ListFinetunedModels(
) (*finetuning.ListFinetunedModelsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -145,7 +145,7 @@ func (c *Client) CreateFinetunedModel(
) (*finetuning.CreateFinetunedModelResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -237,7 +237,7 @@ func (c *Client) GetFinetunedModel(
) (*finetuning.GetFinetunedModelResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -328,7 +328,7 @@ func (c *Client) DeleteFinetunedModel(
) (finetuning.DeleteFinetunedModelResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -420,7 +420,7 @@ func (c *Client) UpdateFinetunedModel(
) (*finetuning.UpdateFinetunedModelResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -513,7 +513,7 @@ func (c *Client) ListEvents(
) (*finetuning.ListEventsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -613,7 +613,7 @@ func (c *Client) ListTrainingStepMetrics(
) (*finetuning.ListTrainingStepMetricsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down
4 changes: 2 additions & 2 deletions models/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *Client) Get(
) (*v2.GetModelResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func (c *Client) List(
) (*v2.ListModelsResponse, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.cohere.ai/v1"
baseURL := "https://api.cohere.com/v1"
if c.baseURL != "" {
baseURL = c.baseURL
}
Expand Down
14 changes: 9 additions & 5 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ type ChatRequest struct {
// **Note**: Chat calls with `tool_results` should not be included in the Chat history to avoid duplication of the message text.
// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
ToolResults []*ToolResult `json:"tool_results,omitempty" url:"tool_results,omitempty"`
stream bool
// Forces the chat to be single step. Defaults to `false`.
ForceSingleStep *bool `json:"force_single_step,omitempty" url:"force_single_step,omitempty"`
stream bool
}

func (c *ChatRequest) Stream() bool {
Expand Down Expand Up @@ -355,7 +357,9 @@ type ChatStreamRequest struct {
// **Note**: Chat calls with `tool_results` should not be included in the Chat history to avoid duplication of the message text.
// Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
ToolResults []*ToolResult `json:"tool_results,omitempty" url:"tool_results,omitempty"`
stream bool
// Forces the chat to be single step. Defaults to `false`.
ForceSingleStep *bool `json:"force_single_step,omitempty" url:"force_single_step,omitempty"`
stream bool
}

func (c *ChatStreamRequest) Stream() bool {
Expand Down Expand Up @@ -395,7 +399,7 @@ type ClassifyRequest struct {
Examples []*ClassifyExample `json:"examples,omitempty" url:"examples,omitempty"`
// The identifier of the model. Currently available models are `embed-multilingual-v2.0`, `embed-english-light-v2.0`, and `embed-english-v2.0` (default). Smaller "light" models are faster, while larger models will perform better. [Fine-tuned models](https://docs.cohere.com/docs/fine-tuning) can also be supplied with their full ID.
Model *string `json:"model,omitempty" url:"model,omitempty"`
// The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.ai/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters.
// The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.com/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters.
Preset *string `json:"preset,omitempty" url:"preset,omitempty"`
// One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.
// Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.
Expand Down Expand Up @@ -479,7 +483,7 @@ type GenerateRequest struct {
Temperature *float64 `json:"temperature,omitempty" url:"temperature,omitempty"`
// If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.
Seed *float64 `json:"seed,omitempty" url:"seed,omitempty"`
// Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.ai/playground/generate).
// Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.com/playground/generate).
// When a preset is specified, the `prompt` parameter becomes optional, and any included parameters will override the preset's parameters.
Preset *string `json:"preset,omitempty" url:"preset,omitempty"`
// The generated text will be cut at the beginning of the earliest occurrence of an end sequence. The sequence will be excluded from the text.
Expand Down Expand Up @@ -574,7 +578,7 @@ type GenerateStreamRequest struct {
Temperature *float64 `json:"temperature,omitempty" url:"temperature,omitempty"`
// If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.
Seed *float64 `json:"seed,omitempty" url:"seed,omitempty"`
// Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.ai/playground/generate).
// Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.com/playground/generate).
// When a preset is specified, the `prompt` parameter becomes optional, and any included parameters will override the preset's parameters.
Preset *string `json:"preset,omitempty" url:"preset,omitempty"`
// The generated text will be cut at the beginning of the earliest occurrence of an end sequence. The sequence will be excluded from the text.
Expand Down

0 comments on commit 38fd3f2

Please sign in to comment.