Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Get-CodexCompletion's body seems broken #1

Open
ehmiiz opened this issue May 30, 2022 · 4 comments
Open

Get-CodexCompletion's body seems broken #1

ehmiiz opened this issue May 30, 2022 · 4 comments

Comments

@ehmiiz
Copy link

ehmiiz commented May 30, 2022

This was the error:
PositionMessage : At C:\Users\Emil\Documents\PowerShell\Modules\Codex\Codex.psm1:191 char:5
+ $contextList.Add($response.Trim().Replace("`n", "\n"))¨
Message : You cannot call a method on a null-valued expression.

https://i.imgur.com/GGuqMQV.png
the body while debugging

psversion: 7.2.4
os: win11

was not able to solve it sadly :(

@ehmiiz
Copy link
Author

ehmiiz commented May 31, 2022

tried it in linux
:
PSVersion: 7.2.4
OS: Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022

PS /usr/local/share/powershell/Modules> # whats my ip addressVERBOSE: {"prompt": "<# powershell #>\n\n# what processes are hogging the most cpu?\nGet-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10\n\n# stop the chrome processes\nGet-Process chrome | Stop-Process\n\n# what's my IP address?\n(Invoke-WebRequest -uri "http://ifconfig.me/ip\").Content\n\n# what's the weather in New York?\n(Invoke-WebRequest -uri "wttr.in/NewYork").Content\n\n# make a git ignore with node modules and src in it\n"node_modules\nsrc" | Out-File .gitignore\n\n# open it in notepad\nnotepad .gitignore\n\n# what's running on port 1018?\nGet-Process -Id (Get-NetTCPConnection -LocalPort 1018).OwningProcess\n\n# kill process 1584\nStop-Process -Id 1584\n\n# what other devices are on my network?\nGet-NetIPAddress | Format-Table\n\n# how much storage is left on my pc?\nGet-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize\n\n# how many GB is 367247884288 B?\n(367247884288 / 1GB)\n# what processes are hogging the most cpu?\nGet-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10\n\n# stop the chrome processes\nGet-Process chrome | Stop-Process\n\n# what's my IP address?\n(Invoke-WebRequest -uri "http://ifconfig.me/ip\").Content\n\n# what's the weather in New York?\n(Invoke-WebRequest -uri "wttr.in/NewYork").Content\n\n# make a git ignore with node modules and src in it\n"node_modules\nsrc" | Out-File .gitignore\n\n# open it in notepad\nnotepad .gitignore\n\n# what's running on port 1018?\nGet-Process -Id (Get-NetTCPConnection -LocalPort 1018).OwningProcess\n\n# kill process 1584\nStop-Process -Id 1584\n\n# what other devices are on my network?\nGet-NetIPAddress | Format-Table\n\n# how much storage is left on my pc?\nGet-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize\n\n# how many GB is 367247884288 B?\n(367247884288 / 1GB)\n\n# whats my ip address", "temperature": 0, "max_tokens": 300, "stop":"#"}
An exception occurred in custom key handler, see $error for more information: You cannot call a method on a null-valued expression.

PS /usr/local/share/powershell/Modules> get-error

Exception :
Type : System.Management.Automation.RuntimeException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : You cannot call a method on a null-valued expression.
HResult : -2146233087
CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : InvokeMethodOnNull
InvocationInfo :
ScriptLineNumber : 191
OffsetInLine : 5
HistoryId : -1
ScriptName : /usr/local/share/powershell/Modules/Codex/Codex.psm1
Line : $contextList.Add($response.Trim().Replace("`n", "\n"))

        PositionMessage  : At /usr/local/share/powershell/Modules/Codex/Codex.psm1:191 char:5
                           +     $contextList.Add($response.Trim().Replace("`n", "\n"))
                           +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@mdowst
Copy link

mdowst commented Jun 22, 2022

I am seeing similar results. Not matter what I enter I get the results below. I'm running Windows 10 with v7.2.4.

PS C:\> # get servicesVERBOSE: {"prompt": "<# powershell #>\n\n# what processes are hogging the most cpu?\nGet-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10\n\n# stop the chrome processes\nGet-Process chrome | Stop-Process\n\n# what's my IP address?\n(Invoke-WebRequest -uri \"http://ifconfig.me/ip\").Content\n\n# what's the weather in New York?\n(Invoke-WebRequest -uri \"wttr.in/NewYork\").Content\n\n# make a git ignore with node modules and src in it\n\"node_modules\nsrc\" | Out-File .gitignore\n\n# open it in notepad\nnotepad .gitignore\n\n# what's running on port 1018?\nGet-Process -Id (Get-NetTCPConnection -LocalPort 1018).OwningProcess\n\n# kill process 1584\nStop-Process -Id 1584\n\n# what other devices are on my network?\nGet-NetIPAddress | Format-Table\n\n# how much storage is left on my pc?\nGet-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize\n\n# how many GB is 367247884288 B?\n(367247884288 / 1GB)\n\n# get my ip\n\n# new AD user\n\n# what\n\n# get services", "temperature": 0, "max_tokens": 300, "stop":"#"}
An exception occurred in custom key handler, see $error for more information: You cannot call a method on a null-valued expression.

@mdowst
Copy link

mdowst commented Jun 22, 2022

Okay, I think I might know what is going on. I ran the Get-CodexCompletion line for line and I discovered it is throwing an error on the Invoke-RestMethod. The error states that there is no code-davinci-002 model. I double-checked the documentation on OpenApi, and it looks like that codex models are in private preview. So, I'm assuming we can't access them without being in the private preview. I signed up for the waiting list. Hopefully it's not too long of a wait.

https://beta.openai.com/docs/models/codex-series-private-beta

@DwayneGibbs
Copy link

DwayneGibbs commented Dec 19, 2022

Looks like a new preferred method has been suggested as of about a month ago. https://beta.openai.com/docs/guides/moderation. However, looking closer this is only on the content filter. The codex you've shared is limited beta but looks offered.

@mdowst any update on this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants