Skip to content

Conversation

@TwistingTwists
Copy link
Contributor

  • compatilbe with LangChain.MessageProcessors

In RequestJson adapter, currently, the JsonProcesser is used (default) as given by the LangChain lib.

allow passing a custom json processor.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

- compatilbe with LangChain.MessageProcessors
@TwistingTwists
Copy link
Contributor Author

I have tested this with a custom json processor I wrote.

- `:max_retries` - Maximum number of retry attempts for invalid JSON (default: 3)
- `:json_format` - Format to request JSON in (:markdown, :xml) (default: :markdown)
- `:json_processor` - Custom JSON processor function compatible with `JsonProcessor.new` type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave out this firs line. Also, we should have these types properly link to the docs in LangChain. You can run mix docs locally to see that . Use things like t:LangChain.Something.message_processor(). Then , you don't have to copy the type here, because they will see the type on hover etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrey.
Good idea! Will do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachdaniel ready for your review

@zachdaniel zachdaniel merged commit 01f842f into ash-project:main Jun 29, 2025
22 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants