reflex-ai


Namereflex-ai JSON
Version 0.1.0a39 PyPI version JSON
download
home_pageNone
SummaryAI tools to build Reflex apps.
upload_time2024-12-17 22:29:54
maintainerNone
docs_urlNone
authorNikhil Rao
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Reflex-AI

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

It also includes blocks for higher level components.

## 1. Install the Package

Install the package with pip:

```bash
pip install reflex-ai
```

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

```bash
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:

```bash
reflex init
```     

See the [reflex docs](https://github.com/reflex-dev/reflex) for more information on creating Reflex projects.

## 3. Enable AI

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

```bash
# 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:

```bash
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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "reflex-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Nikhil Rao",
    "author_email": "nikhil@reflex.dev",
    "download_url": "https://files.pythonhosted.org/packages/3d/3d/1fa2f7961e3412f1524a353036ea2b7f3526454d9f668cac12154308f71e/reflex_ai-0.1.0a39.tar.gz",
    "platform": null,
    "description": "# Reflex-AI\n\n`reflex-ai` is a package to bring AI agent capabilities to your local development environment.\n\nIt also includes blocks for higher level components.\n\n## 1. Install the Package\n\nInstall the package with pip:\n\n```bash\npip install reflex-ai\n```\n\nNOTE: `reflex-ai` requires `reflex` 0.6.0 or later. Before this is out, make sure to run the following:\n\n```bash\npip install git+https://github.com/reflex-dev/reflex.git@main\npip uninstall watchfiles\n```\n\n## 2. Create a Reflex Project\n\n`reflex-ai` works with both new and existing Reflex projects. To create a new project, create a directory for your app and run:\n\n```bash\nreflex init\n```     \n\nSee the [reflex docs](https://github.com/reflex-dev/reflex) for more information on creating Reflex projects.\n\n## 3. Enable AI\n\nTo enable AI in your project, add the following to your main app file.\n\n```bash\n# Import the reflex-ai package (you MUST import it exactly like this)\nfrom reflex_ai import enable\n\napp = rx.App()\n# Enable AI BEFORE you call any `add_page`.\nenable(app)\n\n# Add your pages as usual.\napp.add_page(index)\n```\n\n## 4. Run the App\n\nRun your app as usual:\n\nWhile we're in beta, you need to take the following steps:\n\nExport the backend URL for the AI agent:\n```\nexport FLEXGEN_BACKEND_URL=https://rxh-prod-flexgen-agent.fly.dev/\n```\n\nInstall `\n\nThen run your app as usual:\n\n```bash\nreflex run\n```\n\nNOTE: You must be logged in to Reflex to use `reflex-ai`.\n\n## 5. Access the AI Editor at `/edit`\n\nEvery 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`.\n\nWhen `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.\n\n## 6. Select and Edit Elements\n\nOn 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.\n\nYou 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.\n\n### Caveats\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AI tools to build Reflex apps.",
    "version": "0.1.0a39",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9f65ad5ee9dd933d7e840de7bb36f90039a07b01e83fa72a374a1da54ea6612",
                "md5": "3a69a22cb7bae8b8c83121cb99401b2c",
                "sha256": "325d36061d9413fe26fefc05601d45042a2debd53b8b46d13ff1486416d60e04"
            },
            "downloads": -1,
            "filename": "reflex_ai-0.1.0a39-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a69a22cb7bae8b8c83121cb99401b2c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 188368,
            "upload_time": "2024-12-17T22:29:51",
            "upload_time_iso_8601": "2024-12-17T22:29:51.720810Z",
            "url": "https://files.pythonhosted.org/packages/c9/f6/5ad5ee9dd933d7e840de7bb36f90039a07b01e83fa72a374a1da54ea6612/reflex_ai-0.1.0a39-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d3d1fa2f7961e3412f1524a353036ea2b7f3526454d9f668cac12154308f71e",
                "md5": "7fbea06ad527cd3464a8150227f58f10",
                "sha256": "bf5b2bc8b403b9d77ad4aac9348051d075f79ed59b7022bb5f06b67672facde7"
            },
            "downloads": -1,
            "filename": "reflex_ai-0.1.0a39.tar.gz",
            "has_sig": false,
            "md5_digest": "7fbea06ad527cd3464a8150227f58f10",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 100381,
            "upload_time": "2024-12-17T22:29:54",
            "upload_time_iso_8601": "2024-12-17T22:29:54.302671Z",
            "url": "https://files.pythonhosted.org/packages/3d/3d/1fa2f7961e3412f1524a353036ea2b7f3526454d9f668cac12154308f71e/reflex_ai-0.1.0a39.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-17 22:29:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "reflex-ai"
}
        
Elapsed time: 0.42654s