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

feat(AI Agent Node): Make tools optional when using OpenAI model with Tools agent #11212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Oct 10, 2024

Summary

  • Remove the requirement of at least 1 tool when using the Tools agent
  • Show a hint to use Tools agent when Require Specific Output Format is toggled for non-tools agents

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Oct 10, 2024
Copy link
Contributor

@jeanpaul jeanpaul left a comment

Choose a reason for hiding this comment

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

Other than my comment on the tests - this looks good!

Comment on lines -297 to -304
// OpenAI doesn't allow empty tools array so we will provide a more user-friendly error message
if (model.lc_namespace.includes('openai') && tools.length === 0) {
throw new NodeOperationError(
this.getNode(),
"Please connect at least one tool. If you don't need any, try the conversational agent instead",
);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also test this in a test-workflow?

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Oct 11, 2024

n8n    Run #7333

Run Properties:  status check failed Failed #7333  •  git commit a86567afca: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Project n8n
Run status status check failed Failed #7333
Run duration 04m 27s
Commit git commit a86567afca: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Committer Oleg Ivaniv
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 344

Tests for review

Failed  45-ai-assistant.cy.ts • 1 failed test

View Output Video

Test Artifacts
AI Assistant::enabled > should show quick replies when node is executed after new suggestion Test Replay Screenshots Video
Failed  21-community-nodes.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  1-workflows.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  42-nps-survey.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  24-ndv-paired-item.cy.ts • 0 failed tests

View Output

Test Artifacts

The first 5 failed specs are shown, see all 34 specs in Cypress Cloud.

Flakiness  45-ai-assistant.cy.ts • 1 flaky test

View Output Video

Test Artifacts
AI Assistant Credential Help > should start credential help from node credential Test Replay Screenshots Video
Flakiness  233-AI-switch-to-logs-on-error.cy.ts • 1 flaky test

View Output Video

Test Artifacts
AI-233 Make root node's logs pane active in case of an error in sub-nodes > should switch to logs tab on error, when NDV is already opened Test Replay Screenshots Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants