-
Notifications
You must be signed in to change notification settings - Fork 19
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
Trevor #1
Open
TrevorJamesH
wants to merge
2
commits into
sshh12:main
Choose a base branch
from
solvhealth:trevor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Trevor #1
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"python.formatting.provider": "black", | ||
"python.formatting.provider": "none", | ||
"python.formatting.blackArgs": ["--line-length", "120"], | ||
"python.linting.pylintUseMinimalCheckers": false, | ||
"editor.showUnused": true | ||
"editor.showUnused": true, | ||
"python.analysis.typeCheckingMode": "basic", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from gevent import monkey | ||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
|
||
monkey.patch_all() | ||
|
||
|
||
# HERE | ||
from llm_convo.agents import OpenAIChat, TwilioCaller | ||
from llm_convo.twilio_io import TwilioServer | ||
from llm_convo.conversation import run_conversation | ||
import logging | ||
import time | ||
|
||
|
||
print("WERE DOING SOMETHING") | ||
|
||
logging.getLogger().setLevel(logging.INFO) | ||
|
||
tws = TwilioServer( | ||
remote_host="a8db-2603-8000-d100-14c9-810f-3c78-5c9a-603.ngrok.io", | ||
port=8080, | ||
static_dir=r"/static", | ||
) | ||
# Point twilio voice webhook to https://abcdef.ngrok.app/audio/incoming-voice | ||
tws.start() | ||
|
||
# agent_a = OpenAIChat( | ||
# system_prompt="You are a Haiku Assistant. Answer whatever the user wants but always in a rhyming Haiku.", | ||
# init_phrase="This is Haiku Bot, how can I help you.", | ||
# ) | ||
agent_a = OpenAIChat( | ||
system_prompt=""" | ||
You are an ordering bot that is going to call a pizza place an order a pizza. | ||
When you need to say numbers space them out (e.g. 1 2 3) and do not respond with abbreviations. | ||
If they ask for information not known, make something up that's reasonable. | ||
|
||
The customer's details are: | ||
* Address: 1234 Candyland Road, Apt 506 | ||
* Credit Card: 1234 5555 8888 9999 (CVV: 010) | ||
* Name: Bob Joe | ||
* Order: 1 large pizza with only pepperoni | ||
""", | ||
init_phrase="Hi, I would like to order a pizza.", | ||
) | ||
|
||
|
||
def run_chat(sess): | ||
print("running chat", sess) | ||
agent_b = TwilioCaller(sess) | ||
while not agent_b.session.media_stream_connected(): | ||
time.sleep(0.1) | ||
run_conversation(agent_a, agent_b) | ||
|
||
|
||
tws.on_session = run_chat | ||
|
||
# You can also have ChatGPT actually start the call, e.g. for automated ordering | ||
tws.start_call("+15035761174") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these lines? We do not need API keys, API Secret, do we?