Skip to content

Converted state management from file saving to prompt engine #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
current_context.txt
current_context.config
current_context.pickle
contexts/test.txt
src/__pycache__/
src/openaiapirc
45 changes: 0 additions & 45 deletions contexts/bash-context.txt

This file was deleted.

41 changes: 41 additions & 0 deletions contexts/bash-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
type: code-engine
config:
model-config:
engine: "code-cushman-001"
temperature: 0
max_tokens: 1024
shell: "bash"
multi_turn: "off"
token_count: 110
comment-operator: "#"
description-comment-operator: "##"
description: "This converts Natural Language Commands to Command Line Commands. Here are some examples"
examples:
- input: "what processes are hogging the most cpu?"
response: "ps aux | sort -nrk 3,3 | head -n 10"
- input: "stop the chrome processes"
response: "kill -9 $(ps aux | grep chrome | awk '{print $2}')"
- input: "what's my IP?"
response: "curl ifconfig.me"
- input: "what's the weather in San Francisco?"
response: "curl wttr.in/SanFrancisco"
- input: "make a directory called web-app"
response: "mkdir web-app"
- input: "add an html, css, and js file to it"
response: |
"touch web-app/index.html
touch web-app/style.css
touch web-app/script.js"
- input: "add a hello world website to the index"
response: "echo '<html><body><h1>Hello World!</h1></body></html>' > web-app/index.html"
- input: "open it with vi"
response: "vi web-app/index.html"
- input: "what's running on port 1018?"
response: "lsof -i :1018"
- input: "kill process 1584"
response: "kill -9 1584"
- input: "what other devices are on my network?"
response: "arp -a"
- input: "how much storage is left?"
response: "df -h"
flow-reset-text: "Ignore the previous examples and start afresh, from here on out, this is an unrelated conversation"
41 changes: 0 additions & 41 deletions contexts/powershell-context.txt

This file was deleted.

41 changes: 41 additions & 0 deletions contexts/powershell-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
type: code-engine
config:
model-config:
engine: "code-cushman-001"
temperature: 0
max_tokens: 1024
shell: "powershell"
multi_turn: "off"
token_count: 110
comment-operator: "#"
description-comment-operator: "##"
description: "This converts Natural Language Commands to Command Line Commands. Here are some examples"
examples:
- input: "what processes are hogging the most cpu?"
response: "Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10"
- input: "stop the chrome processes"
response: "Get-Process chrome | Stop-Process"
- input: "what's my IP address?"
response: '(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content"'
- input: "what's the weather in New York?"
response: '(Invoke-WebRequest -uri "wttr.in/NewYork").Content'
- input: "make a git ignore with node modules and src in it"
response: |
"node_modules"
src" | Out-File .gitignore
- input: "open it in notepad"
response: "notepad .gitignore"
- input: "what's running on port 1018?"
response: "Get-Process -Id (Get-NetTCPConnection -LocalPort 1018).OwningProcess"
- input: "kill process 1584"
response: "Stop-Process -Id 1584"
- input: "what other devices are on my network?"
response: "Get-NetIPAddress | Format-Table"
- input: "how much storage is left on my pc?"
response: "Get-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize"
- input: "how many GB is 367247884288 B?"
response: "(367247884288 / 1GB)"
flow-reset-text: "Ignore the previous examples and start afresh, from here on out, this is an unrelated conversation"



64 changes: 0 additions & 64 deletions contexts/powershell-voice-cognitive-service.txt

This file was deleted.

73 changes: 73 additions & 0 deletions contexts/powershell-voice-cognitive-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
type: code-engine
config:
model-config:
engine: "code-cushman-001"
temperature: 0
max_tokens: 1024
shell: "powershell"
multi_turn: "off"
token_count: 110
comment-operator: "#"
description-comment-operator: "##"
description: "This converts Natural Language Commands to Command Line Commands. Here are some examples"
examples:
- input: "what processes are hogging the most cpu?"
response: |
Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10
spx synthesize --text ("Here are the top 10 processes by memory used") --speakers --quiet

