This file contains hidden or 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
from .models import * | |
from django.contrib.auth.models import User | |
def handleWhatsAppChat(fromId, profileName, phoneId, text): | |
##Check if there is a chat session | |
try: | |
chat = ChatSession.objects.get(profile__phoneNumber=fromId) | |
except: |
This file contains hidden or 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
from .aifile import * | |
import asyncio | |
loop = asyncio.new_event_loop() | |
## PDF Generation Stuff | |
import pdfkit | |
from django.template.loader import get_template | |
import os |
This file contains hidden or 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
# pip install streamlit | |
# pip install audio-recorder-streamlit | |
# pip install openai | |
import streamlit as st | |
from audio_recorder_streamlit import audio_recorder | |
from openai import OpenAI | |
API_KEY = 'enter-openai-api-key-here' | |
This file contains hidden or 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
from openai import OpenAI | |
import config | |
import os | |
def createAssistant(file_ids, title): | |
#Create the OpenAI Client Instance | |
client = OpenAI(api_key=config.API_KEY) |
This file contains hidden or 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
import streamlit as st | |
from assistant import * | |
import time | |
def process_run(st, thread_id, assistant_id): | |
# Run the Assistant | |
run_id = runAssistant(thread_id, assistant_id) | |
status = 'running' | |
# Check Status Session |
OlderNewer