diff --git a/create-app.ts b/create-app.ts index f59a9e9a..8d6ce9c5 100644 --- a/create-app.ts +++ b/create-app.ts @@ -116,14 +116,14 @@ export async function createApp({ await installTemplate({ ...args, backend: true }); } + await writeDevcontainer(root, templatesDir, framework, frontend); + process.chdir(root); if (tryGitInit(root)) { console.log("Initialized a git repository."); console.log(); } - await writeDevcontainer(root, templatesDir, framework, frontend); - if (toolsRequireConfig(tools)) { console.log( yellow( diff --git a/helpers/env-variables.ts b/helpers/env-variables.ts index 20d4cb7d..f9f6d370 100644 --- a/helpers/env-variables.ts +++ b/helpers/env-variables.ts @@ -199,6 +199,7 @@ Given this information, please answer the question: {query_str} name: "NEXT_PUBLIC_MODEL", description: "The LLM model to use (hardcode to front-end artifact).", + value: opts.model || "gpt-3.5-turbo", } : {}, ], diff --git a/index.ts b/index.ts index 47e78c26..131d6eba 100644 --- a/index.ts +++ b/index.ts @@ -315,7 +315,7 @@ Got error: ${(error as Error).message}.\n`, ), ); console.log( - `Make sure you have VSCode installed and added to your PATH. + `Make sure you have VSCode installed and added to your PATH (shell alias will not work). Please check ${cyan( terminalLink( "This documentation", diff --git a/templates/types/simple/fastapi/README-template.md b/templates/types/simple/fastapi/README-template.md index 38f3c4a3..b1a35c42 100644 --- a/templates/types/simple/fastapi/README-template.md +++ b/templates/types/simple/fastapi/README-template.md @@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https ## Getting Started -First, setup the environment: +First, setup the environment with poetry: + +> **_Note:_** This step is not needed if you are using the dev-container. ``` poetry install @@ -44,7 +46,7 @@ Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser The API allows CORS for all origins to simplify development. You can change this behavior by setting the `ENVIRONMENT` environment variable to `prod`: ``` -ENVIRONMENT=prod uvicorn main:app +ENVIRONMENT=prod python main.py ``` ## Learn More diff --git a/templates/types/simple/fastapi/main.py b/templates/types/simple/fastapi/main.py index 691f543d..41721a8f 100644 --- a/templates/types/simple/fastapi/main.py +++ b/templates/types/simple/fastapi/main.py @@ -34,5 +34,6 @@ if __name__ == "__main__": app_host = os.getenv("APP_HOST", "0.0.0.0") app_port = int(os.getenv("APP_PORT", "8000")) + reload = True if environment == "dev" else False - uvicorn.run(app="main:app", host=app_host, port=app_port, reload=True) + uvicorn.run(app="main:app", host=app_host, port=app_port, reload=reload) diff --git a/templates/types/streaming/fastapi/README-template.md b/templates/types/streaming/fastapi/README-template.md index fdbb73a1..35ef1125 100644 --- a/templates/types/streaming/fastapi/README-template.md +++ b/templates/types/streaming/fastapi/README-template.md @@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https ## Getting Started -First, setup the environment: +First, setup the environment with poetry: + +> **_Note:_** This step is not needed if you are using the dev-container. ``` poetry install @@ -44,7 +46,7 @@ Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser The API allows CORS for all origins to simplify development. You can change this behavior by setting the `ENVIRONMENT` environment variable to `prod`: ``` -ENVIRONMENT=prod uvicorn main:app +ENVIRONMENT=prod python main.py ``` ## Learn More diff --git a/templates/types/streaming/fastapi/main.py b/templates/types/streaming/fastapi/main.py index 7e7d4249..edba3d3a 100644 --- a/templates/types/streaming/fastapi/main.py +++ b/templates/types/streaming/fastapi/main.py @@ -35,5 +35,6 @@ if __name__ == "__main__": app_host = os.getenv("APP_HOST", "0.0.0.0") app_port = int(os.getenv("APP_PORT", "8000")) + reload = True if environment == "dev" else False - uvicorn.run(app="main:app", host=app_host, port=app_port, reload=True) + uvicorn.run(app="main:app", host=app_host, port=app_port, reload=reload)