Skip to content

Commit 04a7df9

Browse files
author
wayflow-bot
committed
Merge branch 'missing-agentir-plugins' into 'main'
Add missing agentir-wayflowcore plugins See merge request wayflow-dev/wayflow-public!188
2 parents d35f3d3 + a5521e8 commit 04a7df9

29 files changed

+1545
-297
lines changed

wayflowcore/src/wayflowcore/agentir/_agentirconverter.py

Lines changed: 297 additions & 57 deletions
Large diffs are not rendered by default.

wayflowcore/src/wayflowcore/agentir/_runtimeconverter.py

Lines changed: 258 additions & 55 deletions
Large diffs are not rendered by default.

wayflowcore/src/wayflowcore/agentir/components/__init__.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@
55
from .contextprovider import (
66
PluginConstantContextProvider,
77
PluginContextProvider,
8+
PluginFlowContextProvider,
9+
PluginToolContextProvider,
810
contextprovider_deserialization_plugin,
911
contextprovider_serialization_plugin,
1012
)
1113
from .datastores.plugin import (
1214
wayflowcore_datastore_deserialization_plugin,
1315
wayflowcore_datastore_serialization_plugin,
1416
)
17+
from .embeddingmodels import (
18+
PluginEmbeddingConfig,
19+
PluginOciGenAiEmbeddingConfig,
20+
PluginOllamaEmbeddingConfig,
21+
PluginOpenAiCompatibleEmbeddingConfig,
22+
PluginOpenAiEmbeddingConfig,
23+
PluginVllmEmbeddingConfig,
24+
embeddingmodel_deserialization_plugin,
25+
embeddingmodel_serialization_plugin,
26+
)
1527
from .flow import ExtendedFlow, flow_deserialization_plugin, flow_serialization_plugin
1628
from .managerworkers import (
1729
PluginManagerWorkers,
@@ -32,11 +44,14 @@
3244
ExtendedToolNode,
3345
PluginCatchExceptionNode,
3446
PluginChoiceNode,
47+
PluginConstantValuesNode,
3548
PluginExtractNode,
49+
PluginGetChatHistoryNode,
3650
PluginInputMessageNode,
3751
PluginOutputMessageNode,
3852
PluginReadVariableNode,
3953
PluginRegexNode,
54+
PluginRetryNode,
4055
PluginTemplateNode,
4156
PluginWriteVariableNode,
4257
nodes_deserialization_plugin,
@@ -71,6 +86,7 @@
7186
PluginMessageTransform,
7287
PluginReactMergeToolRequestAndCallsTransform,
7388
PluginRemoveEmptyNonUserMessageTransform,
89+
PluginSwarmToolRequestAndCallsTransform,
7490
messagetransform_deserialization_plugin,
7591
messagetransform_serialization_plugin,
7692
)
@@ -88,6 +104,7 @@
88104
messagetransform_serialization_plugin,
89105
prompttemplate_serialization_plugin,
90106
outputparser_serialization_plugin,
107+
embeddingmodel_serialization_plugin,
91108
]
92109

93110

@@ -104,6 +121,7 @@
104121
messagetransform_deserialization_plugin,
105122
prompttemplate_deserialization_plugin,
106123
outputparser_deserialization_plugin,
124+
embeddingmodel_deserialization_plugin,
107125
]
108126

109127

