Closed pravincoder closed 1 month ago
its in the error message. possibly you are using crew_output.result
we introduced a breaking change there. Remove .result
or use .raw
@lorenzejay
I am just using crew.kickoff()
in my code ,here is my main.py file code ,
Note:- This main file does not include Task,Agent,tool as there are seperate file for each .
main.py
import logging
from dotenv import load_dotenv
from crewai import Crew
from task import Stock_bot
from agents import Stock_bot_agents
def main():
load_dotenv()
print("#### -----WELCOME TO STOCK ANALYSIS BOT -----####")
print("------_____________________________________------")
print("Enter the stock name you want to analyze:")
stock = input()
print(f"Stock name entered: {stock}")
tasks = Stock_bot()
agent = Stock_bot_agents()
# Create agents
stock_analysis = agent.stock_anaylsis()
investment_analysis = agent.investment_analysis()
# Create tasks
stock_analysis_task = tasks.stock_analysis(stock_analysis,stock)
investment_analysis_task = tasks.investment_analysis(investment_analysis,stock)
# Execute tasks
print("Creating Crew instance >>>>")
crew = Crew(
agents=[
stock_analysis,
investment_analysis
],
tasks=[
stock_analysis_task,
investment_analysis_task
],
)
try:
result = crew.kickoff()
logging.info("Crew kickoff executed successfully.")
print(f"Result: {result}")
except Exception as e:
logging.error(f"Error during crew kickoff: {e}")
# Save the result to a text file
try:
with open('result.txt', 'w') as file:
file.write(str(result))
logging.info("Result saved to result.txt successfully.")
except Exception as e:
logging.error(f"Error saving result to file: {e}")
if __name__ == '__main__':
main()
The ERROR messange is saying result's because i am using a parameter 'result' to save the output generated by crew
Just build a small Stock Analysis and Investment Bot, it was working fine but now I only se empty chains . Output:-
Then i used LangSmith to check the underlying process of crew and llms , here i got to see an error :- LangSmith Error :-
For this project i am using ollama (mistral) model ,below usage code
but i tested it with Groq :- the Output was exactly the same Chain were'nt generating any output ,