crewai-experiments icon indicating copy to clipboard operation
crewai-experiments copied to clipboard

How to use just gemini-pro model

Open dwk601 opened this issue 2 years ago • 1 comments

I imported the .env file with gemini api key, and un # to load gemini model to agents but I'm still getting an error, could you upload or show how to just use gemini-pro model.

Exception has occurred: ValidationError
1 validation error for Agent
  Value error, 1 validation error for ConversationSummaryMemory
llm
  Can't instantiate abstract class BaseLanguageModel with abstract methods agenerate_prompt, apredict, apredict_messages, generate_prompt, invoke, predict, predict_messages (type=type_error) [type=value_error, input_value={'role': 'Market Research...***'), temperature=0.1)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/value_error
  File "/home/dongwook/Project/personal/test.py", line 23, in <module>
    marketer = Agent(
pydantic_core._pydantic_core.ValidationError: 1 validation error for Agent
  Value error, 1 validation error for ConversationSummaryMemory
llm
  Can't instantiate abstract class BaseLanguageModel with abstract methods agenerate_prompt, apredict, apredict_messages, generate_prompt, invoke, predict, predict_messages (type=type_error) [type=value_error, input_value={'role': 'Market Research...***'), temperature=0.1)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/value_error

dwk601 avatar Jan 22 '24 20:01 dwk601

can you show the code of using gemini-pro model related? In my case, I can run it successfully, here is my code.

from langchain_google_genai import ChatGoogleGenerativeAI

llm_gemini = ChatGoogleGenerativeAI(
    model='gemini-pro', verbose=True, temperature=0.1, google_api_key=os.getenv('GEMINI_API_KEY')
)

...

explorer = Agent(
  ...
  llm=llm_gemini
)

dwgeneral avatar Mar 24 '24 08:03 dwgeneral