graphlit-client 1.0.20260601002 → 1.0.20260602001
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/client.js
CHANGED
|
@@ -382,6 +382,19 @@ function mapAnthropicEffort(effort) {
|
|
|
382
382
|
return undefined;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
+
function supportsAnthropicThinkingDisplay(specification) {
|
|
386
|
+
if (specification.serviceType !== Types.ModelServiceTypes.Anthropic) {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
const modelName = getModelName(specification);
|
|
390
|
+
if (!modelName) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return (modelName.startsWith("claude-opus-4") ||
|
|
394
|
+
modelName.startsWith("claude-sonnet-4") ||
|
|
395
|
+
modelName.startsWith("claude-haiku-4") ||
|
|
396
|
+
modelName === "claude-mythos-preview");
|
|
397
|
+
}
|
|
385
398
|
// Define the Graphlit class
|
|
386
399
|
class Graphlit {
|
|
387
400
|
client;
|
|
@@ -8335,16 +8348,21 @@ class Graphlit {
|
|
|
8335
8348
|
if (specification.serviceType === Types.ModelServiceTypes.Anthropic) {
|
|
8336
8349
|
const anthropic = specification.anthropic;
|
|
8337
8350
|
if (anthropic?.enableThinking) {
|
|
8351
|
+
const display = supportsAnthropicThinkingDisplay(specification)
|
|
8352
|
+
? "summarized"
|
|
8353
|
+
: undefined;
|
|
8338
8354
|
// Claude Opus 4.7/4.8 only support adaptive thinking with output_config.effort
|
|
8339
8355
|
if (isAnthropicAdaptiveThinkingOnlyModel(specification)) {
|
|
8340
8356
|
return {
|
|
8341
8357
|
type: "adaptive",
|
|
8342
8358
|
effort: mapAnthropicEffort(anthropic.effort),
|
|
8359
|
+
display,
|
|
8343
8360
|
};
|
|
8344
8361
|
}
|
|
8345
8362
|
return {
|
|
8346
8363
|
type: "enabled",
|
|
8347
8364
|
budget_tokens: anthropic.thinkingTokenLimit || 10000,
|
|
8365
|
+
display,
|
|
8348
8366
|
};
|
|
8349
8367
|
}
|
|
8350
8368
|
}
|
|
@@ -19,9 +19,11 @@ export declare function streamWithAnthropic(specification: Specification, messag
|
|
|
19
19
|
onEvent: (event: StreamEvent) => void, onComplete: (message: string, toolCalls: ConversationToolCall[], usage?: any, reasoning?: ReasoningMetadata) => void, abortSignal?: AbortSignal, thinkingConfig?: {
|
|
20
20
|
type: "enabled";
|
|
21
21
|
budget_tokens: number;
|
|
22
|
+
display?: "summarized";
|
|
22
23
|
} | {
|
|
23
24
|
type: "adaptive";
|
|
24
25
|
effort?: "low" | "medium" | "high" | "xhigh";
|
|
26
|
+
display?: "summarized";
|
|
25
27
|
}): Promise<void>;
|
|
26
28
|
/**
|
|
27
29
|
* Stream with Google SDK
|
|
@@ -551,7 +551,9 @@ onEvent, onComplete, abortSignal, thinkingConfig) {
|
|
|
551
551
|
if (thinkingConfig) {
|
|
552
552
|
if (thinkingConfig.type === "adaptive") {
|
|
553
553
|
// Claude Opus 4.7/4.8: adaptive thinking, effort controls depth via output_config
|
|
554
|
-
streamConfig.thinking =
|
|
554
|
+
streamConfig.thinking = thinkingConfig.display
|
|
555
|
+
? { type: "adaptive", display: thinkingConfig.display }
|
|
556
|
+
: { type: "adaptive" };
|
|
555
557
|
if (thinkingConfig.effort) {
|
|
556
558
|
streamConfig.output_config = { effort: thinkingConfig.effort };
|
|
557
559
|
}
|