mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 12:14:46 +00:00
fix: type xai runtime thinking levels
This commit is contained in:
@@ -3,10 +3,11 @@ import { applyXaiModelCompat } from "openclaw/plugin-sdk/provider-tools";
|
||||
type XaiRuntimeModelCompat = {
|
||||
compat?: unknown;
|
||||
reasoning?: unknown;
|
||||
thinkingLevelMap?: Partial<
|
||||
Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null>
|
||||
>;
|
||||
thinkingLevelMap?: XaiThinkingLevelMap;
|
||||
};
|
||||
type XaiThinkingLevelMap = Partial<
|
||||
Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null>
|
||||
>;
|
||||
|
||||
const XAI_UNSUPPORTED_REASONING_EFFORTS = {
|
||||
off: null,
|
||||
@@ -26,7 +27,9 @@ const XAI_REASONING_EFFORTS = {
|
||||
xhigh: "high",
|
||||
} satisfies NonNullable<XaiRuntimeModelCompat["thinkingLevelMap"]>;
|
||||
|
||||
export function applyXaiRuntimeModelCompat<T extends XaiRuntimeModelCompat>(model: T): T {
|
||||
export function applyXaiRuntimeModelCompat<T extends XaiRuntimeModelCompat>(
|
||||
model: T,
|
||||
): T & { thinkingLevelMap: XaiThinkingLevelMap } {
|
||||
const withCompat = applyXaiModelCompat(model);
|
||||
return {
|
||||
...withCompat,
|
||||
|
||||
Reference in New Issue
Block a user