utilitas 1995.2.44 → 1995.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +2 -2
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -757,7 +757,7 @@ const talk = async (input, options) => {
|
|
|
757
757
|
const engine = unifyEngine({ engine: CHATGPT, ...options });
|
|
758
758
|
assert(chatConfig.engines[engine], NOT_INIT);
|
|
759
759
|
const model = options?.model || chatConfig.engines[engine].model;
|
|
760
|
-
const
|
|
760
|
+
const _MODEL = MODELS[model];
|
|
761
761
|
const sessionId = options?.sessionId || newSessionId();
|
|
762
762
|
const session = await getSession(sessionId, { engine, ...options });
|
|
763
763
|
let [resp, sys, messages, msgBuilder] = [null, [], [], null];
|
|
@@ -791,7 +791,7 @@ const talk = async (input, options) => {
|
|
|
791
791
|
}
|
|
792
792
|
while (countTokens([
|
|
793
793
|
...sys, ...messages, buildVertexMessage(input, { role: user })
|
|
794
|
-
]) >=
|
|
794
|
+
]) >= _MODEL.maxInputTokens) {
|
|
795
795
|
if (messages.length) {
|
|
796
796
|
session.messages.shift();
|
|
797
797
|
msgBuilder && msgBuilder();
|
package/lib/manifest.mjs
CHANGED