Skip to content

Object of type AgentAction is not JSON serializable #8815

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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