Skip to main content

AI tools to build Reflex apps.

Project description

Reflex-AI

reflex-ai is a package to bring AI agent capabilities to your local development environment.

1. Install the Package

Install the package with pip:

pip install reflex-ai

NOTE: reflex-ai requires reflex 0.6.0 or later. Before this is out, make sure to run the following:

pip install git+https://github.com/reflex-dev/reflex.git@main
pip uninstall watchfiles

2. Create a Reflex Project

reflex-ai works with both new and existing Reflex projects. To create a new project, create a directory for your app and run:

reflex init

See the reflex docs for more information on creating Reflex projects.

3. Enable AI

To enable AI in your project, add the following to your main app file.

# Import the reflex-ai package (you MUST import it exactly like this)
from reflex_ai import enable

app = rx.App()
# Enable AI BEFORE you call any `add_page`.
enable(app)

# Add your pages as usual.
app.add_page(index)

4. Run the App

Run your app as usual:

While we're in beta, you need to take the following steps:

Export the backend URL for the AI agent:

export FLEXGEN_BACKEND_URL=https://rxh-prod-flexgen-agent.fly.dev/

Install `

Then run your app as usual:

reflex run

NOTE: You must be logged in to Reflex to use reflex-ai.

5. Access the AI Editor at /edit

Every page in your app will have an additional route by adding /edit to the end of the URL. For example, if your index page is at localhost:3000, you can access the AI editor at localhost:3000/edit. Similarly, if your about page is at localhost:3000/about, you can access the AI editor at localhost:3000/about/edit.

When reflex-ai is enabled, a scratch copy of your app will be created in the .web/reflex-ai-tmp directory for the AI to make changes without affecting your main app.

6. Select and Edit Elements

On an edit page, you can select elements by clicking on them. The selected element will be highlighted in the editor and the toolbar will show the selected code.

You can enter prompts in the toolbar input to generate new content for the selected element. The AI will generate new content based on the prompt and update the element in the editor.

Caveats

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reflex_ai-0.1.0a29.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

reflex_ai-0.1.0a29-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file reflex_ai-0.1.0a29.tar.gz.

File metadata

  • Download URL: reflex_ai-0.1.0a29.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/22.6.0

File hashes

Hashes for reflex_ai-0.1.0a29.tar.gz
Algorithm Hash digest
SHA256 c6bbe80418c24d34819871e9d58fe2f0e613757b0f00dd36866f3296c29fc0c3
MD5 ed59b2036bcdc141d11a40ae4ea0012d
BLAKE2b-256 5a8f5c53c3ec9f0cb0e2cfa116dedd64de3931c665bbc5b236bb41feacd82be4

See more details on using hashes here.

File details

Details for the file reflex_ai-0.1.0a29-py3-none-any.whl.

File metadata

  • Download URL: reflex_ai-0.1.0a29-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/22.6.0

File hashes

Hashes for reflex_ai-0.1.0a29-py3-none-any.whl
Algorithm Hash digest
SHA256 97aab94399c6f7653fc5031002c3b5af59c4bf7486636f7edc8f49236f983838
MD5 0ffc4a426af078b4e1997ca54858afd6
BLAKE2b-256 7986c043646021d18f2712978f9d94319262fc26d2f9f26adcc0ddd9c7d93405

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page