-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backend): handle colon symbols in model id (#537)
Signed-off-by: MICHAEL DESMOND <mdesmond@us.ibm.com>
- Loading branch information
1 parent
e5dd2e3
commit ff8069c
Showing
2 changed files
with
19 additions
and
1 deletion.
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,16 @@ | ||
import "dotenv/config.js"; | ||
import { createConsoleReader } from "examples/helpers/io.js"; | ||
import { UserMessage } from "beeai-framework/backend/message"; | ||
import { ChatModel } from "beeai-framework/backend/chat"; | ||
|
||
const llm = await ChatModel.fromName("ollama:granite3.2:8b"); | ||
|
||
const reader = createConsoleReader(); | ||
|
||
for await (const { prompt } of reader) { | ||
const response = await llm.create({ | ||
messages: [new UserMessage(prompt)], | ||
}); | ||
reader.write(`LLM 🤖 (txt) : `, response.getTextContent()); | ||
reader.write(`LLM 🤖 (raw) : `, JSON.stringify(response.messages)); | ||
} |
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