Skip to content

Commit 9cf1d35

Browse files
committed
adding more fixing for enum related print
1 parent cca16ce commit 9cf1d35

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/promptflow/promptflow/_core/tool_meta_generator.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def generate_prompt_tool(name, content, prompt_only=False, source=None):
4242
message_format=(
4343
"Generate tool meta failed for {tool_type} tool. Jinja parsing failed: {error_type_and_message}"
4444
),
45-
tool_type=tool_type,
45+
tool_type=tool_type.value,
4646
error_type_and_message=error_type_and_message,
4747
) from e
4848

@@ -143,8 +143,11 @@ def _parse_tool_from_function(f, initialize_inputs=None, gen_custom_type_conn=Fa
143143
f = f.__original_function
144144
try:
145145
inputs, _, _, enable_kwargs = function_to_interface(
146-
f, initialize_inputs=initialize_inputs, gen_custom_type_conn=gen_custom_type_conn,
147-
skip_prompt_template=skip_prompt_template)
146+
f,
147+
initialize_inputs=initialize_inputs,
148+
gen_custom_type_conn=gen_custom_type_conn,
149+
skip_prompt_template=skip_prompt_template,
150+
)
148151
except Exception as e:
149152
error_type_and_message = f"({e.__class__.__name__}) {e}"
150153
raise BadFunctionInterface(
@@ -280,7 +283,7 @@ def generate_tool_meta_dict_by_file(path: str, tool_type: ToolType):
280283
if not file.is_file():
281284
raise MetaFileNotFound(
282285
message_format="Generate tool meta failed for {tool_type} tool. Meta file '{file_path}' can not be found.",
283-
tool_type=tool_type,
286+
tool_type=tool_type.value,
284287
file_path=str(file),
285288
)
286289
try:
@@ -292,7 +295,7 @@ def generate_tool_meta_dict_by_file(path: str, tool_type: ToolType):
292295
"Generate tool meta failed for {tool_type} tool. "
293296
"Read meta file '{file_path}' failed: {error_type_and_message}"
294297
),
295-
tool_type=tool_type,
298+
tool_type=tool_type.value,
296299
file_path=str(file),
297300
error_type_and_message=error_type_and_message,
298301
) from e

src/promptflow/promptflow/executor/flow_validator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def convert_flow_inputs_for_node(flow: Flow, node: Node, inputs: Mapping[str, An
277277
message_format=msg_format,
278278
input_name=k,
279279
node_name=node.name,
280-
expected_type=flow.inputs[v.value].type,
280+
expected_type=flow.inputs[v.value].type.value,
281281
) from e
282282
return updated_inputs
283283

0 commit comments

Comments
 (0)