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

chore: deprecate text based way of generating JSON #920

Merged

Conversation

monilpat
Copy link
Collaborator

@monilpat monilpat commented Dec 8, 2024

Relates to:

N/A prevent future folks from using the untyped version generateObject so folks use generateObjectV2 which is typesafe. Just a rename for now to reduce risk of regression. We will clean up old usages separately.

Risks

Low

  • Existing functionality will continue to work but will display a deprecation warning.
  • No impact on downstream systems expected.
  • Risk is isolated to developers relying on raw text-based JSON generation.

Background

What does this PR do?

This PR deprecates the text-based way of generating JSON objects using LLMs and so folks use generatedObjectV2 with typesafe structured outputs. Method isn't removed yet it is deprecated.

What kind of change is this?

  • Improvements: Transitioning to a more robust way of handling JSON outputs.
  • Chore: Deprecation of legacy behavior.

Why are we doing this? Any context or related work?

Text-based generation of JSON using LLMs is prone to errors like missing brackets, invalid types, or inconsistent structures. Moving to a typesafe structured output guarantees that JSON complies with predefined schemas, improving both developer experience and system stability.

Documentation changes needed?

  • My changes require a change to the project documentation.
  • Updated docs to:
    • Reflect new structured output implementation.
    • Mark text-based generation as deprecated.

Testing

Where should a reviewer start?

Detailed testing steps

N/A just a rename

Deploy Notes

No special deployment steps required.

Database changes

None.

Deployment instructions

Standard deployment process applies.

Discord username

0x8664


@monilpat monilpat marked this pull request as ready for review December 8, 2024 17:19
@cygaar cygaar merged commit 75a4655 into elizaOS:main Dec 8, 2024
4 checks passed
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