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

Recent tags change causes AttributeError: 'str' object has no attribute 'value' on initialize_agent call #6756

Closed
1 of 14 tasks
LittleColin opened this issue Jun 26, 2023 · 4 comments · Fixed by #6765
Closed
1 of 14 tasks
Labels
01 bug Confirmed bug

Comments

@LittleColin
Copy link

System Info

  • Langchain: 0.0.215
  • Platform: ubuntu
  • Python 3.10.12

Who can help?

@vowelparrot

https://github.com/hwchase17/langchain/blob/d84a3bcf7ab3edf8fe1d49083e066d51c9b5f621/langchain/agents/initialize.py#L54

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

Fails if agent initialized as follows:

agent = initialize_agent(
        agent='zero-shot-react-description',
        tools=tools,
        llm=llm,
        verbose=True,
        max_iterations=30,
        memory=ConversationBufferMemory(),
        handle_parsing_errors=True)

With

...
lib/python3.10/site-packages/langchain/agents/initialize.py", line 54, in initialize_agent
    tags_.append(agent.value)
AttributeError: 'str' object has no attribute 'value'

Expected behavior

Expected to work as before where agent is specified as a string (or if this is highlighting that agent should actually be an object, it should indicate that instead of the error being shown).

@dosubot dosubot bot added the 01 bug Confirmed bug label Jun 26, 2023
@nithinjp1997
Copy link
Contributor

nithinjp1997 commented Jun 26, 2023

yes i also got this error too. Apparently we have to use AgentType.ZERO_SHOT_REACT_DESCRIPTION , the old way of using just strings has been changed . At the very least they could have shown an exception error instead of this jargon.

@Zero-coder
Copy link

agree!the same to me!

@vowelparrot
Copy link
Contributor

Will land a fix. Thanks for raising this!

@vowelparrot vowelparrot reopened this Jun 26, 2023
hwchase17 pushed a commit that referenced this issue Jun 26, 2023
Fix tags change that broke old way of initializing agent

Closes #6756
@Zero-coder
Copy link

Will land a fix. Thanks for raising this!

Thank you,it's working now.

kacperlukawski pushed a commit to kacperlukawski/langchain that referenced this issue Jun 29, 2023
Fix tags change that broke old way of initializing agent

Closes langchain-ai#6756
aerrober pushed a commit to aerrober/langchain-fork that referenced this issue Jul 24, 2023
Fix tags change that broke old way of initializing agent

Closes langchain-ai#6756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 bug Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants