Skip to content

Commit 8772e2b

Browse files
Add exercise to readme
1 parent 13b69db commit 8772e2b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,18 @@ Users are allowed to access the application if one of their verified email addre
6767
1. Run with docker
6868
```shell
6969
docker run -p 5050:5050 --env-file .env.docker repository-discovery
70-
```
70+
```
71+
72+
# Exercise
73+
74+
## Create a tool
75+
76+
Using the [github rest documentation](https://docs.github.com/en/rest), add a new tool.
77+
1. In the `github_tools.py` file, define a method that will be used to leverage the api endpoint you have chosen.
78+
2. Within the method, using the python doc format, add query language for openai to use.
79+
3. Add the `@tool()` decorator on the method you just defined.
80+
4. Within the `github_tools.py` file, define a new method for the api call that the tool will leverage to fetch data.
81+
5. Using the new api call, you defined, fetch the data within the tool and return it as a `json dump`.
82+
6. Register the new tool by adding it to the list of tools that are returned by the `github_tools` method.
83+
84+
Run the application and see if you can have openapi use your tool to fetch data.

0 commit comments

Comments
 (0)