Files
AutoGPT/autogpt_platform/frontend
Bently a0ecb96958 Feat(Otto) Add Initial Otto Chat Bot code (#9266)
### Changes 🏗️
This is to add the Otto chat bot to the frontend UI.

The changes i have made for this goes as follows:
- I have made and added a basic chat UI widget to the build page, this
will become the main UI for Otto, this will be getting updates in the
future.
- I have made an API route ``/api/otto/ask`` that will receive the
message from the frontend and pass it to the Otto API that we have setup
on GCP.

I already have plans for how we can improve the UI and make it more
modular, this way we can add more features to Otto down the line!

### Config Changes
When we merge this, we will need to add the ENV var for ``otto_api_url``
that will be the URL from GCP where the API is being hosted!

This is now ready for a review as the backend API is up and running, to
who ever does test this, if you want the API url please DM me 😄


![image](https://github.com/user-attachments/assets/230a7487-d88f-4a6b-9ff9-e1e0aac8c385)

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] Set the ENV var for ``otto_api_url`` - ask @Bentlybro for this
  - [x] Set the ENV var for  ``NEXT_PUBLIC_BEHAVE_AS`` to ``CLOUD``
  - [x] Send otto a message from the build page frontend 
- [x] Send otto a message that contains graph data to see if the sending
graph data works
2025-03-06 17:51:07 +00:00
..

This is the frontend for AutoGPT's next generation

Getting Started

Run the following installation once.

npm install
# or
yarn install
# or
pnpm install
# or
bun install

Next, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

For subsequent runs, you do not have to npm install again. Simply do npm run dev.

If the project is updated via git, you will need to npm install after each update.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Deploy

TODO

Storybook

Storybook is a powerful development environment for UI components. It allows you to build UI components in isolation, making it easier to develop, test, and document your components independently from your main application.

Purpose in the Development Process

  1. Component Development: Develop and test UI components in isolation.
  2. Visual Testing: Easily spot visual regressions.
  3. Documentation: Automatically document components and their props.
  4. Collaboration: Share components with your team or stakeholders for feedback.

How to Use Storybook

  1. Start Storybook: Run the following command to start the Storybook development server:

    npm run storybook
    

    This will start Storybook on port 6006. Open http://localhost:6006 in your browser to view your component library.

  2. Build Storybook: To build a static version of Storybook for deployment, use:

    npm run build-storybook
    
  3. Running Storybook Tests: Storybook tests can be run using:

    npm run test-storybook
    

    For CI environments, use:

    npm run test-storybook:ci
    
  4. Writing Stories: Create .stories.tsx files alongside your components to define different states and variations of your components.

By integrating Storybook into our development workflow, we can streamline UI development, improve component reusability, and maintain a consistent design system across the project.