@@ -138,20 +156,26 @@
138156
"PluginRegexNode",
139157
"PluginWriteVariableNode",
140158
"PluginReadVariableNode",
159+
"PluginConstantValuesNode",
160+
"PluginGetChatHistoryNode",
161+
"PluginRetryNode",
141162
"nodes_serialization_plugin",
142163
"nodes_deserialization_plugin",
143164
"ExtendedFlow",
144165
"flow_serialization_plugin",
145166
"flow_deserialization_plugin",
146167
"PluginConstantContextProvider",
147168
"PluginContextProvider",
169+
"PluginFlowContextProvider",
170+
"PluginToolContextProvider",
148171
"contextprovider_serialization_plugin",
149172
"contextprovider_deserialization_plugin",
150173
"PluginAppendTrailingSystemMessageToUserMessageTransform",
151174
"PluginMessageTransform",
152175
"PluginCoalesceSystemMessagesTransform",
153176
"PluginRemoveEmptyNonUserMessageTransform",
154177
"PluginReactMergeToolRequestAndCallsTransform",
178+
"PluginSwarmToolRequestAndCallsTransform",
155179
"messagetransform_serialization_plugin",
156180
"messagetransform_deserialization_plugin",
157181
"PluginPromptTemplate",
@@ -171,4 +195,19 @@
171195
"wayflowcore_datastore_serialization_plugin",
172196
"wayflowcore_datastore_deserialization_plugin",
173197
"PluginManagerWorkers",
198+
"PluginAppendTrailingSystemMessageToUserMessageTransform",
199+
"PluginCoalesceSystemMessagesTransform",
200+
"PluginMessageTransform",
201+
"PluginReactMergeToolRequestAndCallsTransform",
202+
"PluginRemoveEmptyNonUserMessageTransform",
203+
"messagetransform_deserialization_plugin",
204+
"messagetransform_serialization_plugin",
205+
"PluginEmbeddingConfig",
206+
"PluginVllmEmbeddingConfig",
207+
"PluginOllamaEmbeddingConfig",
208+
"PluginOciGenAiEmbeddingConfig",
209+
"PluginOpenAiCompatibleEmbeddingConfig",
210+
"PluginOpenAiEmbeddingConfig",
211+
"embeddingmodel_deserialization_plugin",
212+
"embeddingmodel_serialization_plugin",
174213
]

wayflowcore/src/wayflowcore/agentir/components/contextprovider.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Copyright © 2025 Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
from typing import Any
4+
from typing import Any, List, Optional
55

6+
from pyagentir.flows.flow import Flow
67
from pyagentir.flows.node import Node
8+
from pyagentir.tools import ServerTool
79
from pyagentir.validation_helpers import model_validator_with_error_accumulation
10+
from pydantic import SerializeAsAny
811
from typing_extensions import Self
912

