mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 19:56:06 -05:00
Chat Queue Persistence (#33)
* fix: workflow env * update: center title on readme * update: readme goals and format * add: icons in readme * fix: plus margin * update: environment variables in contr. * add: queue for chat history * add: set -e for workflow failure * update: version increment * fix: client null info * fix: shutoff issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Message } from 'discord.js'
|
||||
import { ChatResponse, Ollama } from 'ollama'
|
||||
import { UserMessage } from './events.js'
|
||||
import { Queue } from '../queues/queue.js'
|
||||
|
||||
/**
|
||||
* Method to send replies as normal text on discord like any other user
|
||||
@@ -15,7 +16,7 @@ export async function normalMessage(
|
||||
channel: string,
|
||||
model: string
|
||||
},
|
||||
msgHist: UserMessage[]
|
||||
msgHist: Queue<UserMessage>
|
||||
) {
|
||||
// bot's respnse
|
||||
let response: ChatResponse
|
||||
@@ -25,7 +26,7 @@ export async function normalMessage(
|
||||
// Attempt to query model for message
|
||||
response = await ollama.chat({
|
||||
model: tokens.model,
|
||||
messages: msgHist,
|
||||
messages: msgHist.getItems(),
|
||||
options: {
|
||||
num_thread: 8, // remove if optimization needed further
|
||||
mirostat: 1,
|
||||
|
||||
Reference in New Issue
Block a user