Skip to content

Instantly share code, notes, and snippets.

@AlexanderHolmeset
Last active February 9, 2023 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderHolmeset/aa87d0e2c3db970150553bab0f26d9e1 to your computer and use it in GitHub Desktop.
Save AlexanderHolmeset/aa87d0e2c3db970150553bab0f26d9e1 to your computer and use it in GitHub Desktop.
Get-AzureOpenAIToken -ManagedIdentity $true
$DeploymentName = "TextModel"
$ResourceName = "AzureOpenAIAlex"
$Prompt = "What is microsoft teams?"
$Request = Get-Completion -DeploymentName $DeploymentName -ResourceName $ResourceName -Maxtokens 100 -Prompt $Prompt
"Genetrated text:"
$Request.choices.text
"Token cost"
$Request.usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment