Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema link for custom strong type connection #835

Merged
merged 11 commits into from
Oct 23, 2023
1 change: 1 addition & 0 deletions src/promptflow/promptflow/_utils/connection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def generate_custom_strong_type_connection_spec(cls, package, package_version):

def generate_custom_strong_type_connection_template(cls, connection_spec, package, package_version):
connection_template_str = """
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomStrongTypeConnection.schema.json
name: "to_replace_with_connection_name"
type: custom
custom_type: {{ custom_type }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def test_collect_package_tools_and_connections(self, install_custom_tool_pkg):
}

expected_template = {
"$schema": "https://azuremlschemas.azureedge.net/promptflow/latest/CustomStrongTypeConnection.schema.json",
chenslucky marked this conversation as resolved.
Show resolved Hide resolved
"name": "to_replace_with_connection_name",
"type": "custom",
"custom_type": "MyFirstConnection",
Expand Down Expand Up @@ -197,5 +198,4 @@ def test_collect_package_tools_and_connections(self, install_custom_tool_pkg):

content = templates["my_tool_package.tools.my_tool_with_custom_strong_type_connection.MyCustomConnection"]
expected_template_str = textwrap.dedent(expected_template)

assert content in expected_template_str
assert expected_template_str in content
Loading