Skip to content

Commit c691ee5

Browse files
committed
added code docs to README.md and re-tested code
1 parent 89b6110 commit c691ee5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/huggingface/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
From my book URI: https://leanpub.com/lovinglisp
44

5-
There is a **Makefile** in the repo https://github.com/mark-watson/loving-common-lisp that can be copied
6-
to your **~/quicklisp/local-projects** directory. Then in **~/quicklisp/local-projects** run:
5+
Edit your file ~/.sbclrc to add the following line of code:
76

8-
make fetch
7+
(pushnew #p"/Users/mark/GITHUB/loving-common-lisp/"
8+
ql:*local-project-directories*
9+
:test #'equal)
910

10-
to get all of the library examples from my book.
11+
NOTE: Please change the path #p"/Users/mark/GITHUB/loving-common-lisp/" to the path where you cloned this repository using:
12+
13+
git clone https://github.com/mark-watson/loving-common-lisp.git
1114

1215

1316
## setting your Hugging Face API key
@@ -26,3 +29,9 @@ cl-user> (huggingface:answer-question "Where were the 1992 Olympics held?" "The
2629
```
2730

2831
See my book for examples and example output.
32+
33+
## API documentation
34+
35+
- `huggingface:summarize` takes an input string and a maximum token count, calls Hugging Face's `facebook/bart-large-cnn` model, and returns the summary text extracted from the JSON response. The function requires the `HF_API_TOKEN` environment variable to be set so the generated `curl` request can authenticate.
36+
- `huggingface:answer-question` accepts a question and supporting context, invokes the `deepset/roberta-base-squad2` question-answering model, and returns the highest-confidence answer string from the API response.
37+
- `huggingface::huggingface-helper` is an internal utility that executes an arbitrary `curl` command via `uiop:run-program` and decodes the JSON response into a Common Lisp data structure; both public entry points rely on this helper.

0 commit comments

Comments
 (0)