majacinka / crewai-experiments

Experiments with local as well as models available through an api
779 stars 189 forks source link

How do I change the default GPT4-0613 model to "gpt-3.5-turbo-1106" #1

Closed nicekate closed 3 months ago

nicekate commented 5 months ago

How do I change the default GPT4-0613 model to "gpt-3.5-turbo-1106" in reddit_newsletter.py?

Look forward to the enthusiastic person to solve the doubt, thank you

majacinka commented 5 months ago

Hey! All you need to do is, import langchain openai integration tool and than, assign gpt-3.5 to every agent like this:

To import: from langchain_openai import ChatOpenAI

Assign that llm to EVERY agent. Just as an example, I'll show you on one agent:

critic = Agent(
    role="Expert Writing Critic",
    goal="Provide feedback and criticize blog post drafts. Make sure that the tone and writing style is compelling, simple and concise",
    backstory="""You are an Expert at providing feedback to the technical writers. You can tell when a blog text isn't concise,
  simple or engaging enough. You know how to provide helpful feedback that can improve any text. You know how to make sure that text 
  stays technical and insightful by using layman terms.
  """,
    verbose=True,
    allow_delegation=True,
    llm=ChatOpenAI(model_name="gpt-3.5-turbo-1106, temperature=0.7), # add this line
)
nicekate commented 5 months ago

Dear majacinka,your clear instructions were incredibly helpful and made the process straightforward.Thank you once again for your time and valuable insights.❤️May your youtube channel develop better and better.

majacinka commented 5 months ago

@nicekate aw that's so nice of you 🤗 thanks a lot and let me know if I can help in any way.