Skip to content

Commit

Permalink
Merge pull request mortium91#13 from mortium91/babyagiv3
Browse files Browse the repository at this point in the history
fixes babyagi and packages
  • Loading branch information
mortium91 committed Apr 18, 2023
2 parents 779dbb7 + e0c4a55 commit 04a501d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ To deploy LangChain Assistant for free on Replit:
- [Telegram guide](https://searchwith.ai/blog/your-own-chatgpt-ai-assistant-on-telegram-with-langchain)
- [WhatsApp Guide](https://searchwith.ai/blog/create-your-own-chatgpt-ai-assistant-on-whatsapp)
- [Guide to setup Zapier NLA](https://searchwith.ai/blog/let-chatgpt-manage-your-calendar-via-voice-on-telegram-and-whatsapp/)
- Facebook Messenger (guide coming soon)

### Prerequisites

Expand All @@ -64,7 +65,7 @@ To deploy LangChain Assistant for free on Replit:
ACCOUNT_SID= #Twilio
AUTH_TOKEN= #Twilio
TWILIO_WHATSAPP_NUMBER = #Twilio sandbox / business number
FACEBOOK_PAGE_ID= #for Facebook Messenger integration
FACEBOOK_PAGE_ID = #
```


Expand Down Expand Up @@ -105,5 +106,10 @@ https://api.telegram.org/bot{YOUR_TOKEN}/setWebhook?url={YOUR_WEBHOOK_ENDPOINT}
For more details, follow the Twilio tutorial: [Send and Receive Media Messages with WhatsApp in Python](https://www.twilio.com/docs/whatsapp/tutorial/send-and-receive-media-messages-whatsapp-python)


### Facebook Messenger

- More info soon. Info for now: https://support.twilio.com/hc/en-us/articles/360018783533-Integrating-Facebook-Messenger-with-Twilio-Flex


## How to set Google Calendar Event
- [Guide to setup Zapier NLA](https://searchwith.ai/blog/let-chatgpt-manage-your-calendar-via-voice-on-telegram-and-whatsapp/)
2 changes: 1 addition & 1 deletion app/babyagi.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ async def process_task(objective: str, chat_id: str, platform='telegram', client
"task": task['task_name'], "result": result})])

# Step 3: Create new tasks and reprioritize task list
if task_id_counter < 11:
if task_id_counter < 6:
print(f"tt: {task_id_counter}")
new_tasks = task_creation_agent(objective, enriched_result, task["task_name"], [
t["task_name"] for t in task_list])
Expand Down
1 change: 1 addition & 0 deletions app/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from langchain.chat_models import ChatOpenAI
from config import TEMPERATURE_VALUE
from langchain import OpenAI

def initialize_language_model(selected_model):
if selected_model == 'gpt-3':
Expand Down
13 changes: 6 additions & 7 deletions app/twilio_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ async def send_twilio_response(chat_id: str, message: str, platform: str = "what
if is_voice:
# Process voice messages
output = await process_voice_message(message, chat_id)
else:
elif BABYAGI and message.startswith("/task"):
if BABYAGI:
# Process text messages
if message.startswith("/task"):
task = message[5:]
await process_task(task, chat_id=chat_id, platform='twilio', client=None, base_url=None)
output = task
else:
output = await process_chat_message(message, chat_id)
task = message[5:]
await process_task(task, chat_id=chat_id, platform='twilio', client=None, base_url=None)
output = task
else:
output = await process_chat_message(message, chat_id)

# Initialize Twilio response
resp = MessagingResponse()
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
fastapi==0.91.0
httpx==0.23.1
langchain==0.0.124
openai==0.26.5
langchain==0.0.142
openai==0.27.2
python-telegram-bot==20.0
twilio==7.17.0
python-dotenv==0.21.1
numpy==1.23.5
uvicorn==0.21.1
librosa
python-multipart
pinecone-client==2.2.1
pinecone-client==2.2.1

0 comments on commit 04a501d

Please sign in to comment.