Skip to content

Commit

Permalink
tutorial108
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Aug 24, 2024
1 parent f3a917d commit 608e99c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
Binary file added tutorial108/__pycache__/emailAgent.cpython-312.pyc
Binary file not shown.
14 changes: 14 additions & 0 deletions tutorial108/emailAgent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from langchain.agents.agent_toolkits import GmailToolkit
from langchain_openai import ChatOpenAI
from langchain.agents import AgentType,initialize_agent

toolkit=GmailToolkit()
llm=ChatOpenAI(model="gpt-4o")
agent=initialize_agent(tools=toolkit.get_tools(),llm=llm,verbose=True,max_iterations=1000,max_execution_time=1600,agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION)
#agent.handle_parsing_errors=True
def runAgent(input):
try:
response=agent.run(input)
return response
except Exception as e:
return response
10 changes: 10 additions & 0 deletions tutorial108/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from streamlit_mic_recorder import speech_to_text
import streamlit as st
from emailAgent import runAgent

st.title("your one stop voice enable email Assistant")
st.write("instruct your voice and see the magic")
text=speech_to_text(language="en",use_container_width=True,just_once=True,key="STT")
if text:
response=runAgent(text)
st.write(response)
Binary file added tutorial108/tutorial108.pptx
Binary file not shown.
Empty file removed tutorial8/credentials.json
Empty file.
1 change: 0 additions & 1 deletion tutorial8/token.json

This file was deleted.

0 comments on commit 608e99c

Please sign in to comment.