langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
35.41k stars 4.21k forks source link

fix: Add validation for MessageBase type in message input conversion #4769

Closed ogabrielluiz closed 3 days ago

ogabrielluiz commented 3 days ago

This PR introduces validation for the MessageBase type within the message input conversion process. It ensures that if an instance of MessageBase is provided, it is correctly transformed into a Message object using the model's data. This enhancement improves the robustness of input handling in the application.

This helps when you create a component, call send_message passing a Message and then return the result of the call (which now is a MessageRead, not a Message anymore).

codspeed-hq[bot] commented 3 days ago

CodSpeed Performance Report

Merging #4769 will degrade performances by 28.39%

Comparing fix-messageinput-validation (baf1f8d) with main (e728e40)

Summary

❌ 3 regressions
✅ 12 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main fix-messageinput-validation Change
test_successful_run_with_input_type_any 232.2 ms 324.3 ms -28.39%
test_successful_run_with_output_type_any 233 ms 266.3 ms -12.49%
test_successful_run_with_output_type_debug 230.4 ms 321.2 ms -28.27%