-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathembeddings.ts
More file actions
71 lines (60 loc) · 1.85 KB
/
Copy pathembeddings.ts
File metadata and controls
71 lines (60 loc) · 1.85 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Embeddings extends APIResource {
/**
* Generate vector embeddings for one or more text inputs. Returns numerical arrays
* representing semantic meaning, useful for search, classification, and retrieval.
*
* @example
* ```ts
* const embedding = await client.embeddings.create({
* input:
* 'Our solar system orbits the Milky Way galaxy at about 515,000 mph',
* model: 'togethercomputer/m2-bert-80M-8k-retrieval',
* });
* ```
*/
create(body: EmbeddingCreateParams, options?: RequestOptions): APIPromise<Embedding> {
return this._client.post('/embeddings', { body, ...options });
}
}
export interface Embedding {
data: Array<Embedding.Data>;
model: string;
/**
* The object type, which is always `list`.
*/
object: 'list';
}
export namespace Embedding {
export interface Data {
embedding: Array<number>;
index: number;
/**
* The object type, which is always `embedding`.
*/
object: 'embedding';
}
}
export interface EmbeddingCreateParams {
/**
* A string providing the text for the model to embed.
*/
input: string | Array<string>;
/**
* The name of the embedding model to use.
*
* [See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)
*/
model:
| 'WhereIsAI/UAE-Large-V1'
| 'BAAI/bge-large-en-v1.5'
| 'BAAI/bge-base-en-v1.5'
| 'togethercomputer/m2-bert-80M-8k-retrieval'
| (string & {});
}
export declare namespace Embeddings {
export { type Embedding as Embedding, type EmbeddingCreateParams as EmbeddingCreateParams };
}