L6_collaboration_financial_analysis

I am trying to run the code in my own notebook in colab. The only change I make is I have added the 'llm' parameter to the agents as I wanted to test the functionality with other LLMs. When I passed gpt-4o, gpt-4o-mini, gpt-3.5-turbo and in fact gpt-4 also, I am getting the below error. What changes shall I make to make the code work? Appreciate inputs.

> Entering new CrewAgentExecutor chain...
I need to gather insights and alerts regarding significant market opportunities or threats for the selected stock (AAPL). To do this, I should delegate the task of monitoring and analyzing market data using statistical modeling and machine learning to the appropriate team member who is skilled in this area.

Action: Delegate work to co-worker  
Action Input: { "coworker": "Data Analyst", "task": "Continuously monitor and analyze market data for AAPL. Use statistical modeling and machine learning to identify trends and predict market movements.", "context": "The task involves gathering real-time market data for AAPL, performing statistical analysis to identify trends, and implementing machine learning algorithms to predict future market movements. The goal is to generate insights and alerts regarding significant market opportunities or threats related to AAPL. Please ensure that the analysis includes historical data, current market conditions, and any relevant news that could impact AAPL's stock performance." }   

I encountered an error while trying to use the tool. This was the error: Error code: 404 - {'error': {'message': 'This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?', 'type': 'invalid_request_error', 'param': 'model', 'code': None}}.
 Tool Delegate work to co-worker accepts these inputs: Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following co-workers: [Data Analyst, Trading Strategy Developer, Trade Advisor, Risk Advisor]
The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to exectue the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.

Thought: I need to gather insights and alerts regarding significant market opportunities or threats for the selected stock (AAPL). The task requires statistical modeling and machine learning expertise to effectively analyze the market data. I will delegate this task to the Data Analyst, as they are best suited for this work.

Action: Delegate work to co-worker  
Action Input: { "coworker": "Data Analyst", "task": "Continuously monitor and analyze market data for AAPL. Use statistical modeling and machine learning to identify trends and predict market movements.", "context": "The task involves gathering real-time market data for AAPL, performing statistical analysis to identify trends, and implementing machine learning algorithms to predict future market movements. The goal is to generate insights and alerts regarding significant market opportunities or threats related to AAPL. Please ensure that the analysis includes historical data, current market conditions, and any relevant news that could impact AAPL's stock performance." }   

I encountered an error while trying to use the tool. This was the error: Error code: 404 - {'error': {'message': 'This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?', 'type': 'invalid_request_error', 'param': 'model', 'code': None}}.
 Tool Delegate work to co-worker accepts these inputs: Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following co-workers: [Data Analyst, Trading Strategy Developer, Trade Advisor, Risk Advisor]
The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to exectue the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.