Embedding
OpenAI text embeddings API.
token := EndPoint->GetApiKey();
embedding := Embedding->Create("Hello world", Models->TEXT_EMBEDDING_3_SMALL(), token);Operations
Create
Creates an embedding for a single input string.
function : Create(input:String, model:String, token:String) ~ Float[]Parameters
| Name | Type | Description |
|---|---|---|
| input | String | text to embed |
| model | String | embedding model name |
| token | String | API key |
Return
| Type | Description |
|---|---|
| Float | float array of embedding values, or Nil on error |
Create
Creates an embedding with custom dimensions.
function : Create(input:String, model:String, dimensions:Int, token:String) ~ Float[]Parameters
| Name | Type | Description |
|---|---|---|
| input | String | text to embed |
| model | String | embedding model name |
| dimensions | Int | output dimensions (-1 for default) |
| token | String | API key |
Return
| Type | Description |
|---|---|
| Float | float array of embedding values, or Nil on error |