Skip to content
Snippets Groups Projects
Commit d9194228 authored by Huu Le (Lee)'s avatar Huu Le (Lee) Committed by GitHub
Browse files

fix: add missing env value; improve docs and error message (#638)

parent 20206bc8
No related branches found
No related tags found
No related merge requests found
...@@ -116,14 +116,14 @@ export async function createApp({ ...@@ -116,14 +116,14 @@ export async function createApp({
await installTemplate({ ...args, backend: true }); await installTemplate({ ...args, backend: true });
} }
await writeDevcontainer(root, templatesDir, framework, frontend);
process.chdir(root); process.chdir(root);
if (tryGitInit(root)) { if (tryGitInit(root)) {
console.log("Initialized a git repository."); console.log("Initialized a git repository.");
console.log(); console.log();
} }
await writeDevcontainer(root, templatesDir, framework, frontend);
if (toolsRequireConfig(tools)) { if (toolsRequireConfig(tools)) {
console.log( console.log(
yellow( yellow(
......
...@@ -199,6 +199,7 @@ Given this information, please answer the question: {query_str} ...@@ -199,6 +199,7 @@ Given this information, please answer the question: {query_str}
name: "NEXT_PUBLIC_MODEL", name: "NEXT_PUBLIC_MODEL",
description: description:
"The LLM model to use (hardcode to front-end artifact).", "The LLM model to use (hardcode to front-end artifact).",
value: opts.model || "gpt-3.5-turbo",
} }
: {}, : {},
], ],
......
...@@ -315,7 +315,7 @@ Got error: ${(error as Error).message}.\n`, ...@@ -315,7 +315,7 @@ Got error: ${(error as Error).message}.\n`,
), ),
); );
console.log( 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( Please check ${cyan(
terminalLink( terminalLink(
"This documentation", "This documentation",
......
...@@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https ...@@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https
## Getting Started ## 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 poetry install
...@@ -44,7 +46,7 @@ Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser ...@@ -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`: 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 ## Learn More
......
...@@ -34,5 +34,6 @@ app.include_router(chat_router, prefix="/api/chat") ...@@ -34,5 +34,6 @@ app.include_router(chat_router, prefix="/api/chat")
if __name__ == "__main__": if __name__ == "__main__":
app_host = os.getenv("APP_HOST", "0.0.0.0") app_host = os.getenv("APP_HOST", "0.0.0.0")
app_port = int(os.getenv("APP_PORT", "8000")) 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)
...@@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https ...@@ -2,7 +2,9 @@ This is a [LlamaIndex](https://www.llamaindex.ai/) project using [FastAPI](https
## Getting Started ## 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 poetry install
...@@ -44,7 +46,7 @@ Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser ...@@ -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`: 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 ## Learn More
......
...@@ -35,5 +35,6 @@ app.include_router(chat_router, prefix="/api/chat") ...@@ -35,5 +35,6 @@ app.include_router(chat_router, prefix="/api/chat")
if __name__ == "__main__": if __name__ == "__main__":
app_host = os.getenv("APP_HOST", "0.0.0.0") app_host = os.getenv("APP_HOST", "0.0.0.0")
app_port = int(os.getenv("APP_PORT", "8000")) 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment