8000 feat: get ai agent (api+ui) by joaoviana · Pull Request #14917 · lightdash/lightdash · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: get ai agent (api+ui) #14917

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

Merged

Conversation

joaoviana
Copy link
Contributor
@joaoviana joaoviana commented May 21, 2025

Closes: #ISSUE_NUMBER

Description:

Implements the "Get Agent" API endpoint and fixes the agent details view in the frontend.

The changes include:

  • Implementing the getAgent controller method that was previously throwing a NotImplementedError
  • Fixing the SQL query in AiAgentModel to properly handle null integrations with COALESCE and FILTER
  • Updating the frontend to correctly consume the agent data from the API
  • Removing debug console.log statements from the agent form submission

Reviewer actions

  • I have manually tested the changes in the preview environment
  • I have reviewed the code
  • I understand that "request changes" will block this PR from merging

@joaoviana joaoviana marked this pull request as ready for review May 21, 2025 15:22
Copy link
Contributor Author
joaoviana commented May 21, 2025

@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch from 86b58ed to 55c7dd2 Compare May 21, 2025 15:39
@joaoviana joaoviana force-pushed the 05-21-feat_create_ai_agent_api_ui_ branch from 616ba0d to 008ff71 Compare May 21, 2025 15:39
@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch 2 times, most recently from e5c5f68 to 9d82c3a Compare May 21, 2025 15:55
@joaoviana joaoviana mentioned this pull request May 21, 2025
3 tasks
Copy link
Contributor
@notgiorgi notgiorgi left a comment

Choose a reason for hiding this comment

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

Tested, works well!

Should the empty name/descriptions have a fallback?
image.png

@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch from 9d82c3a to 150c32c Compare May 21, 2025 17:24
@joaoviana joaoviana force-pushed the 05-21-feat_create_ai_agent_api_ui_ branch from 008ff71 to cbba288 Compare May 21, 2025 17:24
@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch from 150c32c to 55c1a7c Compare May 21, 2025 17:31
@joaoviana
Copy link
Contributor Author

Tested, works well!

Should the empty name/descriptions have a fallback? image.png

this is updated in the code 🫡

@joaoviana joaoviana force-pushed the 05-21-feat_create_ai_agent_api_ui_ branch from cbba288 to 6654b45 Compare May 22, 2025 08:29
@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch from 55c1a7c to 6350316 Compare May 22, 2025 08:29
@joaoviana joaoviana force-pushed the 05-21-feat_get_ai_agent_api_ui_ branch from 6350316 to cf76e5d Compare May 22, 2025 08:30
@joaoviana joaoviana force-pushed the 05-21-feat_create_ai_agent_api_ui_ branch from 6654b45 to 1126f97 Compare May 22, 2025 08:30
@IrakliJani IrakliJani merged commit 111558f into 05-21-feat_create_ai_agent_api_ui_ May 22, 2025
2 of 3 checks passed
@IrakliJani IrakliJani deleted the 05-21-feat_get_ai_agent_api_ui_ branch May 22, 2025 10:13
IrakliJani pushed a commit that referenced this pull request May 22, 2025
* feat: create ai agent (api+ui)

* feat: get ai agent (api+ui) (#14917)

* feat: get ai agent (api+ui)

* feat: allow deleting agents (#14919)
Comment on lines 106 to +110
form.setValues({
name: agent.results.name,
projectUuid: agent.results.projectUuid,
integrations: agent.results.integrations,
tags: agent.results.tags, 8000
name: agent.name,
projectUuid: agent.projectUuid,
integrations: agent.integrations,
tags: agent.tags,
Copy link
Contributor

Choose a reason for hiding this comment

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

The code accesses agent properties directly without verifying the object exists first. This could cause runtime errors if the agent data hasn't loaded yet. Consider adding a null check before setting form values:

if (agent) {
  form.setValues({
    name: agent.name,
    projectUuid: agent.projectUuid,
    integrations: agent.integrations,
    tags: agent.tags,
  });
}

This would prevent potential "cannot read property of undefined" errors during the component's rendering cycle.

Suggested change
form.setValues({
name: agent.results.name,
projectUuid: agent.results.projectUuid,
integrations: agent.results.integrations,
tags: agent.results.tags,
name: agent.name,
projectUuid: agent.projectUuid,
integrations: agent.integrations,
tags: agent.tags,
if (agent) {
form.setValues({
name: agent.name,
projectUuid: agent.projectUuid,
integrations: agent.integrations,
tags: agent.tags,
});
}

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

IrakliJani added a commit that referenced this pull request May 22, 2025
* feat: list ai agents

* fix: left join

* feat: create/update ai agent (api+ui) (#14914)

* feat: create ai agent (api+ui)

* feat: get ai agent (api+ui) (#14917)

* feat: get ai agent (api+ui)

* feat: allow deleting agents (#14919)

* feat(backend): implement AI agent threads API endpoints (#14918)

* feat(backend): agent threads

* feat(frontend): agent threads (#14921)

---------

Co-authored-by: Irakli Janiashvili <irakli.janiashvili@gmail.com>

---------

Co-authored-by: João Viana <joao@lightdash.com>
Co-authored-by: Giorgi Bagdavadze <12987425+notgiorgi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0