-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple completions endpoint (#125)
* add simple completions endpoint * add llama example * lint * add usage message
- Loading branch information
1 parent
cdeb9d6
commit 8eaa845
Showing
2 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
|
||
from pycape.llms import Cape | ||
|
||
c = Cape(url="https://api.capeprivacy.com") | ||
|
||
token = c.token(os.getenv("CAPE_TOKEN", "")) | ||
|
||
for msg in c.chat_completions( | ||
[ | ||
{ | ||
"role": "user", | ||
"content": "<s>[INST] <<SYS>>You are a helpful Assistant.<</SYS>>" | ||
"\n\nWhat is the Capital of France? [/INST]", | ||
}, | ||
{"role": "system", "content": "you are a happy helpful assistant"}, | ||
], | ||
token, | ||
): | ||
print(msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters