Skip to content

intermediate_steps not returned on exceptions #168

@jordi-mas-dj

Description

@jordi-mas-dj

Environment details

  • OS type and version: Linux
  • Python version: 3.10
  • pip version:
  • langchain-google-spanner version 0.81

Solution

See PR: #175

How to reproduce it

intermediate_steps is the only way that you can instrument what queries fail and why. This is key when your are working on automated systems to improve the QA/Verify/Fix prompts of the library.

However, when you reach max max_gql_fix_retries an exception is thrown:

https://github.com/googleapis/langchain-google-spanner-python/blob/main/src/langchain_google_spanner/graph_qa.py#L271

and then you do not get the intermediate_steps what prevents you to have the results of why the query has failed.

Request: please return intermediate_steps when there is an exception and intermediate_steps is true.

Why is this important:

  • Makes difficult to collect insights when queries fail and you are developing automated evaluation

Possible solution

Consider creating your own Spanner exception which returns also intermediate_steps

Note: If you fix this case, consider reviewing other exceptions like
https://github.com/googleapis/langchain-google-spanner-python/blob/main/src/langchain_google_spanner/graph_qa.py#L322

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/langchain-google-spanner-python API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions