-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: add StructuredOutput component #4024
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request is automatically being deployed by Amplify Hosting (learn more). |
I'm assuming this also applies to this PR |
It could but I'm considering something different. I'll push it as soon as I can. I'm considering building a component that builds the structured output using an llm. |
ogabrielluiz
changed the title
Update OpenAI model components
feat: add StructuredOutput component
Oct 7, 2024
ogabrielluiz
force-pushed
the
update-openai
branch
from
October 7, 2024 17:33
676fce7
to
46835a1
Compare
dosubot
bot
added
the
size:XL
This PR changes 500-999 lines, ignoring generated files.
label
Oct 7, 2024
italojohnny
approved these changes
Oct 7, 2024
ogabrielluiz
force-pushed
the
update-openai
branch
from
October 8, 2024 11:42
a5162c0
to
dc20c45
Compare
ogabrielluiz
force-pushed
the
update-openai
branch
from
October 11, 2024 12:16
5e4935a
to
fd8cdd3
Compare
ogabrielluiz
force-pushed
the
update-openai
branch
from
October 14, 2024 11:29
4ebd887
to
495b329
Compare
…l.py - Implement various test cases to validate the functionality of build_model_from_schema. - Test cases cover scenarios such as handling valid and empty schemas, managing unknown field types, and processing schemas with missing optional keys. - Ensure proper handling of nested list and dict types, and verify the function's efficiency with large schemas. - Confirm that the function raises exceptions for invalid input and handles duplicate field names correctly.
- Refactor `OpenAIModelComponent` to use `TableInput` for `output_schema` and integrate `build_model_from_schema`. - Modify `HierarchicalCrewComponent` to use unpacking for base inputs. - Ensure consistent import statements across JSON files. - Improve error handling and logging for vector store operations.
- Implement `build_messages_and_runnable` to construct message lists and configure runnable models. - Add `get_chat_result` to execute language models with input messages, supporting streaming and custom configurations. - Handle exceptions with optional custom error messages.
…and schema naming
…e from field creation
- Implement various test cases to ensure correct functionality of StructuredOutputComponent. - Test successful structured output generation, handling of unsupported language models, and correct output model building. - Validate handling of multiple outputs, empty and invalid output schemas, and nested schemas. - Include tests for large input values and invalid language model configurations.
Rename the test_base_model.py file to test_base_model_from_schema.py to better reflect its purpose of testing the build_model_from_schema function. This change improves code clarity and maintainability.
…odel_from_schema" This reverts commit 2e84a86.
- Refactored `OpenAIModelComponent` to use `operator.ior` and `functools.reduce` for converting `output_schema` to a dictionary. - Deprecated the `output_schema` field, updating its info to reflect the deprecation. - Simplified the `_docs_to_data` method in `SplitTextComponent` for better readability. - Updated import statements and removed unused imports across multiple JSON files.
ogabrielluiz
force-pushed
the
update-openai
branch
from
October 15, 2024 21:28
7e22b93
to
fe4dbd7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:XL
This PR changes 500-999 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenAIModelComponent
to useTableInput
foroutput_schema
and integratebuild_model_from_schema
.HierarchicalCrewComponent
to use unpacking for base inputs.