-
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
fix: Make from_template_and_variables async for backwards compatibility, add sync version, add tests and small fixes #4500
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
dosubot
bot
added
the
size:L
This PR changes 100-499 lines, ignoring generated files.
label
Nov 11, 2024
github-actions
bot
added
bug
Something isn't working
and removed
bug
Something isn't working
labels
Nov 11, 2024
dosubot
bot
added
size:XXL
This PR changes 1000+ lines, ignoring generated files.
and removed
size:L
This PR changes 100-499 lines, ignoring generated files.
labels
Nov 11, 2024
CodSpeed Performance ReportMerging #4500 will degrade performances by 17%Comparing Summary
Benchmarks breakdown
|
ogabrielluiz
force-pushed
the
prompt-tests-backwards
branch
from
November 11, 2024 19:55
2c37d7c
to
f0f9efc
Compare
edwinjosechittilappilly
approved these changes
Nov 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ogabrielluiz
force-pushed
the
prompt-tests-backwards
branch
from
November 11, 2024 23:28
f0f9efc
to
230c51d
Compare
…or component identification
Add parameterized testing for supported versions and a validation for the latest PromptComponent. This improves test coverage and ensures compatibility across different versions.
…and add sync version
…ss starter projects JSON files.
…ctory handling - Introduced `async` in `test_message_prompt_serialization` for asynchronous message creation. - Added `test_message_sync_prompt_serialization` for synchronous message testing. - Updated cache directory paths to "langflow_test" for test isolation. - Utilized `monkeypatch` to set environment variable for cache directory in `langflow_cache_dir` fixture.
- Use `langflow_cache_dir` fixture in `test_message_with_single_image`. - Add assertion to verify the existence of `second_image`.
…stance_for_tests' function
…g and base class integration
…nd remove version tests
…thread usage in test.
ogabrielluiz
force-pushed
the
prompt-tests-backwards
branch
from
November 11, 2024 23:56
1dcae7b
to
994420d
Compare
…rompt_serialization
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request includes several updates to improve the handling of session IDs and prompt message construction across various components. The most important changes include adding checks for session IDs, updating prompt message construction methods, and modifying starter project templates.
Session ID Handling Improvements:
src/backend/base/langflow/base/agents/agent.py
: Added checks forgraph
and_session_id
attributes to setsession_id
in therun_agent
method.src/backend/base/langflow/custom/custom_component/component.py
: Added similar checks forgraph
and_session_id
attributes to setsession_id
in thebuild_results
method.Prompt Message Construction:
src/backend/base/langflow/components/prompts/prompt.py
: Updatedbuild_prompt
method to useMessage.from_template
instead ofMessage.from_template_and_variables
.Starter Project Template Updates:
Basic Prompting (Hello, World).json
(src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, World).jsonL426-R426)Blog Writer.json
Complex Agent.json
[1] [2]Other Code Improvements:
src/backend/base/langflow/custom/custom_component/custom_component.py
: Updatedtrace_name
property to use_id
instead of_vertex.id
.