Skip to content

Object of type AgentAction is not JSON serializable #8815

Closed
@coreygarvey

Description

@coreygarvey

System Info

version 0.0.253

Running on a Jupyter Notebook in Google Colab

Who can help?

No response

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

Follow the steps in Access Intermediate Steps within the Agent "How To".

The final step calls for
print(json.dumps(response["intermediate_steps"], indent=2))

This is throwing the following error:
TypeError: Object of type AgentAction is not JSON serializable

Based on this issue I think it may be happening following a recent upgrade.

Expected behavior

Printing the intermediate steps as JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ɑ: agentRelated to agents module🤖:bugRelated to a bug, vulnerability, unexpected error with an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions