diff --git a/create-app.ts b/create-app.ts index f59a9e9a65dfe55c29a4741d6c3a28abfa38e72f..8d6ce9c5089062f2c451927fe283344743a29bc6 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 20d4cb7d951ca0e5820c1e44a069de6fbac244cd..f9f6d370a44962efec562c65004d17c5f5aae807 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 47e78c26a480a6293b64efb24094430f6b792b0c..131d6eba2bc0d89b39438cf929ff73ff0614afc8 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 38f3c4a3fa5715639752a987051ff7a2879aa288..b1a35c42e80331465066fcf5d7200ad2fdb7f92d 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 691f543d6ffddf74cca975b1fce800e4b887431a..41721a8f2f95c5e8883b7dcbc9ef627746d27c27 100644 --- a/templates/types/simple/fastapi/main.py +++ b/templates/types/simple/fastapi/main.py @@ -34,5 +34,6 @@ app.include_router(chat_router, prefix="/api/chat") 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 fdbb73a15077865ab0f66ce3de66a070f4d957bd..35ef1125adf9044ee229105362e93fe07766d73a 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 7e7d42496b4a6baa485051ab926d7bb254e7e7d7..edba3d3a758709012f9d92d1b543a9f67cb1240b 100644 --- a/templates/types/streaming/fastapi/main.py +++ b/templates/types/streaming/fastapi/main.py @@ -35,5 +35,6 @@ app.include_router(chat_router, prefix="/api/chat") 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)