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

Validate groups when collect tool packages #3085

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chenslucky
Copy link
Contributor

@chenslucky chenslucky commented Apr 30, 2024

Description

Validate groups when collect tool packages.

  1. Group must have name and inputs
  2. Some group names cannot be used like advanced
  3. Group name should be unique
  4. Each input shouldn't appear in multiple groups

Portal:
Test image: promptflow.azurecr.io/promptflow-runtime:pr-1344775-v13

  • Only list valid tools:

image

  • Warning in logs:

image
image
image
image

Extension:
pf-tool version: 0.0.410 --extra-index-url https://azuremlsdktestpypi.azureedge.net/test-promptflow/
pf version: 1.10.0.dev125798419 --extra-index-url https://azuremlsdktestpypi.azureedge.net/promptflow

  • Only list valid tools:
    image

  • Warning in logs: pf tool list
    image

All Promptflow Contribution checklist:

  • The pull request does not introduce [breaking changes].
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: suggested workflow.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link

promptflow SDK CLI Azure E2E Test Result chesi/validate-group

  4 files    4 suites   4m 7s ⏱️
238 tests 203 ✅  35 💤 0 ❌
952 runs  812 ✅ 140 💤 0 ❌

Results for commit 5cd6534.

Copy link

promptflow-core test result

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 5cd6534.

Copy link

SDK CLI Global Config Test Result chesi/validate-group

6 tests   6 ✅  1m 19s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 5cd6534.

Copy link

Executor E2E Test Result chesi/validate-group

242 tests   237 ✅  5m 9s ⏱️
  1 suites    5 💤
  1 files      0 ❌

Results for commit 5cd6534.

Copy link

Executor Unit Test Result chesi/validate-group

797 tests   797 ✅  3m 44s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 5cd6534.

Copy link

SDK CLI Test Result chesi/validate-group

    4 files      4 suites   59m 4s ⏱️
  668 tests   655 ✅ 13 💤 0 ❌
2 672 runs  2 620 ✅ 52 💤 0 ❌

Results for commit 5cd6534.

"""Validate groups if exist in tool spec."""
tool_name = tool.get("name", "")
groups = tool.get("groups", "")
invalid_group_names = ["advanced"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid -> reserved

message_format=message_format,
ErrorTarget=ErrorTarget.TOOL)

# Some group names cannot be used like advanced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why.

message_format=message_format,
ErrorTarget=ErrorTarget.TOOL)

# Group name should be unique
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think duplicate group name may hit yaml load error? Why do we not need such logic for tool input name duplication?

Copy link

Hi, thank you for your interest in helping to improve the prompt flow experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment.

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue/pull request label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-recent-activity There has been no recent activity on this issue/pull request promptflow promptflow-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants