-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix #65 * fix: docs * fix: wait for ws to open --------- Co-authored-by: ido <[email protected]>
- Loading branch information
1 parent
3b0d750
commit cc54125
Showing
7 changed files
with
43 additions
and
19 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
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
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# CatAi system_prompt | ||
# CatAi system-prompt | ||
|
||
According to https://withcatai.github.io/node-llama-cpp/api/type-aliases/LlamaChatSessionOptions, | ||
it is possible to modify the system_prompt of a chat. | ||
it is possible to modify the system-prompt of a chat. | ||
|
||
This can be achieved by adding a systemPrompt key in modelSettings | ||
|
||
![catAi systemPrompt settings](system_prompt/settings.png) | ||
![CatAi systemPrompt settings](system-prompt/settings.png) | ||
|
||
|
||
Save and restart to apply. | ||
|
||
Then the chat act like a pirate according to the systemPrompt you choose ;-) | ||
|
||
![catAi systemPrompt demo](system_prompt/demo.png) | ||
![CatAi systemPrompt demo](system-prompt/demo.png) |
File renamed without changes
File renamed without changes
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,13 @@ | ||
import { RemoteCatAI } from "catai"; | ||
|
||
const catai = new RemoteCatAI("ws://localhost:3000"); | ||
|
||
catai.on("open", async () => { | ||
console.log("Connected"); | ||
const response = await catai.prompt("Write me 100 words story", (token) => { | ||
process.stdout.write(token); | ||
}); | ||
|
||
console.log(`Total text length: ${response.length}`); | ||
catai.close(); | ||
}); |
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