- The model name parameters are now case sensitive.
Previously, model names were converted to lowercase internally. This is optimal for the OpenAI, but some compatible API servers require uppercase model names. - Add
-All
,-Limit
&-Order
params forGet-OpenAIFile
.
- Add
-Prediction
param forRequest-ChatCompletion
.
ref: Use Predicted Outputs
-
Add a support for audio input / output in
Request-ChatCompletion
.Request-ChatCompletion -Model gpt-4o-audio-preview ` -Modalities text, audio ` -Voice 'shimmer' ` -InputAudio 'C:\hello.mp3' ` -AudioOutFile 'C:\response.mp3'
-
Fix an issue with incorrect discontinuance date for the gpt4-32k model.
- Add an experimental support for Realtime API.
This enables real-time conversations with the AI assitstant. Please refer to this guide.
Guide: How to use Realtime API - Update default api version of Azure OpenAI Service to
2024-10-01-preview
- Outputs Run and RunStep error messages as warnings.
- Fix an issue where some request URIs contains duplicate slashes.
- Add
-Store
&-MetaData
params forRequest-ChatCompletion
.
For support Stored Completions that was annouced at OpenAI DevDay 2024.
- Add
-Images
parameter forRequest-Moderation
.
- Add
omni-moderation-latest
model to tab completions.
- Refactor file upload handling for non-ASCII filenames.
- Add
o1-preview
ando1-mini
models to tab completions. - Add
-MaxCompletionTokens
parameter forRequest-ChatCompletion
.
The-MaxTokens
parameter is now deprecated. gpt-3.5-turbo-0613
andgpt-3.5-turbo-16k-0613
is deprecated on 2024-09-13.
You can still call these models, but it is removed from model name completion.
- Add
-Include
param forGet-ThreadRunStep
. - Add
-RankerForFileSearch
and-ScoreThresholdForFileSearch
params forNew-Assistant
. - Add
-PollIntervalSec
param forWait-*
functions. - Update default api version of Azure OpenAI Service to
2024-07-01-preview
- Fix misc bugs related to Azure OpenAI Service.
- Add support for new
chatgpt-4o-latest
model.
- Fixed issue that occurred when using
json_schema
in Windows PowerShell 5.1 (#30)
- Add a support for Structured Outpus.
Please refer to this guide.
Guide: How to use Structured Outputs
This is a major release that includes breaking changes.
- REMOVE All Azure specific function is removed.
You can use Azure OpenAI Service by-ApiType
parameter. - Add
gpt-4o-mini
model to tab completions.
- Add
-ServiceTier
parameter toRequest-ChatCompletion
.
- Fix issues about Get/Add/Remove-OpenAIFile with Azure OpenAI Service.
- Fix issue that the
New-VectorStore
with-FileId
parameter.
- Add
-ParallelToolCalls
parameter. - Add
-ChunkingStrategy
parameter. - Add
-MaxNumberOfFileSearchResults
parameter.
- Fix issue on Windows PowerShell 5.1 with Azure OpenAI Service.
- Add
-WaitForRunComplete
param toAdd-ThreadMessage
. (#15) (Thanks @potatoqualitee!)
- Add new utility functions for set commmon params (context)
- Improve performance of cl100k_base tokenizer
- Support for
o200k_base
tokenizer that is used ingpt-4o
. - Add
-AsBatch
for embeddings and text completions. - Add
incomplete
status of Run.
- Add
gpt-4o
model to tab completions.
- Add
-Images
parameter toAdd-ThreadMessage
.
This makes that the image input can be used in Assistants. - Fix issues about relative file path input.
- Rename
Register-OpenAIFile
toAdd-OpenAIFile
.
(Note: You can still useRegister-OpenAIFile
as an alias. However, in the future release, the alias will be removed.)
- Fix issue that the
Start-ThreadRun
would throw an authentication error in some situations. (#11) (Thanks @potatoqualitee!) - Fix issue that the
Start-ThreadRun
with-Stream
doesn't work on Windows PowerShell 5.1 - Improve documents.
- Add new Remove-ThreadMessage function.
- Add "required" as an option for
-ToolChoice
- Improve documents.
- Commands for Assistants now uses v2 version of API. (Still in beta)
- Add new commands for Vector Store.
- Fix minor issues
Guide: How to use File search with Assistants and Vector Store
-
Add new functions for Batch API.
To use Batch with the new PSOpenAI cmdlets, please refer to this guide.
Guide: How to use BatchStart-Batch
Get-Batch
Wait-Batch
Stop-Batch
Get-BatchOutput
-
Register-OpenAIFile
is used to make byte arrays uploadable without saving them to a file.$ByteArray = [System.Text.Encoding]::UTF8.GetBytes('some text data') Register-OpenAIFile -Content $ByteArray -Name 'filename.txt' -Purpose assistants
-
All Azure versions of the function is deprecated.
Instead, the-ApiType
parameter added to the normal functions.
You can call the Azure OpenAI Service by specifying-ApiType
asAzure
.$env:OPENAI_API_KEY = '<Put your api key here>' $env:OPENAI_API_BASE = 'https://<your-resource-name>.openai.azure.com/' Request-ChatCompletion ` -Message 'Hello.' ` -Deployment 'gpt-4' ` -ApiType Azure
- Fix a bug that caused
New-Assistant
to fail without explicitly passing the model name. - Fix an issue that
Stop-ThreadRun
does not working. - Improved code readability using splatting (#6) (Thanks @potatoqualitee!)
- Add new params to
Start-ThreadRun
-MaxPromptTokens
-MaxCompletionTokens
-TruncationStrategyType
-TruncationStrategyLastMessages
-ToolChoice
-ToolChoiceFunctionName
- Updates the list of model names for tab completions.
- Add
-AdditionalMessages
parameter toStart-ThreadRun
- Add
-RunId
parameter toGet-ThreadMessage
- Add
-Temperature
parameter toStart-ThreadRun
- Remove unintended files in the previous release.
- Change the parameter type to
[switch]
for-UseCodeInterpreter
&-UseRetrieval
- Add
-Stream
parameter toStart-ThreadRun
- Add
-Format
parameter toStart-ThreadRun
-
Start-ThreadRun
now can be use without preparing threads in advance.example :
$Assistant = New-Assistant -Model "gpt-3.5-turbo" $Run = Start-ThreadRun -Assistant $Assistant -Message "Hello, what can you do for me?" $Result = $Run | Receive-ThreadRun -Wait
- Change max value of the
-TopLogProbs
parameter to20
. - Change default api version of Azure OpenAI Service to
2024-03-01-preview
- Add new common parameters to almost all functions.
-AdditionalQuery
-AdditionalHeaders
-AdditionalBody
- Fix minor issues.
This is a major release that includes breaking changes.
- REMOVE parameter alias
Engine
from all functions. - REMOVE old encoding support from
ConvertTo-Token
andConvertFrom-Token
. Now these commands only supportcl100k_base
encoding. It because all models currently supported by OpenAI use this encoding. - Remove
Request-AzureExtensionsChatCompletion
. It was undocumented. - Fix a bug that a file to be saved in an unexpected location when only a file name is specified in the
-OutFile
parameter. - Add new functions for using the Assistants API on the Azure OpenAI Service.
- Add
wav
andpcm
to response format ofRequest-AudioSpeech
.
- Add new embedding model's support to
ConvertTo-Token
. - Remove
-InstanceId
parameter toRequest-ChatCompletion
, it because the param does not GA.
- Add
-InstanceId
parameter toRequest-ChatCompletion
.
- Add
-TimestampGranularities
parameter toRequest-AudioTranscription
. - Add new Request-AzureAudioSpeech function.
- Change default api version of Azure OpenAI Service to
2024-02-15-preview
- The retry logic supports with
retry-after-ms
andretry-after
response headers. - Add new model names to tab completions.
- Add
-Dimensions
param forRequest-Embeddings
. - The exceptions thrown from API requests now have unique type information that differs depending on the error.
Also, the exception contains the complete response header and contents, not just the message. This allows for more detailed information about the error.
Currently, PSOpenAI has these type of exceptions.APIRequestException
BadRequestException
ContentFilteredException
UnauthorizedException
NotFoundException
RateLimitExceededException
QuotaLimitExceededException
- Improved performance when executing a large number of requests in a short period of time.
- Fixed an issue where a double request was incorrectly executed when a
-Stream
was specified.
- Remove
Request-TextEdit
function due to the API endpoint being shut down by OpenAI. - The retry decision respects the value of the
x-should-retry
response header. - Updates the list of deprecation models.
- Rebuild libraries using .NET 8
- Add
-AdditionalInstructions
parameter toStart-ThreadRun
.
- Add
-LogProbs
and-TopLogProbs
parameter toRequest-ChatCompletion
. - Add
-Images
and-ImageDetail
parameter toRequest-AzureChatCompletion
.
These parameters are currently acceptable only on thegpt-4-vision-preview
model.
Request-AzureImageGeneration
now supports DALL-E 3 model.- Change default api version of Azure OpenAI Service to
2023-12-01-preview
- Fix minor issues.
-
Add Request-AudioSpeech function. It generates audio from the input text.
PS C:\> Request-AudioSpeech -text 'Do something fun to play.' -OutFile 'C:\Output\text2speech.mp3' -Voice Alloy
-
Add new functions for using the OpenAI Assistants API.
To use Assistants with the new PSOpenAI cmdlets, please refer to this guide.
Guide: How to use Assistants
Warning
The Assistants API is still in Beta. Specifications, usage, and parameters are subject to change without announcement.
- Assistants:
Get-Assistant
,New-Assistant
,Remove-Assistant
,Set-Assistant
- Threads:
Get-Thread
,New-Thread
,Remove-Thread
,Set-Thread
- Messages:
Get-ThreadMessage
,Add-ThreadMessage
- Runs:
Get-ThreadRun
,Start-ThreadRun
,Stop-ThreadRun
,Wait-ThreadRun
,Receive-ThreadRun
- Steps:
Get-ThreadRunStep
- Files:
Get-OpenAIFile
,Register-OpenAIFile
,Remove-OpenAIFile
,Get-OpenAIFileContent
- Change directory name from "Examples" to "Guides".
- Suppress verbose message about the organization-Id not found.
- Fix minor bugs.
Implements some updates that announced in OpenAI Dev Day 2023.
(New features such as Threads or Assistants does not implemented yet. We are working in progress.)
- Add / Rename / Remove some parameters to
Request-ChatComplention
.- Add :
-Images
,-ImageDetail
,-Tools
,-ToolChoice
,-Format
,-Seed
- Remove :
-Functions
,-FunctionCall
,-MaxFunctionCallCount
- Rename :
-InvokeFunctionOnCallMode
to-InvokeTools
- Add :
- Add new models to tab completions of
Request-ChatComplention
.gpt-3.5-turbo-1106
,gpt-4-1106-preview
,gpt-4-vision-preview
- Add
-Model
parameter toRequest-ImageGeneration
. You can specifiy the model name. (dall-e-2
ordall-e-3
) - Add
-Quality
and-Style
parameters toRequest-ImageGeneration
(fordall-e-3
)
This is a major release that includes breaking changes.
- Add
-ApiBase
parameter to specify the base URL of the API endpoint.
This is useful for using the OpenAI compatible API such like FastChat or LM Studio in a private environment.PS C:\> Request-ChatCompletion -Message 'Hello' -ApiBase 'https://localhost:8000/v1'
Get/New/Remove-AzureOpenAIDeployments
functions are removed.- Remove
-Token
parameter from all functions. Use-ApiKey
instead. OPENAI_TOKEN
environment variable is deprecated. UseOPENAI_API_KEY
instead.- The default model for
Request-TextCompletion
is changed togpt-3.5-turbo-instruct
fromtext-davinci-003
. - Add
-Format
parameter toRequest-Embeddings
function. This parameter can be used to specify the format of the returned embeddings.
- Fix various issues about Function calling.
- Add new whisper functions for Azure OpenAI Service
- Remove the upper limit on the
-MaxTokens
parameter. (The maximum number of tokens depends on the model used) - Add support for Function calling method on Azure OpenAI Service.
- Change default api version of Azure OpenAI Service to
2023-09-01-preview
- Add a new
gpt-3.5-turbo-instruct
model to tab completions ofRequest-TextCompletion
.
- Update tab completions for models of
Request-TextCompletion
.- To avoid breaking change, the default model used remains legacy
text-davinci-003
. We plan to change it on the future release.
- To avoid breaking change, the default model used remains legacy
- Update warning messages about the deprecation models that has been announced by OpenAI.
- Remove warning messages about the expiration dates of these models. Because OpenAI has announced that the discontinued dates for these models will be postponed for the time being.
gpt-3.5-turbo-0301
gpt-4-0314
gpt-4-32k-0314
- Add initial support for Function calling method of the OpenAI ChatCompletion API. See the guide.
- Change the name of
-RolePrompt
to-SystemMessage
(-RolePrompt
can also continue to be used as an alias ) - Add new ChatGPT models.
gpt-3.5-turbo-16k
gpt-3.5-turbo-0613
gpt-3.5-turbo-16k-0613
gpt-4-0613
gpt-4-32k-0613
- Ready for old models discontinuation on 2023-09-13.
gpt-3.5-turbo-0301
gpt-4-0314
gpt-4-32k-0314
- Add Request-AzureImageGeneration for Azure DALL-E
- Update Azure API version to
2023-05-15
of latest stable. - Update docs and examples.
- Fix an issue that the User-Agent was not set in stream requests.
- Minor fixes/improvements.
- Use HTTP/2 for API requests if the platform is supported.
- Adjust retry intervals for API requests.
- Improve error handling.
- The
code-davinci-edit-001
model is restored.
It appears that the previous unavailability was a temporary problem rather than a permanent retirement.
ConvertTo-Token
andConvertFrom-Token
performance has been significantly improved. (Up to 100 times faster)
- Improve error handling.
- Messages can now be entered directly from the pipeline. (
Request-ChatGPT
)PS C:\> "Can you recommend some music?" | Request-ChatGPT | Select-Object -ExpandProperty Answer I can suggest some popular and diverse genres and artists that listeners enjoy...
Request-Moderation
now outputs a warning message when content policies are violated. To suppress this, specify-WarningAction Ignore
.PS C:\> Request-Moderation -Text "This is a harmful message" -WarningAction Ignore
- Fix incorrect links in the command help.
- Add new commands for Azure OpenAI Service.
- Fix an issue that unmasked API key would unintentionally be exposed in debug messages when using
-Stream
. - Fix issue with organization ID not being used correctly when using
-Stream
. - Minor fixes.
- Add
-Organization
parameter to specify the Organization ID used for API requests. - Improve output of verbose and debug messages.
- Enable tab completion for model names.
- Misc improvements.
- Add new commands Get-CosineSimilarity for calculates cosine similarity between two vectors.
Note: Added for convenience, not good implementation for performance or accuracy. For production use, it is recommended to use an external library such as Math.NET Numerics.
- Improve behavior of
ConvertTo-Token
andConvertFrom-Token
when a jagged array is input via pipeline.
- Now PSOpenAI has experimental supports for Azure OpenAI Service. These new commands added.
- Add
-Name
option forRequest-ChatGPT
.
This parameter can be used to specify the name of the messenger.
e.g.)PS C:\> (Request-ChatGPT -Message 'Do you know my name?' -Name 'Samuel' -Model 'gpt-4-0314' -Temperature 0).Answer Yes, your name is Samuel.
- Change the
-Message
parameter ofRequest-ChatGPT
to optional and accepts input from pipeline by property name. - Multiple strings can be specified for
-RolePrompt
. - Add
-AsArray
option forConvertFrom-Token
. - Some minor changes.
- Add new commands ConvertTo-Token and ConvertFrom-Token for converting text and token IDs to each other.
(Using microsoft/Tokenizer library.) - Add
-LogitBias
option forRequest-ChatGPT
andRequest-TextCompletion
.
- Add a new command Request-Embeddings.
- [IMPORTANT CHANGE]
Change the environment variable name of the API auth key fromOPENAI_TOKEN
toOPENAI_API_KEY
. And also change the parameter name from-Token
to-ApiKey
.
This is because the word "Token" is often confused with a term used in the field of machine learning, and the official OpenAI reference uses this name.
For backward compatibility,OPENAI_TOKEN
and-Token
will continue to work, but may be deprecated entirely in the future.
- Add
-MaxRetryCount
option for all functions.
Retries up to the maximum number of times specified if an API request fails with a429 (Rate limit reached)
or5xx (Server side errors)
error. The retry interval increases exponentially up to 128 seconds. - These obsolated functions are completely removed.
Request-CodeCompletion
Request-CodeEdit
- Minor fixes.
- Add a new command Enter-ChatGPT. You can communicate with ChatGTP interactively on the console.
- Add
-Stream
option forRequest-ChatGPT
andRequest-TextCompletion
. - The AI model
code-davinci-edit-001
has been outdated. - Fix wrong messages about expires date of AI models.
- OpenAI has announced that the Codex API will be discontinued on 2023-03-23, the following functions may no longer work in the future. In the future release, these functions will be completely removed from the module.
Request-CodeCompletion
Request-CodeEdit
- When a request specifying an AI model that has been or will be discontinued by OpenAI is executed, Warning messages will be output. (the request continues to be executed).
AI models that will output warning messages at this time:code-davinci-001
code-davinci-002
code-cushman-001
code-cushman-002
- Add
StopSequence
parameter forRequest-ChatGPT
,Request-TextCompletion
,Request-CodeCompletion
.
When specific words are output from the API, subsequent output is stopped.
e.g.)# This code generates only top 4 list. Request-TextCompletion -Prompt 'List of top 10 most populous countries' -StopSequence '5.'
- Fix an issue that the language code may not be set correctly in
Request-AudioTranscription
on macOS and Linux environment. - Fix minor issues on Windows PowerShell 5.1
- Fix Flaky Tests.
- Improve error handling.
- Change the default value of the
MaxTokens
parameter ofRequest-TextCompletion
to2048
. The previous default value of16
was not useful for most use cases. - Add the
Request-CodeCompletion
function. This performs the same process asRequest-TextCompletion
, but is more suitable for generating program code since the AI model used by default iscode-davinci-002
. - Add Pester tests for all public functions.
- Initial public release.