langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Nested models & exclude fields

Open L4rryFisherman opened this issue 1 year ago • 2 comments

Description: Add functionalities to the parser and output formatter:

  • Recursively retrieves fields from any nested models
  • Takes an optional list of fields of the (nested) model(s) to be excluded.
  • If any required fields are specified as excluded, the class will throw a warning and create a new Pydantic model is created for output instructions, and to parse against.

Dependencies:

  • warnings

Tag maintainer: @baskaryan

Please let me know if I should satisfy any additional requirements! :)

L4rryFisherman avatar Jul 08 '23 12:07 L4rryFisherman

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jul 9, 2023 11:57am

vercel[bot] avatar Jul 08 '23 12:07 vercel[bot]

Added a commit to address lint errors:

  • Explicitly prevent in on optional lists
  • Provide type for json_object

L4rryFisherman avatar Jul 08 '23 12:07 L4rryFisherman

not sure i fully understand the use case — could you provide an example of how new functionality would be used?

would also be great to add some unit tests, imagine those would also clarify

baskaryan avatar Jul 12 '23 00:07 baskaryan

@L4rryFisherman Hi , could you, please, resolve the merging issues and address the last comments (if needed)? After that, ping me and I push this PR for the review. Thanks!

leo-gan avatar Sep 18 '23 23:09 leo-gan

Closing because the PR wouldn't line up with the current directory structure of the library (would need to be in /libs/langchain/langchain instead of /langchain). Feel free to reopen against the current head if it's still relevant!

efriis avatar Nov 07 '23 03:11 efriis