mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 18:30:22 +00:00
feat: add fast mode toggle for OpenAI models
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
extractThinkDirective,
|
||||
extractVerboseDirective,
|
||||
} from "./reply.js";
|
||||
import { extractStatusDirective } from "./reply/directives.js";
|
||||
import { extractFastDirective, extractStatusDirective } from "./reply/directives.js";
|
||||
|
||||
describe("directive parsing", () => {
|
||||
it("ignores verbose directive inside URL", () => {
|
||||
@@ -49,6 +49,12 @@ describe("directive parsing", () => {
|
||||
expect(res.reasoningLevel).toBe("stream");
|
||||
});
|
||||
|
||||
it("matches fast directive", () => {
|
||||
const res = extractFastDirective("/fast on please");
|
||||
expect(res.hasDirective).toBe(true);
|
||||
expect(res.fastMode).toBe(true);
|
||||
});
|
||||
|
||||
it("matches elevated with leading space", () => {
|
||||
const res = extractElevatedDirective(" please /elevated on now");
|
||||
expect(res.hasDirective).toBe(true);
|
||||
@@ -106,6 +112,14 @@ describe("directive parsing", () => {
|
||||
expect(res.cleaned).toBe("");
|
||||
});
|
||||
|
||||
it("matches fast with no argument", () => {
|
||||
const res = extractFastDirective("/fast:");
|
||||
expect(res.hasDirective).toBe(true);
|
||||
expect(res.fastMode).toBeUndefined();
|
||||
expect(res.rawLevel).toBeUndefined();
|
||||
expect(res.cleaned).toBe("");
|
||||
});
|
||||
|
||||
it("matches reasoning with no argument", () => {
|
||||
const res = extractReasoningDirective("/reasoning:");
|
||||
expect(res.hasDirective).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user