external help file | Module Name | online version | schema |
---|---|---|---|
PSOpenAI-help.xml |
PSOpenAI |
2.0.0 |
Starts a run.
Start-ThreadRun
[-Assistant] <String>
-Message <String>
[-Images <Object[]>]
[-ImageDetail <String>]
[-Model <String>]
[-Instructions <String>]
[-AdditionalMessages <Object[]>]
[-Role <String>]
[-FileIdsForCodeInterpreter <Object[]>]
[-VectorStoresForFileSearch <Object[]>]
[-MaxPromptTokens <Int32>]
[-MaxCompletionTokens <Int32>]
[-TruncationStrategyType <String>]
[-TruncationStrategyLastMessages <Int32>]
[-ToolChoice <String>]
[-ToolChoiceFunctionName <String>]
[-UseCodeInterpreter]
[-UseFileSearch]
[-Functions <IDictionary>]
[-ParallelToolCalls]
[-MetaData <IDictionary>]
[-Temperature <Double>]
[-Stream]
[-Format <Object>]
[-JsonSchema <String>]
[-TimeoutSec <Int32>]
[-MaxRetryCount <Int32>]
[-ApiBase <Uri>]
[-ApiKey <SecureString>]
[-Organization <String>]
[-AdditionalQuery <IDictionary>]
[-AdditionalHeaders <IDictionary>]
[-AdditionalBody <Object>]
[<CommonParameters>]
Start-ThreadRun
[-ThreadId] <String>
[-Assistant] <Object>
[-Model <String>]
[-Instructions <String>]
[-AdditionalInstructions <String>]
[-AdditionalMessages <Object[]>]
[-Include <String[]>]
[-MaxPromptTokens <Int32>]
[-MaxCompletionTokens <Int32>]
[-TruncationStrategyType <String>]
[-TruncationStrategyLastMessages <Int32>]
[-ToolChoice <String>]
[-ToolChoiceFunctionName <String>]
[-UseCodeInterpreter]
[-UseFileSearch]
[-Functions <IDictionary>]
[-ParallelToolCalls]
[-MetaData <IDictionary>]
[-Temperature <Double>]
[-Stream]
[-Format <String>]
[-TimeoutSec <Int32>]
[-MaxRetryCount <Int32>]
[-ApiBase <Uri>]
[-ApiKey <SecureString>]
[-Organization <String>]
[-AdditionalQuery <IDictionary>]
[-AdditionalHeaders <IDictionary>]
[-AdditionalBody <Object>]
[<CommonParameters>]
Starts a run.
PS C:\> Start-ThreadRun -ThreadId 'thread_abc123' -Assistant 'asst_abc123'
Starts a run of the thread with spcified assiatnt.
The ID of the thread to run.
Type: String
Aliases: thread_id
Required: True
Position: 0
Accept pipeline input: True (ByPropertyName, ByValue)
The ID of the assistant to use to execute this run.
Type: Object
Aliases: assistant_id, AssistantId
Required: True
Position: 1
Accept pipeline input: True (ByPropertyName)
The name of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
Type: String
Required: False
Position: Named
Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis.
Type: String
Required: False
Position: Named
Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
Type: String
Aliases: additional_instructions
Required: False
Position: Named
Adds additional messages to the thread before creating the run.
Type: Object[]
Aliases: additional_messages
Required: False
Position: Named
A list of additional fields to include in the response.
Type: String[]
Required: False
Position: Named
A list of file IDs made available to the code_interpreter tool. There can be a maximum of 20 files associated with the tool.
Type: Object[]
Required: False
Position: Named
The vector store attached to this thread. There can be a maximum of 1 vector store attached to the thread.
Type: Object[]
Required: False
Position: Named
A list of file IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
Type: Object[]
Required: False
Position: Named
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.
Type: IDictionary
Required: False
Position: Named
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
Type: Double
Required: False
Position: Named
A list of functions the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
Type: IDictionary[]
Required: False
Position: Named
Whether to enable parallel function calling during tool use. The default is true (enabled)
Type: SwitchParameter
Aliases: parallel_tool_calls
Required: False
Position: Named
Default value: True
Override whether the code interpreter tool enable or not.
Type: SwitchParameter
Required: False
Position: Named
Override whether the file_search tool enable or not.
Type: SwitchParameter
Required: False
Position: Named
If set, partial message deltas will be sent, like in ChatGPT.
Type: SwitchParameter
Required: False
Position: Named
Default value: False
Specifies the format that the model must output.
default
will only outputs text message.json_object
enables JSON mode, which ensures the message the model generates is valid JSON.json_schema
enables Structured Outputs which ensures the model will match your supplied JSON schema.raw_response
returns raw response content from API.
Type: Object
Aliases: response_format
Required: False
Position: Named
Specifies an object or data structure to represent the JSON Schema that the model should be constrained to follow.
Required if json_schema
is specified for -Format
. Otherwise, it is 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: 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
A list of File IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like file_search and code_interpreter that can access and use files.
Type: String[]
Aliases: file_ids
Required: False
Position: Named
The maximum number of prompt tokens that may be used over the course of the run.
Type: Int32
Aliases: max_prompt_tokens
Required: False
Position: Named
The maximum number of completion tokens that may be used over the course of the run.
Type: Int32
Aliases: max_completion_tokens
Required: False
Position: Named
The content of the message.
Type: String
Aliases: Content, Text
Required: True
Position: Named
An array of images for reference to vision-compatible models. You can specify uploaded file id or URL of image.
Type: Object[]
Required: False
Position: Named
Specifies the detail level of the image if specified by the user. "low" uses fewer tokens, you can opt in to high resolution using "high".
Type: String
Required: False
Position: Named
Default value: auto
The role of the entity that is creating the message. Allowed value is user
or assistant
.
Type: String
Required: False
Position: Named
Controls which (if any) tool is called by the model. You can choose from auto
, none
, code_interpreter
, retrieve
or function
.
Type: String
Aliases: tool_choice
Required: False
Position: Named
The name of the function to call. You must specify this param when the ToolChoice is specified to function
.
Type: String
Required: False
Position: Named
The truncation strategy to use for the thread. The default is auto
. You can choose from auto
or last_messages
Type: String
Aliases: last_messages
Required: False
Position: Named
Default value: auto
The number of most recent messages from the thread when constructing the context for the run.
Type: Int32
Aliases: last_messages
Required: False
Position: Named
If you want to explicitly send an extra query params, you can do so.
Type: IDictionary
Required: False
Position: Named
If you want to explicitly send an extra headers, you can do so.
Type: IDictionary
Required: False
Position: Named
If you want to explicitly send an extra body, you can do so.
Type: Object
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.
https://platform.openai.com/docs/api-reference/runs/createRun