forked from cohere-ai/cohere-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembed_jobs.go
53 lines (46 loc) · 2.13 KB
/
embed_jobs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// This file was auto-generated by Fern from our API Definition.
package api
import (
fmt "fmt"
)
type CreateEmbedJobRequest struct {
// ID of the embedding model.
//
// Available models and corresponding embedding dimensions:
//
// - `embed-english-v3.0` : 1024
// - `embed-multilingual-v3.0` : 1024
// - `embed-english-light-v3.0` : 384
// - `embed-multilingual-light-v3.0` : 384
Model string `json:"model" url:"model"`
// ID of a [Dataset](https://docs.cohere.com/docs/datasets). The Dataset must be of type `embed-input` and must have a validation status `Validated`
DatasetId string `json:"dataset_id" url:"dataset_id"`
InputType EmbedInputType `json:"input_type,omitempty" url:"input_type,omitempty"`
// The name of the embed job.
Name *string `json:"name,omitempty" url:"name,omitempty"`
// One of `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.
Truncate *CreateEmbedJobRequestTruncate `json:"truncate,omitempty" url:"truncate,omitempty"`
}
// One of `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.
type CreateEmbedJobRequestTruncate string
const (
CreateEmbedJobRequestTruncateStart CreateEmbedJobRequestTruncate = "START"
CreateEmbedJobRequestTruncateEnd CreateEmbedJobRequestTruncate = "END"
)
func NewCreateEmbedJobRequestTruncateFromString(s string) (CreateEmbedJobRequestTruncate, error) {
switch s {
case "START":
return CreateEmbedJobRequestTruncateStart, nil
case "END":
return CreateEmbedJobRequestTruncateEnd, nil
}
var t CreateEmbedJobRequestTruncate
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (c CreateEmbedJobRequestTruncate) Ptr() *CreateEmbedJobRequestTruncate {
return &c
}