crypto_crewAI / run_local.py
quocdat25's picture
Upload folder using huggingface_hub
d9b1770 verified
raw
history blame
1.47 kB
# from langchain_community.llms import HuggingFaceEndpoint
# from langchain.prompts import PromptTemplate
# from langchain.schema import AIMessage, HumanMessage
# from langchain.chains import LLMChain
import gradio as gr
import os
from crew import CryptoCrew
from dotenv import load_dotenv
load_dotenv()
def predict(message):
# company = input(
# dedent("""
# Which cryptocurrency are you looking to delve into?
# """))
# history_langchain_format = []
# for human, ai in history:
# history_langchain_format.append(HumanMessage(content=human))
# history_langchain_format.append(AIMessage(content=ai))
# history_langchain_format.append(HumanMessage(content=message))
# gpt_response = llm(history_langchain_format)
# response = llm_chain.invoke(message)['text']
crypto_crew = CryptoCrew(company)
response = "## Here is the Report\n\n" + crypto_crew.run()
return response
gr.ChatInterface(predict).launch()
# if __name__ == "__main__":
# print("## Welcome to Crypto Analysis Crew")
# print('-------------------------------')
# company = input(
# dedent("""
# Which cryptocurrency are you looking to delve into?
# """))
# crypto_crew = CryptoCrew(company)
# result = crypto_crew.run()
# print("\n\n########################")
# print("## Here is the Report")
# print("########################\n")
# print(result)