external help file | Module Name | online version | schema |
---|---|---|---|
PSOpenAI-help.xml |
PSOpenAI |
2.0.0 |
Creates an embedding vector representing the input text.
Request-Embeddings
[-Text] <String[]>
[-Model <String>]
[-Format <String>]
[-Dimensions <Int32>]
[-User <String>]
[-AsBatch]
[-CustomBatchId <String>]
[-TimeoutSec <Int32>]
[-MaxRetryCount <Int32>]
[-ApiBase <Uri>]
[-ApiKey <Object>]
[-Organization <String>]
[<CommonParameters>]
Creates an embedding vector representing the input text.
https://platform.openai.com/docs/guides/embeddings
Request-Embeddings -Text 'Waiter, the food was delicious...' | select -ExpandProperty data
object : embedding
index : 0
embedding : {0.01004226, -0.01884855, 0.01824344, -0.01565562…}
Text : Waiter, the food was delicious...
(Required) Input text to get embeddings for
Type: String[]
Aliases: Input
Required: True
Position: 1
Accept pipeline input: True (ByValue)
The name of model to use.
The default value is text-embedding-ada-002
.
Type: String
Required: False
Position: Named
Default value: text-embedding-ada-002
The format to return the embeddings in. Can be either float
or base64
The default value is float
.
Type: String
Required: False
Position: Named
Default value: float
The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3
and later models.
Type: Int32
Required: False
Position: Named
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
Type: String
Required: False
Position: Named
If this is specified, this cmdlet returns an object for Batch input
It does not perform an API request to OpenAI. It is useful with Start-Batch
cmdlet.
Type: SwitchParameter
Required: False
Position: Named
Default value: False
A unique id that will be used to match outputs to inputs of batch. Must be unique for each request in a batch.
This parameter is valid only when the -AsBatch
swicth is used. Otherwise, it is simply ignored.
Type: String
Required: False
Position: Named
Specifies how long the request can be pending before it times out.
The default value is 0
(infinite).
Type: Int32
Required: False
Position: Named
Default value: 0
Number between 0
and 100
.
Specifies the maximum number of retries if the request fails.
The default value is 0
(No retry).
Note : Retries will only be performed if the request fails with a 429 (Rate limit reached)
or 5xx (Server side errors)
error. Other errors (e.g., authentication failure) will not be performed.
Type: Int32
Required: False
Position: Named
Default value: 0
Specifies an API endpoint URL such like: https://your-api-endpoint.test/v1
If not specified, it will use https://api.openai.com/v1
Type: System.Uri
Required: False
Position: Named
Default value: https://api.openai.com/v1
Specifies API key for authentication.
The type of data should [string]
or [securestring]
.
If not specified, it will try to use $global:OPENAI_API_KEY
or $env:OPENAI_API_KEY
Type: Object
Required: False
Position: Named
Specifies Organization ID which used for an API request.
If not specified, it will try to use $global:OPENAI_ORGANIZATION
or $env:OPENAI_ORGANIZATION
Type: string
Aliases: OrgId
Required: False
Position: Named
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.