Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added automatic json extraction from the response #21

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

alicja-raczkowska
Copy link
Contributor

Feature Description

If output_data_model_class is provided and the LLM returns e.g. "Sure! This is the response {...}", the JSON should be extracted and parsed.

Added

Added JSON extraction from within the response text.

@riccardo-alle
Copy link
Contributor

@alicja-raczkowska I believe somewhere in the documentation we are saying that Llama/Mistral/Gemma don't support the output_dataclass argument because so far this feature you implemented was missing and we were relying only on pydantic <--> langchain integration. In that case, the documentation should be updated.

allms/models/abstract.py Outdated Show resolved Hide resolved
allms/domain/response.py Outdated Show resolved Hide resolved
allms/models/abstract.py Outdated Show resolved Hide resolved
@alicja-raczkowska
Copy link
Contributor Author

alicja-raczkowska commented Mar 22, 2024

@alicja-raczkowska I believe somewhere in the documentation we are saying that Llama/Mistral/Gemma don't support the output_dataclass argument because so far this feature you implemented was missing and we were relying only on pydantic <--> langchain integration. In that case, the documentation should be updated.

I modified the docs to address the format instruction changes.

@alicja-raczkowska alicja-raczkowska merged commit 79a0b38 into main Mar 22, 2024
2 checks passed
@alicja-raczkowska alicja-raczkowska deleted the response-json-extraction branch March 22, 2024 14:28
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.

3 participants