File size: 2,661 Bytes
3b8df9e
adaea7c
3b8df9e
 
 
 
 
adaea7c
3b8df9e
49b9b9f
1893a87
 
3b8df9e
adaea7c
3b8df9e
adaea7c
25d6a39
adaea7c
5f3a430
adaea7c
 
 
 
 
 
 
5f3a430
adaea7c
5f3a430
 
adaea7c
 
 
 
 
 
5f3a430
 
adaea7c
 
 
 
 
 
 
25d6a39
adaea7c
 
 
25d6a39
adaea7c
25d6a39
d93c42d
 
 
adaea7c
d93c42d
 
 
 
25d6a39
adaea7c
d93c42d
 
 
25d6a39
 
adaea7c
 
 
 
 
 
25d6a39
 
adaea7c
25d6a39
 
 
e677b67
25d6a39
adaea7c
25d6a39
adaea7c
 
 
 
 
 
 
 
25d6a39
 
d93c42d
 
adaea7c
 
 
 
d93c42d
 
adaea7c
f533eef
d93c42d
 
adaea7c
 
 
 
 
 
 
 
 
 
 
 
 
d93c42d
696f5ad
 
adaea7c
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
title: lv-recipe-chatbot
emoji: 🫑
colorFrom: green 
colorTo: indigo
sdk: gradio
sdk_version: 3.23.0
app_file: app.py
pinned: false
license: unknown
---
# lv-recipe-chatbot

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install -e '.[dev]'
```

## How to use

``` python
from dotenv import load_dotenv

load_dotenv()  # or load environment vars with different method

demo = app.create_demo(app.ConversationBot())
demo.launch()
```

    Running on local URL:  http://127.0.0.1:7860

    To create a public link, set `share=True` in `launch()`.

<div><iframe src="http://127.0.0.1:7860/" width="100%" height="500" allow="autoplay; camera; microphone; clipboard-read; clipboard-write;" frameborder="0" allowfullscreen></iframe></div>

or

``` sh
python3 app.py
```

## Dev quick-start

`git clone` the repo

``` sh
cd lv-recipe-chatbot
```

Make sure to use the version of python specified in `py_version.txt`  
Create a virtual environment.

``` sh
python3 -m venv env
```

Activate the env and install dependencies.

``` sh
source env/bin/activate
pip install -r requirements.txt
pip install -r requirements/dev.txt
```

To make the Jupyter environment, git friendly: `nbdev_install_hooks`  
If you want to render documentation locally, you will want to [install
Quarto](https://nbdev.fast.ai/tutorials/tutorial.html#install-quarto).

`nbdev_install_quarto`

Put API secrets in .env

``` sh
cp .env.example .env
```

Edit .env with your secret key(s). Only `OPEN_AI_KEY` is required.

Then start the Gradio demo from within the virtual environment.

``` sh
python3 app.py
```

Preview documentation

``` sh
nbdev_preview
```

## Dependencies

If a new dependency for development is helpful for developers, add it to
`dev.txt`.  
If it is a dependency for the app that is imported in source code, add
it to `core.txt`.  
Then run:

``` sh
scripts/pin_requirements.sh
```

This will update our `requirements.txt` to include the dependency as it
should be pinned in the environment.

## Development

[quick nbdev tutorial](https://nbdev.fast.ai/tutorials)

Make changes in `/nbs`.  
Update the package files with `nbdev_export` then reimport with
`pip install -e '.[dev]'`

Preview doc `nbdev_preview`  
Build docs, test and update README `nbdev_prepare`

## Useful links

- [Task Matrix (Formerly Visual
  ChatGPT)](https://github.com/microsoft/TaskMatrix)
- [LangChain](https://python.langchain.com/en/latest/index.html)
- [LLM Prompt Engineering](https://www.promptingguide.ai)
- [OpenAI best practices for
  prompts](https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api)