From ae04a918064c1711878e8ab618e11234144fe6ea Mon Sep 17 00:00:00 2001 From: amandasavluchinske Date: Fri, 14 Jun 2024 19:52:29 +0100 Subject: [PATCH 1/4] Adds setup guide and .env.example file --- .env.example | 6 +++++ README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..26ff92c --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +OPENAI_API_KEY=your-key-here +WEATHER_API_KEY=your-key-here +TAVILY_API_KEY=your-key-here +FIRECRAWL_API_KEY=your-key-here +LANGCHAIN_API_KEY=your-key-here +LANGCHAIN_TRACING_V2=True \ No newline at end of file diff --git a/README.md b/README.md index 0d1d700..d6ca7f2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,73 @@ Django app to integrate with [OpenAI Assistants API](https://platform.openai.com ⚠️ Under heavy development. Not launched yet! +## Dev Setup + +### Clone the repo + +`git clone git@github.com:vintasoftware/django-ai-assistant.git` + +### Set up a virtualenv, optionally set up nvm, and activate your environment(s) + +You can use [pyenv](https://github.com/pyenv/pyenv), [pipenv](https://github.com/pypa/pipenv/blob/main/docs/installation.md), vanilla venvs or the tool of your choice. + +[NVM](https://github.com/nvm-sh/nvm) + +### Install vite + +`npm install -g vite` or install locally if you prefer + +### Create a .env file at the root of the project + +`cp .env.example .env` + +To gather the API keys for these tools, head to the following links: +- [OpenAI](https://platform.openai.com/api-keys) +- [Weather](https://www.weatherapi.com/) +- [Tavily](https://app.tavily.com/home) +- [Firecrawl](https://www.firecrawl.dev/) + +### Build the frontend + +`cd frontend` + +`vite build` + +### Install dependencies + +#### Backend + +`cd example` + +`poetry install` + +#### Frontend + +`cd example` + +`npm install` + +### Run the project + +From the example folder: + +#### Frontend + +`npm run start` + +#### Backend + +`python manage.py migrate` + +`python manage.py createsuperuser` + +`python manage.py runserver` + +### Log in to Django Admin + +Go to /admin and log in with your superuser account. + + ## Contributing If you wish to contribute to this project, please first discuss the change you wish to make via an [issue](https://github.com/vintasoftware/django-react-boilerplate/issues). From d70d0a49701c64d62294f8ba96b7775b50bc1ccf Mon Sep 17 00:00:00 2001 From: amandasavluchinske Date: Fri, 14 Jun 2024 20:12:59 +0100 Subject: [PATCH 2/4] adds pre-commit step to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index d6ca7f2..9a539e0 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,10 @@ To gather the API keys for these tools, head to the following links: `poetry install` +Install pre-commit hooks: + +`pre-commit install` + #### Frontend `cd example` From 262f4c14c8880702255f70311c2cab44aa49e2b8 Mon Sep 17 00:00:00 2001 From: amandasavluchinske Date: Mon, 17 Jun 2024 13:08:13 +0100 Subject: [PATCH 3/4] Separates .env.example files into 2 --- .env.example | 7 +------ README.md | 6 ++++++ example/.env.example | 5 +++++ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 example/.env.example diff --git a/.env.example b/.env.example index 26ff92c..5a042ac 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1 @@ -OPENAI_API_KEY=your-key-here -WEATHER_API_KEY=your-key-here -TAVILY_API_KEY=your-key-here -FIRECRAWL_API_KEY=your-key-here -LANGCHAIN_API_KEY=your-key-here -LANGCHAIN_TRACING_V2=True \ No newline at end of file +OPENAI_API_KEY=your-key-here \ No newline at end of file diff --git a/README.md b/README.md index 9a539e0..048a666 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ To gather the API keys for these tools, head to the following links: `vite build` +### Create a .env file at the example folder + +`cd example` + +`cp .env.example .env` + ### Install dependencies #### Backend diff --git a/example/.env.example b/example/.env.example new file mode 100644 index 0000000..fe2d02b --- /dev/null +++ b/example/.env.example @@ -0,0 +1,5 @@ +WEATHER_API_KEY=your-key-here +TAVILY_API_KEY=your-key-here +FIRECRAWL_API_KEY=your-key-here +LANGCHAIN_API_KEY=your-key-here +LANGCHAIN_TRACING_V2=True \ No newline at end of file From 6abc2a737e36691c48be0821f4052ad2e83ea177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Juvenal?= Date: Mon, 17 Jun 2024 09:34:12 -0300 Subject: [PATCH 4/4] Update .env.example with OPENAI_API_KEY --- example/.env.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/.env.example b/example/.env.example index fe2d02b..be40045 100644 --- a/example/.env.example +++ b/example/.env.example @@ -1,5 +1,6 @@ +OPENAI_API_KEY=your-key-here WEATHER_API_KEY=your-key-here TAVILY_API_KEY=your-key-here FIRECRAWL_API_KEY=your-key-here LANGCHAIN_API_KEY=your-key-here -LANGCHAIN_TRACING_V2=True \ No newline at end of file +LANGCHAIN_TRACING_V2=True