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

fix(frontend): Automatically choose client/server-side API client #8916

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Dec 9, 2024

We have separate client-side and server-side API clients. Choosing the right one should be done in the exporting module, not in all import locations.

Changes 🏗️

  • Rename AutoGPTServerAPI to AutoGPTServerAPIClientSide
  • Merge autogpt-server-api/clientServer into autogpt-server-api/client
  • Add environment-dependent AutoGPTServerAPI export in autogpt-server-api/client

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

@Pwuts Pwuts requested a review from a team as a code owner December 9, 2024 11:02
@Pwuts Pwuts requested review from ntindle and Torantulino and removed request for a team December 9, 2024 11:02
Copy link

netlify bot commented Dec 9, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit 725ea07
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/675747befd9ae90008db12a7

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/m labels Dec 9, 2024
Copy link

netlify bot commented Dec 9, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 725ea07
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/675747be50d900000895e79a

@Pwuts Pwuts requested review from Swiftyos and removed request for Torantulino December 9, 2024 11:05
@@ -1,5 +1,6 @@
import { AutoGPTServerAPI } from "./client";

// TODO: rename to BackendAPI
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not do this in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Out of scope, would cause a huge amount of changes and also conflicts on ongoing PRs

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there no imports of this anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope

@Abhi1992002
Copy link
Contributor

@Pwuts getting this error after making these changes?

Screenshot 2024-12-09 at 6 49 02 PM

@ntindle
Copy link
Member

ntindle commented Dec 9, 2024

I spent a lot of time playing this game, and couldn’t get it working which is why I had it the other way. I think making test components for each would probably be productive as you try various methods

@Pwuts Pwuts closed this Dec 9, 2024
@Pwuts Pwuts deleted the reinier/open-2147-automatic-server-sideclient-side-backend-api-client-usage branch December 9, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/m
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants