You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adalflow/adalflow/core/generator.py
+4-30Lines changed: 4 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -70,21 +70,11 @@ class Generator(GradComponent, CachedEngine, CallbackManager):
70
70
template (Optional[str], optional): The template for the prompt. Defaults to :ref:`DEFAULT_ADALFLOW_SYSTEM_PROMPT<core-default_prompt_template>`.
71
71
prompt_kwargs (Optional[Dict], optional): The preset prompt kwargs to fill in the variables in the prompt. Defaults to None.
72
72
output_processors (Optional[Component], optional): The output processors after model call. It can be a single component or a chained component via ``Sequential``. Defaults to None.
73
-
trainable_params (Optional[List[str]], optional): The list of trainable parameters. Defaults to [].
74
-
75
-
Note:
76
-
The output_processors will be applied to the string output of the model completion. And the result will be stored in the data field of the output.
77
-
And we encourage you to only use it to parse the response to data format you will use later.
73
+
name (Optional[str], optional): The name of the generator. Defaults to None.
74
+
cache_path (Optional[str], optional): The path to save the cache. Defaults to None.
75
+
use_cache (bool, optional): Whether to use cache. Defaults to False.
78
76
"""
79
77
80
-
model_type: ModelType=ModelType.LLM
81
-
model_client: ModelClient# for better type checking
82
-
83
-
_use_cache: bool=False
84
-
_kwargs: Dict[str, Any] = (
85
-
{}
86
-
) # to create teacher generator from student TODO: might reaccess this
87
-
88
78
def__init__(
89
79
self,
90
80
*,
@@ -100,8 +90,6 @@ def __init__(
100
90
# args for the cache
101
91
cache_path: Optional[str] =None,
102
92
use_cache: bool=False,
103
-
# args for model type
104
-
model_type: ModelType=ModelType.LLM,
105
93
) ->None:
106
94
r"""The default prompt is set to the DEFAULT_ADALFLOW_SYSTEM_PROMPT. It has the following variables:
107
95
- task_desc_str
@@ -112,17 +100,6 @@ def __init__(
112
100
- steps_str
113
101
You can preset the prompt kwargs to fill in the variables in the prompt using prompt_kwargs.
114
102
But you can replace the prompt and set any variables you want and use the prompt_kwargs to fill in the variables.
115
-
116
-
Args:
117
-
model_client (ModelClient): The model client to use for the generator.
118
-
model_kwargs (Dict[str, Any], optional): The model kwargs to pass to the model client. Defaults to {}. Please refer to :ref:`ModelClient<components-model_client>` for the details on how to set the model_kwargs for your specific model if it is from our library.
119
-
template (Optional[str], optional): The template for the prompt. Defaults to :ref:`DEFAULT_ADALFLOW_SYSTEM_PROMPT<core-default_prompt_template>`.
120
-
prompt_kwargs (Optional[Dict], optional): The preset prompt kwargs to fill in the variables in the prompt. Defaults to None.
121
-
output_processors (Optional[Component], optional): The output processors after model call. It can be a single component or a chained component via ``Sequential``. Defaults to None.
122
-
name (Optional[str], optional): The name of the generator. Defaults to None.
123
-
cache_path (Optional[str], optional): The path to save the cache. Defaults to None.
124
-
use_cache (bool, optional): Whether to use cache. Defaults to False.
125
-
model_type (ModelType, optional): The type of model (EMBEDDER, LLM, or IMAGE_GENERATION). Defaults to ModelType.LLM.
126
103
"""
127
104
128
105
ifnotisinstance(model_client, ModelClient):
@@ -134,7 +111,6 @@ def __init__(
134
111
template=templateorDEFAULT_ADALFLOW_SYSTEM_PROMPT
135
112
136
113
# create the cache path and initialize the cache engine
0 commit comments