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

fix: Make from_template_and_variables async for backwards compatibility, add sync version, add tests and small fixes #4500

Merged
merged 34 commits into from
Nov 12, 2024

Conversation

ogabrielluiz
Copy link
Contributor

@ogabrielluiz ogabrielluiz commented Nov 11, 2024

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:

Prompt Message Construction:

Starter Project Template Updates:

  • Updated multiple starter project JSON files to reflect changes in prompt message construction:
    • 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:

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 11, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Nov 11, 2024
@dosubot 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
Copy link

codspeed-hq bot commented Nov 11, 2024

CodSpeed Performance Report

Merging #4500 will degrade performances by 17%

Comparing prompt-tests-backwards (0a55bc6) with main (8bb0f65)

Summary

❌ 2 regressions
✅ 13 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main prompt-tests-backwards Change
test_successful_run_with_input_type_text 455.7 ms 532.6 ms -14.43%
test_successful_run_with_output_type_any 378 ms 455.4 ms -17%

Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 11, 2024
Add parameterized testing for supported versions and a validation for the latest PromptComponent. This improves test coverage and ensures compatibility across different versions.
…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`.
@ogabrielluiz ogabrielluiz merged commit 768e6f0 into main Nov 12, 2024
29 checks passed
@ogabrielluiz ogabrielluiz deleted the prompt-tests-backwards branch November 12, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants