Skip to content

Commit e9f0078

Browse files
Merge pull request #49 from Promptly-Technologies-LLC/34-enhance-the-readme
Add explanation and screenshots to the README
2 parents 8449c8f + d517088 commit e9f0078

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,22 @@ uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload
2727

2828
### 5. Set your OpenAI API key and create an assistant in the GUI
2929

30-
If your OPENAI_API_KEY or ASSISTANT_ID are not set, you will be redirected to the setup page where you can set them. (The values will be saved in a .env file in the root of the project.) Once set, you will be redirected to the home page and can begin a chat session.
30+
## Usage
31+
32+
Navigate to the `/setup` page at any time to configure your assistant:
33+
34+
![Setup Page](./docs/setup.png)
35+
36+
Navigate to the `/chat` page to begin a chat session:
37+
38+
![Chat Page](./docs/chat.png)
39+
40+
If your OPENAI_API_KEY or ASSISTANT_ID are not set, you will be redirected to `/setup` where you can set them. (The values will be saved in a `.env` file in the root of the project.)
41+
42+
The assistant is capable of multi-step workflows involving multiple chained tool calls, including file searches, code execution, and calling custom functions. Tool calls will be displayed in the chat as they are processed.
43+
44+
## Defining Your Own Custom Functions
45+
46+
Define custom functions in the `utils/custom_functions.py` file. An example `get_weather` function is provided. You will need to import your function in `routers/chat.py` and add your execution logic to the `event_generator` function (search for `get_weather` in that file to see a function execution example). See also `templates/components/weather-widget.html` for an example widget for displaying the function call results.
47+
48+
Ultimately I plan to support a more intuitive workflow for defining custom functions, and perhaps I'll even add MCP support. Please contribute a PR if you'd like to help!

docs/chat.png

23.5 KB
Loading

docs/setup.png

57.2 KB
Loading

utils/custom_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_function_tool_param() -> FunctionToolParam:
8686
)
8787

8888

89-
def get_weather(location, dates: Sequence[str | datetime] = [datetime.today()]):
89+
def get_weather(location, dates: Sequence[str | datetime] = [datetime.today()]) -> list[dict[str, Any]]:
9090
"""
9191
Generate random weather reports for a given location over a date range.
9292

0 commit comments

Comments
 (0)