feat: expose main_version on /version endpoint (#2944)

This commit is contained in:
Nicolò Boschi 2024-07-26 13:56:18 +02:00 • committed by GitHub
commit 53084bcf92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 4 deletions

View file

@ -0,0 +1,15 @@
from langflow.components import prototypes
def test_python_function_component():
# Arrange
python_function_component = prototypes.PythonFunctionComponent()
# Act
# function must be a string representation
function = "def function():\n return 'Hello, World!'"
# result is the callable function
result = python_function_component.build(function)
# Assert
assert result() == "Hello, World!"