- input: "stop the chrome processes"
response: |
Get-Process chrome | Stop-Process
spx synthesize --text ("I stopped chrome") --speakers --quiet

- input: "what's running on port 3000?"
response: |
Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess
spx synthesize --text ("I found the process running on port 3000") --speakers --quiet

- input: "kill process 1584"
response: |
Stop-Process -Id 1584
spx synthesize --text ("I killed the process with ID 1584") --speakers --quiet

- input: "what other devices are on my network?"
response: |
Get-NetIPAddress | Format-Table
spx synthesize --text ("Here are the IP addresses on your network") --speakers --quiet

- input: "how much storage is left on my pc?"
response: |
Get-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize
spx synthesize --text ("Here is the amount of storage left on your computer") --speakers --quiet

- input: "how many GB is 367247884288 B?"
response: |
spx synthesize --text ("367247884288 B is " + (367247884288 / 1073741824) + " GB") --speakers --quiet
- input: "where do you live?"
response: |
spx synthesize --text ("I live in " + $HOME) --speakers --quiet
- input: "what's my IP address?"
response: |
$ip = (Invoke-WebRequest -Uri http://ifconfig.me/ip).Content
spx synthesize --text ("Your IP address is " + $ip) --speakers --quiet

- input: "tell me a joke"
response: |
spx synthesize --text ("What do dog robots do? They byte!") --speakers --quiet
- input: "You: How do I combine arrays?"
response: |
spx synthesize --text ("Bot: You can use the concat() method") --speakers --quiet
- input: "tell me a joke"
response: |
spx synthesize --text ("Why do programmers always mix up Halloween and Christmas? Because Oct 31 = Dec 25") --speakers --quiet
- input: "tell me a joke"
response: |
spx synthesize --text ("The best method for accelerating a computer is the one that boosts it by 9.8 m/s^2") --speakers --quiet
- input: "what's the meaning of life?"
response: |
spx synthesize --text ("The meaning of life is 42") --speakers --quiet
- input: "where are you located"
response: |
spx synthesize --text ("I live in " + $HOME) --speakers --quiet
flow-reset-text: "Ignore the previous examples and start afresh, from here on out, this is an unrelated conversation"
39 changes: 0 additions & 39 deletions contexts/powershell-voice.txt

This file was deleted.

37 changes: 37 additions & 0 deletions contexts/powershell-voice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
type: code-engine
config:
model-config:
engine: "code-cushman-001"
temperature: 0
max_tokens: 1024
shell: "powershell"
multi_turn: "off"
token_count: 110
comment-operator: "#"
description-comment-operator: "##"
description: "This converts Natural Language Commands to Command Line Commands. Here are some examples"
examples:
- input: "what processes are hogging the most cpu?"
response: "Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10"
- input: "stop the chrome processes"
response: "Get-Process chrome | Stop-Process"
- input: "make a readme with a project header and two sections"
response: |
# Project Header
## Section 1
## Section 2" | Out-File "./readme2.md"
- input: "what's running on port 3000?"
response: "Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess"
- input: "kill process 1584"
response: "Stop-Process -Id 1584"
- input: "what other devices are on my network?"
response: "Get-NetIPAddress | Format-Table"
- input: "how much storage is left on my pc?"
response: "Get-WmiObject -Class Win32_LogicalDisk | Select-Object -Property DeviceID,FreeSpace,Size,DriveType | Format-Table -AutoSize"
- input: "how many GB is 367247884288 B?"
response: "(367247884288 / 1GB)"
- input: "what's the meaning of life?"
response: '(new-object -ComObject SAPI.SPVoice).Speak("The meaning of life is 42")'
- input: "where are you located"
response: '(new-object -ComObject SAPI.SPVoice).Speak("I live in " + $HOME)'
flow-reset-text: "Ignore the previous examples and start afresh, from here on out, this is an unrelated conversation"
Loading