1013
from wayflowcore.agentir.components._pydantic_plugins import (
@@ -33,17 +36,39 @@ class PluginConstantContextProvider(PluginContextProvider):
3336
"""The value that this context provider should always return"""
3437

3538

39+
class PluginToolContextProvider(PluginContextProvider):
40+
"""Context provider that returns the output of a Server Tool"""
41+
42+
tool: SerializeAsAny[ServerTool]
43+
"""Server tool to execute to get the context provider value"""
44+
output_name: str
45+
"""Name of the output of the context provider"""
46+
47+
48+
class PluginFlowContextProvider(PluginContextProvider):
49+
"""Context provider that uses a flow to compute some values"""
50+
51+
flow: SerializeAsAny[Flow]
52+
"""Flow to execute to get the value of the context provider"""
53+
output_names: Optional[List[str]] = None
54+
"""Names of the flow outputs to return"""
55+
56+
3657
CONTEXTPROVIDER_PLUGIN_NAME = "ContextProviderPlugin"
3758

3859
contextprovider_serialization_plugin = PydanticComponentSerializationPlugin(
3960
name=CONTEXTPROVIDER_PLUGIN_NAME,
4061
component_types_and_models={
41-
PluginConstantContextProvider.__name__: PluginConstantContextProvider
62+
PluginConstantContextProvider.__name__: PluginConstantContextProvider,
63+
PluginToolContextProvider.__name__: PluginToolContextProvider,
64+
PluginFlowContextProvider.__name__: PluginFlowContextProvider,
4265
},
4366
)
4467
contextprovider_deserialization_plugin = PydanticComponentDeserializationPlugin(
4568
name=CONTEXTPROVIDER_PLUGIN_NAME,
4669
component_types_and_models={
47-
PluginConstantContextProvider.__name__: PluginConstantContextProvider
70+
PluginConstantContextProvider.__name__: PluginConstantContextProvider,
71+
PluginToolContextProvider.__name__: PluginToolContextProvider,
72+
PluginFlowContextProvider.__name__: PluginFlowContextProvider,
4873
},
4974
)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright © 2025 Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
5+
from pyagentir import Component
6+
from pyagentir.component import SerializeAsEnum
7+
from pyagentir.llms.ociclientconfig import OciClientConfig
8+
from pydantic import SerializeAsAny
9+
10+
from wayflowcore.agentir.components._pydantic_plugins import (
11+
PydanticComponentDeserializationPlugin,
12+
PydanticComponentSerializationPlugin,
13+
)
14+
from wayflowcore.models.ocigenaimodel import ServingMode
15+
16+
17+
class PluginEmbeddingConfig(Component, abstract=True):
18+
"""Embedding models are components that can transform text into float vectors, to be used later
19+
for retrieval for example."""
20+
21+
22+
class PluginOciGenAiEmbeddingConfig(PluginEmbeddingConfig):
23+
"""
24+
Class to configure a connection to a OCI GenAI hosted embedding model.
25+
26+
Requires to specify the model id, compartment id and the client configuration to the OCI GenAI service.
27+
"""
28+
29+
model_id: str
30+
"""ID of the model to use"""
31+
compartment_id: str
32+
"""ID of the compartment to use"""
33+
client_config: SerializeAsAny[OciClientConfig]
34+
"""Client configuration to connect to the Oci GenAI service"""
35+
serving_mode: SerializeAsEnum[ServingMode] = ServingMode.ON_DEMAND
36+
"""The serving mode of this remote Oci GenAI embedding model"""
37+
38+
39+
class PluginOpenAiCompatibleEmbeddingConfig(PluginEmbeddingConfig):
40+
"""
41+
Class to configure a connection to an openai-compatible remotely hosted embedding model.
42+
43+
Requires to specify the url at which the instance is running.
44+
"""
45+
46+
url: str
47+
"""Url of the model deployment"""
48+
model_id: str
49+
"""ID of the model to use"""
50+
51+
52+
class PluginOllamaEmbeddingConfig(PluginOpenAiCompatibleEmbeddingConfig):
53+
"""
54+
Class to configure a connection to a local embedding model ran with Ollama.
55+
56+
Requires to specify the url and port at which the model is running.
57+
"""
58+
59+
60+
class PluginOpenAiEmbeddingConfig(PluginEmbeddingConfig):
61+
"""
62+
Class to configure a connection to a OpenAI embedding model.
63+
64+
Requires to specify the name of the model to use.
65+
"""
66+
67+
model_id: str
68+
"""ID of the model to use"""
69+
70+
71+
class PluginVllmEmbeddingConfig(PluginOpenAiCompatibleEmbeddingConfig):
72+
"""
73+
Class to configure a connection to a vLLM-hosted embedding model.
74+
75+
Requires to specify the url at which the instance is running.
76+
"""
77+
78+
79+
EMBEDDINGMODEL_PLUGIN_NAME = "EmbeddingModelPlugin"
80+
81+
embeddingmodel_serialization_plugin = PydanticComponentSerializationPlugin(
82+
name=EMBEDDINGMODEL_PLUGIN_NAME,
83+
component_types_and_models={
84+
PluginOciGenAiEmbeddingConfig.__name__: PluginOciGenAiEmbeddingConfig,
85+
PluginOllamaEmbeddingConfig.__name__: PluginOllamaEmbeddingConfig,
86+
PluginOpenAiEmbeddingConfig.__name__: PluginOpenAiEmbeddingConfig,
87+
PluginVllmEmbeddingConfig.__name__: PluginVllmEmbeddingConfig,
88+
PluginOpenAiCompatibleEmbeddingConfig.__name__: PluginOpenAiCompatibleEmbeddingConfig,
89+
},
90+
)
91+
embeddingmodel_deserialization_plugin = PydanticComponentDeserializationPlugin(
92+
name=EMBEDDINGMODEL_PLUGIN_NAME,
93+
component_types_and_models={
94+
PluginOciGenAiEmbeddingConfig.__name__: PluginOciGenAiEmbeddingConfig,
95+
PluginOllamaEmbeddingConfig.__name__: PluginOllamaEmbeddingConfig,
96+
PluginOpenAiEmbeddingConfig.__name__: PluginOpenAiEmbeddingConfig,
97+
PluginVllmEmbeddingConfig.__name__: PluginVllmEmbeddingConfig,
98+
PluginOpenAiCompatibleEmbeddingConfig.__name__: PluginOpenAiCompatibleEmbeddingConfig,
99+
},
100+
)

0 commit comments

Comments
 (0)