Skip to content

error while activating OpenAI when using cursor #4593

@ol-so-cpu

Description

@ol-so-cpu

Last 64 Keys:
Ctrl+v Enter
S e t - P S R e a d L i n e O p t i o n Space - H i s t o r y N o D u p l i c a t e s Space - E d i t M o d e Space W i n d o w s Enter
Enter
Ctrl+v

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.Parameter name: top
Actual value was -11.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Paste(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\Solomon\TSP> $headers = @{

    "Content-Type" = "application/json"
    "Authorization" = "Bearer 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"

}

$body = @{
"messages" = @(
@{
"role" = "system"
"content" = "You are a test assistant."
},
@{
"role" = "user"
"content" = "Testing. Just say hi and nothing else."
}
)
"model" = "gpt-4o-mini"
} | ConvertTo-Json

Invoke-WebRequest -Uri "https://api.openai.com/v1/chat/completions" -Method Post -Headers $headers -Body $body

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions