Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Add validation for wrong connection type for LLM node. (#1685)
# Description Add validation for wrong connection type for LLM node. This pull request includes changes related to testing and validation of connections in the `promptflow` codebase. The most important changes include adding a new test case to validate the behavior when a tool load fails due to an invalid connection type, and adding a check to validate the connection type of a node in the `_resolve_llm_node` method. Testing and validation changes: * `src/promptflow/tests/executor/e2etests/test_executor_validation.py`: Added a new test case to validate the behavior when a tool load fails due to an invalid connection type. (test_executor_validation.py) * `src/promptflow/promptflow/executor/_tool_resolver.py`: Added a check to validate the connection type of a node in the `_resolve_llm_node` method. (src/promptflow/promptflow/executor/_tool_resolver.py) Additional changes: * `src/promptflow/tests/test_configs/wrong_flows/flow_llm_with_wrong_conn/flow.dag.yaml`: Added a new YAML file that defines a node with a custom connection. (src/promptflow/tests/test_configs/wrong_flows/flow_llm_with_wrong_conn/flow.dag.yaml) * `src/promptflow/tests/test_configs/wrong_flows/flow_llm_with_wrong_conn/wrong_llm.jinja2`: Added a new Jinja2 template file containing a system message and a user message that uses a Jinja2 variable. (src/promptflow/tests/test_configs/wrong_flows/flow_llm_with_wrong_conn/wrong_llm.jinja2) # 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](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#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](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [ ] Pull request includes test coverage for the included changes. Co-authored-by: Heyi Tang <[email protected]>
- Loading branch information