Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use just gemini-pro model #3

Open
dwk601 opened this issue Jan 22, 2024 · 1 comment
Open

How to use just gemini-pro model #3

dwk601 opened this issue Jan 22, 2024 · 1 comment

Comments

@dwk601
Copy link

dwk601 commented Jan 22, 2024

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
@dwgeneral
Copy link

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
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants