vellum-ai 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/__init__.py +18 -1
- vellum/client/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/errors/__init__.py +10 -1
- vellum/client/errors/too_many_requests_error.py +11 -0
- vellum/client/errors/unauthorized_error.py +11 -0
- vellum/client/reference.md +94 -0
- vellum/client/resources/__init__.py +2 -0
- vellum/client/resources/events/__init__.py +4 -0
- vellum/client/resources/events/client.py +165 -0
- vellum/client/resources/events/raw_client.py +207 -0
- vellum/client/types/__init__.py +6 -0
- vellum/client/types/error_detail_response.py +22 -0
- vellum/client/types/event_create_response.py +26 -0
- vellum/client/types/execution_thinking_vellum_value.py +1 -1
- vellum/client/types/thinking_vellum_value.py +1 -1
- vellum/client/types/thinking_vellum_value_request.py +1 -1
- vellum/client/types/workflow_event.py +33 -0
- vellum/errors/too_many_requests_error.py +3 -0
- vellum/errors/unauthorized_error.py +3 -0
- vellum/resources/events/__init__.py +3 -0
- vellum/resources/events/client.py +3 -0
- vellum/resources/events/raw_client.py +3 -0
- vellum/types/error_detail_response.py +3 -0
- vellum/types/event_create_response.py +3 -0
- vellum/types/workflow_event.py +3 -0
- vellum/workflows/nodes/displayable/bases/api_node/node.py +4 -0
- vellum/workflows/nodes/displayable/bases/api_node/tests/test_node.py +26 -0
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +6 -1
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/tests/test_inline_prompt_node.py +22 -0
- vellum/workflows/sandbox.py +6 -3
- vellum/workflows/state/encoder.py +19 -1
- vellum/workflows/utils/hmac.py +44 -0
- {vellum_ai-1.2.0.dist-info → vellum_ai-1.2.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.2.0.dist-info → vellum_ai-1.2.1.dist-info}/RECORD +46 -28
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +33 -7
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +239 -1
- vellum_ee/workflows/display/tests/test_base_workflow_display.py +53 -1
- vellum_ee/workflows/display/utils/expressions.py +4 -0
- vellum_ee/workflows/display/utils/registry.py +46 -0
- vellum_ee/workflows/display/workflows/base_workflow_display.py +1 -1
- vellum_ee/workflows/tests/test_registry.py +169 -0
- vellum_ee/workflows/tests/test_server.py +72 -0
- {vellum_ai-1.2.0.dist-info → vellum_ai-1.2.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.2.0.dist-info → vellum_ai-1.2.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.2.0.dist-info → vellum_ai-1.2.1.dist-info}/entry_points.txt +0 -0
@@ -8,6 +8,7 @@ from vellum.client.types.number_vellum_value import NumberVellumValue
|
|
8
8
|
from vellum.workflows import BaseWorkflow
|
9
9
|
from vellum.workflows.nodes import BaseNode
|
10
10
|
from vellum.workflows.state.context import WorkflowContext
|
11
|
+
from vellum_ee.workflows.display.workflows.base_workflow_display import BaseWorkflowDisplay
|
11
12
|
from vellum_ee.workflows.server.virtual_file_loader import VirtualFileFinder
|
12
13
|
|
13
14
|
|
@@ -494,3 +495,74 @@ class MapNodeWorkflow(BaseWorkflow):
|
|
494
495
|
|
495
496
|
# AND we get the map node results as a list
|
496
497
|
assert event.body.outputs == {"results": [1.0, 1.0, 1.0]}
|
498
|
+
|
499
|
+
|
500
|
+
def test_serialize_module__tool_calling_node_with_single_tool():
|
501
|
+
"""Test that serialize_module works with a tool calling node that has a single tool."""
|
502
|
+
|
503
|
+
# GIVEN a simple tool function
|
504
|
+
tool_function_code = '''def get_weather(location: str) -> str:
|
505
|
+
"""Get the current weather for a location."""
|
506
|
+
return f"The weather in {location} is sunny."
|
507
|
+
'''
|
508
|
+
|
509
|
+
# AND a workflow module with a tool calling node using that single tool
|
510
|
+
files = {
|
511
|
+
"__init__.py": "",
|
512
|
+
"workflow.py": """
|
513
|
+
from vellum.workflows import BaseWorkflow
|
514
|
+
from vellum.workflows.nodes.displayable.tool_calling_node import ToolCallingNode
|
515
|
+
from vellum.workflows.state.base import BaseState
|
516
|
+
from vellum.workflows.workflows.base import BaseInputs
|
517
|
+
from vellum.client.types.chat_message_prompt_block import ChatMessagePromptBlock
|
518
|
+
from vellum.client.types.plain_text_prompt_block import PlainTextPromptBlock
|
519
|
+
from vellum.client.types.rich_text_prompt_block import RichTextPromptBlock
|
520
|
+
from vellum.client.types.variable_prompt_block import VariablePromptBlock
|
521
|
+
|
522
|
+
from .get_weather import get_weather
|
523
|
+
|
524
|
+
|
525
|
+
class Inputs(BaseInputs):
|
526
|
+
location: str
|
527
|
+
|
528
|
+
|
529
|
+
class WeatherNode(ToolCallingNode):
|
530
|
+
ml_model = "gpt-4o-mini"
|
531
|
+
blocks = [
|
532
|
+
ChatMessagePromptBlock(
|
533
|
+
chat_role="USER",
|
534
|
+
blocks=[
|
535
|
+
RichTextPromptBlock(
|
536
|
+
blocks=[
|
537
|
+
VariablePromptBlock(
|
538
|
+
input_variable="location",
|
539
|
+
),
|
540
|
+
],
|
541
|
+
),
|
542
|
+
],
|
543
|
+
),
|
544
|
+
]
|
545
|
+
functions = [get_weather]
|
546
|
+
prompt_inputs = {
|
547
|
+
"location": Inputs.location,
|
548
|
+
}
|
549
|
+
|
550
|
+
|
551
|
+
class Workflow(BaseWorkflow[Inputs, BaseState]):
|
552
|
+
graph = WeatherNode
|
553
|
+
|
554
|
+
class Outputs(BaseWorkflow.Outputs):
|
555
|
+
result = WeatherNode.Outputs.text
|
556
|
+
""",
|
557
|
+
"get_weather.py": tool_function_code,
|
558
|
+
}
|
559
|
+
|
560
|
+
namespace = str(uuid4())
|
561
|
+
|
562
|
+
# AND the virtual file loader is registered
|
563
|
+
sys.meta_path.append(VirtualFileFinder(files, namespace))
|
564
|
+
|
565
|
+
result = BaseWorkflowDisplay.serialize_module(namespace)
|
566
|
+
|
567
|
+
# THEN the serialization should complete successfully
|
568
|
+
assert result is not None
|
File without changes
|
File without changes
|
File without changes
|