@steipete/summarize 0.13.1 → 0.14.1
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/CHANGELOG.md +22 -0
- package/README.md +40 -2
- package/dist/cli.js +1 -1
- package/dist/esm/config/model.js +28 -1
- package/dist/esm/config/model.js.map +1 -1
- package/dist/esm/config/sections.js +27 -0
- package/dist/esm/config/sections.js.map +1 -1
- package/dist/esm/daemon/agent-model.js +4 -2
- package/dist/esm/daemon/agent-model.js.map +1 -1
- package/dist/esm/daemon/chat.js +13 -2
- package/dist/esm/daemon/chat.js.map +1 -1
- package/dist/esm/daemon/models.js +5 -1
- package/dist/esm/daemon/models.js.map +1 -1
- package/dist/esm/llm/cli.js +27 -3
- package/dist/esm/llm/cli.js.map +1 -1
- package/dist/esm/llm/generate-text-document.js +2 -1
- package/dist/esm/llm/generate-text-document.js.map +1 -1
- package/dist/esm/llm/generate-text-stream.js +4 -2
- package/dist/esm/llm/generate-text-stream.js.map +1 -1
- package/dist/esm/llm/generate-text.js +10 -2
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/html-to-markdown.js +2 -1
- package/dist/esm/llm/html-to-markdown.js.map +1 -1
- package/dist/esm/llm/model-options.js +63 -0
- package/dist/esm/llm/model-options.js.map +1 -0
- package/dist/esm/llm/provider-profile.js +4 -1
- package/dist/esm/llm/provider-profile.js.map +1 -1
- package/dist/esm/llm/providers/openai.js +45 -4
- package/dist/esm/llm/providers/openai.js.map +1 -1
- package/dist/esm/llm/transcript-to-markdown.js +2 -1
- package/dist/esm/llm/transcript-to-markdown.js.map +1 -1
- package/dist/esm/model-auto.js +9 -2
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/model-spec.js +25 -1
- package/dist/esm/model-spec.js.map +1 -1
- package/dist/esm/run/constants.js +16 -0
- package/dist/esm/run/constants.js.map +1 -1
- package/dist/esm/run/flows/asset/input.js +3 -0
- package/dist/esm/run/flows/asset/input.js.map +1 -1
- package/dist/esm/run/flows/asset/summary-attempts.js +3 -0
- package/dist/esm/run/flows/asset/summary-attempts.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +7 -0
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/summary-resolution.js +3 -0
- package/dist/esm/run/flows/url/summary-resolution.js.map +1 -1
- package/dist/esm/run/flows/url/types.js.map +1 -1
- package/dist/esm/run/help.js +7 -0
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/run-config.js +35 -0
- package/dist/esm/run/run-config.js.map +1 -1
- package/dist/esm/run/run-env.js +3 -1
- package/dist/esm/run/run-env.js.map +1 -1
- package/dist/esm/run/run-models.js +24 -3
- package/dist/esm/run/run-models.js.map +1 -1
- package/dist/esm/run/runner-execution.js +38 -1
- package/dist/esm/run/runner-execution.js.map +1 -1
- package/dist/esm/run/runner-plan.js +9 -4
- package/dist/esm/run/runner-plan.js.map +1 -1
- package/dist/esm/run/summary-engine.js +7 -0
- package/dist/esm/run/summary-engine.js.map +1 -1
- package/dist/esm/run/summary-llm.js +2 -1
- package/dist/esm/run/summary-llm.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/config/types.d.ts +15 -0
- package/dist/types/llm/generate-text-document.d.ts +2 -0
- package/dist/types/llm/generate-text-stream.d.ts +3 -1
- package/dist/types/llm/generate-text.d.ts +5 -2
- package/dist/types/llm/html-to-markdown.d.ts +3 -1
- package/dist/types/llm/model-options.d.ts +16 -0
- package/dist/types/llm/provider-profile.d.ts +3 -1
- package/dist/types/llm/providers/openai.d.ts +3 -1
- package/dist/types/llm/providers/types.d.ts +2 -0
- package/dist/types/llm/transcript-to-markdown.d.ts +3 -1
- package/dist/types/model-auto.d.ts +2 -0
- package/dist/types/model-spec.d.ts +7 -0
- package/dist/types/run/constants.d.ts +3 -0
- package/dist/types/run/flows/asset/input.d.ts +1 -0
- package/dist/types/run/flows/url/markdown.d.ts +1 -0
- package/dist/types/run/flows/url/types.d.ts +3 -0
- package/dist/types/run/run-config.d.ts +3 -0
- package/dist/types/run/run-context.d.ts +2 -0
- package/dist/types/run/runner-execution.d.ts +1 -1
- package/dist/types/run/summary-engine.d.ts +3 -0
- package/dist/types/run/summary-llm.d.ts +3 -1
- package/dist/types/run/types.d.ts +3 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/chrome-extension.md +1 -1
- package/docs/cli.md +5 -0
- package/docs/config.md +33 -2
- package/docs/llm.md +10 -1
- package/docs/openai.md +31 -0
- package/package.json +6 -6
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export type AutoRuleKind = "text" | "website" | "youtube" | "image" | "video" | "file";
|
|
2
2
|
export type VideoMode = "auto" | "transcript" | "understand";
|
|
3
3
|
export type CliProvider = "claude" | "codex" | "gemini" | "agent" | "openclaw" | "opencode";
|
|
4
|
+
export type OpenAiReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh";
|
|
5
|
+
export type OpenAiTextVerbosity = "low" | "medium" | "high";
|
|
6
|
+
export type ModelRequestOptions = {
|
|
7
|
+
serviceTier?: string;
|
|
8
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
9
|
+
textVerbosity?: OpenAiTextVerbosity;
|
|
10
|
+
};
|
|
4
11
|
export type CliProviderConfig = {
|
|
5
12
|
binary?: string;
|
|
6
13
|
extraArgs?: string[];
|
|
@@ -35,6 +42,10 @@ export type OpenAiConfig = {
|
|
|
35
42
|
*/
|
|
36
43
|
baseUrl?: string;
|
|
37
44
|
useChatCompletions?: boolean;
|
|
45
|
+
serviceTier?: string;
|
|
46
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
47
|
+
thinking?: OpenAiReasoningEffort;
|
|
48
|
+
textVerbosity?: OpenAiTextVerbosity;
|
|
38
49
|
/**
|
|
39
50
|
* USD per minute for OpenAI Whisper transcription cost estimation.
|
|
40
51
|
*
|
|
@@ -149,6 +160,10 @@ export type AutoRule = {
|
|
|
149
160
|
};
|
|
150
161
|
export type ModelConfig = {
|
|
151
162
|
id: string;
|
|
163
|
+
serviceTier?: string;
|
|
164
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
165
|
+
thinking?: OpenAiReasoningEffort;
|
|
166
|
+
textVerbosity?: OpenAiTextVerbosity;
|
|
152
167
|
} | {
|
|
153
168
|
mode: "auto";
|
|
154
169
|
rules?: AutoRule[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LlmProvider } from "./model-id.js";
|
|
2
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
2
3
|
import type { Prompt } from "./prompt.js";
|
|
3
4
|
import type { LlmTokenUsage } from "./types.js";
|
|
4
5
|
type ParsedModel = {
|
|
@@ -30,6 +31,7 @@ export declare function maybeGenerateDocumentText(options: {
|
|
|
30
31
|
anthropicBaseUrlOverride?: string | null;
|
|
31
32
|
googleBaseUrlOverride?: string | null;
|
|
32
33
|
forceChatCompletions?: boolean;
|
|
34
|
+
requestOptions?: ModelRequestOptions;
|
|
33
35
|
retryWithModelId: (modelId: string) => Promise<DocumentResult>;
|
|
34
36
|
}): Promise<DocumentResult | null>;
|
|
35
37
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "@mariozechner/pi-ai";
|
|
2
2
|
import type { LlmApiKeys } from "./generate-text.js";
|
|
3
3
|
import type { LlmProvider } from "./model-id.js";
|
|
4
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
4
5
|
import type { LlmTokenUsage } from "./types.js";
|
|
5
6
|
export type StreamTextWithContextArgs = {
|
|
6
7
|
modelId: string;
|
|
@@ -16,6 +17,7 @@ export type StreamTextWithContextArgs = {
|
|
|
16
17
|
googleBaseUrlOverride?: string | null;
|
|
17
18
|
xaiBaseUrlOverride?: string | null;
|
|
18
19
|
forceChatCompletions?: boolean;
|
|
20
|
+
requestOptions?: ModelRequestOptions;
|
|
19
21
|
};
|
|
20
22
|
export type StreamTextResult = {
|
|
21
23
|
textStream: AsyncIterable<string>;
|
|
@@ -24,4 +26,4 @@ export type StreamTextResult = {
|
|
|
24
26
|
usage: Promise<LlmTokenUsage | null>;
|
|
25
27
|
lastError: () => unknown;
|
|
26
28
|
};
|
|
27
|
-
export declare function streamTextWithContext({ modelId, apiKeys, context, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, forceChatCompletions, }: StreamTextWithContextArgs): Promise<StreamTextResult>;
|
|
29
|
+
export declare function streamTextWithContext({ modelId, apiKeys, context, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, forceChatCompletions, requestOptions, }: StreamTextWithContextArgs): Promise<StreamTextResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LlmProvider } from "./model-id.js";
|
|
2
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
2
3
|
import type { Prompt } from "./prompt.js";
|
|
3
4
|
import type { LlmTokenUsage } from "./types.js";
|
|
4
5
|
export { streamTextWithContext } from "./generate-text-stream.js";
|
|
@@ -19,7 +20,7 @@ type RetryNotice = {
|
|
|
19
20
|
delayMs: number;
|
|
20
21
|
error: unknown;
|
|
21
22
|
};
|
|
22
|
-
export declare function generateTextWithModelId({ modelId, apiKeys, prompt, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, zaiBaseUrlOverride, forceChatCompletions, retries, onRetry, }: {
|
|
23
|
+
export declare function generateTextWithModelId({ modelId, apiKeys, prompt, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, zaiBaseUrlOverride, forceChatCompletions, requestOptions, retries, onRetry, }: {
|
|
23
24
|
modelId: string;
|
|
24
25
|
apiKeys: LlmApiKeys;
|
|
25
26
|
prompt: Prompt;
|
|
@@ -34,6 +35,7 @@ export declare function generateTextWithModelId({ modelId, apiKeys, prompt, temp
|
|
|
34
35
|
xaiBaseUrlOverride?: string | null;
|
|
35
36
|
zaiBaseUrlOverride?: string | null;
|
|
36
37
|
forceChatCompletions?: boolean;
|
|
38
|
+
requestOptions?: ModelRequestOptions;
|
|
37
39
|
retries?: number;
|
|
38
40
|
onRetry?: (notice: RetryNotice) => void;
|
|
39
41
|
}): Promise<{
|
|
@@ -42,7 +44,7 @@ export declare function generateTextWithModelId({ modelId, apiKeys, prompt, temp
|
|
|
42
44
|
provider: LlmProvider;
|
|
43
45
|
usage: LlmTokenUsage | null;
|
|
44
46
|
}>;
|
|
45
|
-
export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, forceChatCompletions, }: {
|
|
47
|
+
export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, forceChatCompletions, requestOptions, }: {
|
|
46
48
|
modelId: string;
|
|
47
49
|
apiKeys: LlmApiKeys;
|
|
48
50
|
prompt: Prompt;
|
|
@@ -56,6 +58,7 @@ export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temper
|
|
|
56
58
|
googleBaseUrlOverride?: string | null;
|
|
57
59
|
xaiBaseUrlOverride?: string | null;
|
|
58
60
|
forceChatCompletions?: boolean;
|
|
61
|
+
requestOptions?: ModelRequestOptions;
|
|
59
62
|
}): Promise<{
|
|
60
63
|
textStream: AsyncIterable<string>;
|
|
61
64
|
canonicalModelId: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ConvertHtmlToMarkdown } from "@steipete/summarize-core/content";
|
|
2
2
|
import type { LlmTokenUsage } from "./generate-text.js";
|
|
3
3
|
import type { LlmProvider } from "./model-id.js";
|
|
4
|
-
|
|
4
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
5
|
+
export declare function createHtmlToMarkdownConverter({ modelId, forceOpenRouter, xaiApiKey, googleApiKey, openaiApiKey, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, anthropicApiKey, openrouterApiKey, fetchImpl, forceChatCompletions, requestOptions, retries, onRetry, onUsage, }: {
|
|
5
6
|
modelId: string;
|
|
6
7
|
forceOpenRouter?: boolean;
|
|
7
8
|
xaiApiKey: string | null;
|
|
@@ -15,6 +16,7 @@ export declare function createHtmlToMarkdownConverter({ modelId, forceOpenRouter
|
|
|
15
16
|
anthropicApiKey: string | null;
|
|
16
17
|
openrouterApiKey: string | null;
|
|
17
18
|
forceChatCompletions?: boolean;
|
|
19
|
+
requestOptions?: ModelRequestOptions;
|
|
18
20
|
retries?: number;
|
|
19
21
|
onRetry?: (notice: {
|
|
20
22
|
attempt: number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type OpenAiReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh";
|
|
2
|
+
export type OpenAiServiceTier = "default" | "fast" | "priority" | "flex";
|
|
3
|
+
export type OpenAiTextVerbosity = "low" | "medium" | "high";
|
|
4
|
+
export type ModelRequestOptions = {
|
|
5
|
+
serviceTier?: string;
|
|
6
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
7
|
+
textVerbosity?: OpenAiTextVerbosity;
|
|
8
|
+
};
|
|
9
|
+
export type ModelRequestOptionsInput = ModelRequestOptions & {
|
|
10
|
+
thinking?: OpenAiReasoningEffort;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseOpenAiReasoningEffort(raw: string, label?: string): OpenAiReasoningEffort;
|
|
13
|
+
export declare function parseOpenAiTextVerbosity(raw: string, label?: string): OpenAiTextVerbosity;
|
|
14
|
+
export declare function parseOpenAiServiceTier(raw: string, label?: string): OpenAiServiceTier;
|
|
15
|
+
export declare function mergeModelRequestOptions(...entries: Array<ModelRequestOptionsInput | null | undefined>): ModelRequestOptions | undefined;
|
|
16
|
+
export declare function toOpenAiServiceTierParam(serviceTier: string | undefined): string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
2
3
|
import type { OpenAiClientConfig } from "./providers/types.js";
|
|
3
4
|
export type GatewayProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot";
|
|
4
5
|
export type RequiredModelEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "GITHUB_TOKEN" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE";
|
|
@@ -20,12 +21,13 @@ export declare function isVideoUnderstandingCapableProvider(provider: GatewayPro
|
|
|
20
21
|
export declare function envHasRequiredKey(env: Record<string, string | undefined>, requiredEnv: RequiredModelEnv): boolean;
|
|
21
22
|
export declare function resolveRequiredEnvForModelId(modelId: string): RequiredModelEnv;
|
|
22
23
|
export declare function isVideoUnderstandingCapableModelId(modelId: string): boolean;
|
|
23
|
-
export declare function resolveOpenAiCompatibleClientConfigForProvider({ provider, openaiApiKey, openrouterApiKey, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, }: {
|
|
24
|
+
export declare function resolveOpenAiCompatibleClientConfigForProvider({ provider, openaiApiKey, openrouterApiKey, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: {
|
|
24
25
|
provider: "openai" | "zai" | "nvidia" | "github-copilot";
|
|
25
26
|
openaiApiKey: string | null;
|
|
26
27
|
openrouterApiKey: string | null;
|
|
27
28
|
forceOpenRouter?: boolean;
|
|
28
29
|
openaiBaseUrlOverride?: string | null;
|
|
29
30
|
forceChatCompletions?: boolean;
|
|
31
|
+
requestOptions?: ModelRequestOptions;
|
|
30
32
|
}): OpenAiClientConfig;
|
|
31
33
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Context } from "@mariozechner/pi-ai";
|
|
2
2
|
import type { Attachment } from "../attachments.js";
|
|
3
|
+
import { type ModelRequestOptions } from "../model-options.js";
|
|
3
4
|
import type { LlmTokenUsage } from "../types.js";
|
|
4
5
|
import type { OpenAiClientConfig } from "./types.js";
|
|
5
6
|
export type OpenAiClientConfigInput = {
|
|
@@ -10,13 +11,14 @@ export type OpenAiClientConfigInput = {
|
|
|
10
11
|
forceOpenRouter?: boolean;
|
|
11
12
|
openaiBaseUrlOverride?: string | null;
|
|
12
13
|
forceChatCompletions?: boolean;
|
|
14
|
+
requestOptions?: ModelRequestOptions;
|
|
13
15
|
};
|
|
14
16
|
type OpenAiTextCompletionResult = {
|
|
15
17
|
text: string;
|
|
16
18
|
usage: LlmTokenUsage | null;
|
|
17
19
|
resolvedModelId?: string;
|
|
18
20
|
};
|
|
19
|
-
export declare function resolveOpenAiClientConfig({ apiKeys, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, }: OpenAiClientConfigInput): OpenAiClientConfig;
|
|
21
|
+
export declare function resolveOpenAiClientConfig({ apiKeys, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: OpenAiClientConfigInput): OpenAiClientConfig;
|
|
20
22
|
export declare function completeOpenAiText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: {
|
|
21
23
|
modelId: string;
|
|
22
24
|
openaiConfig: OpenAiClientConfig;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ModelRequestOptions } from "../model-options.js";
|
|
1
2
|
export type OpenAiClientConfig = {
|
|
2
3
|
apiKey: string;
|
|
3
4
|
baseURL?: string;
|
|
4
5
|
useChatCompletions: boolean;
|
|
5
6
|
isOpenRouter: boolean;
|
|
6
7
|
extraHeaders?: Record<string, string>;
|
|
8
|
+
requestOptions?: ModelRequestOptions;
|
|
7
9
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OutputLanguage } from "../language.js";
|
|
2
2
|
import type { LlmTokenUsage } from "./generate-text.js";
|
|
3
3
|
import type { LlmProvider } from "./model-id.js";
|
|
4
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
4
5
|
export type ConvertTranscriptToMarkdown = (args: {
|
|
5
6
|
title: string | null;
|
|
6
7
|
source: string | null;
|
|
@@ -8,7 +9,7 @@ export type ConvertTranscriptToMarkdown = (args: {
|
|
|
8
9
|
timeoutMs: number;
|
|
9
10
|
outputLanguage?: OutputLanguage | null;
|
|
10
11
|
}) => Promise<string>;
|
|
11
|
-
export declare function createTranscriptToMarkdownConverter({ modelId, forceOpenRouter, xaiApiKey, googleApiKey, openaiApiKey, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, anthropicApiKey, openrouterApiKey, fetchImpl, forceChatCompletions, retries, onRetry, onUsage, }: {
|
|
12
|
+
export declare function createTranscriptToMarkdownConverter({ modelId, forceOpenRouter, xaiApiKey, googleApiKey, openaiApiKey, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, anthropicApiKey, openrouterApiKey, fetchImpl, forceChatCompletions, requestOptions, retries, onRetry, onUsage, }: {
|
|
12
13
|
modelId: string;
|
|
13
14
|
forceOpenRouter?: boolean;
|
|
14
15
|
xaiApiKey: string | null;
|
|
@@ -22,6 +23,7 @@ export declare function createTranscriptToMarkdownConverter({ modelId, forceOpen
|
|
|
22
23
|
anthropicApiKey: string | null;
|
|
23
24
|
openrouterApiKey: string | null;
|
|
24
25
|
forceChatCompletions?: boolean;
|
|
26
|
+
requestOptions?: ModelRequestOptions;
|
|
25
27
|
retries?: number;
|
|
26
28
|
onRetry?: (notice: {
|
|
27
29
|
attempt: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AutoRuleKind, CliProvider, SummarizeConfig } from "./config.js";
|
|
2
|
+
import type { ModelRequestOptions } from "./llm/model-options.js";
|
|
2
3
|
import { type RequiredModelEnv } from "./llm/provider-capabilities.js";
|
|
3
4
|
import { resolveCliAutoFallbackConfig, type ResolvedCliAutoFallbackConfig } from "./model-auto-cli.js";
|
|
4
5
|
import type { LiteLlmCatalog } from "./pricing/litellm.js";
|
|
@@ -26,6 +27,7 @@ export type AutoModelAttempt = {
|
|
|
26
27
|
openrouterProviders: string[] | null;
|
|
27
28
|
forceOpenRouter: boolean;
|
|
28
29
|
requiredEnv: RequiredModelEnv;
|
|
30
|
+
requestOptions?: ModelRequestOptions;
|
|
29
31
|
debug: string;
|
|
30
32
|
};
|
|
31
33
|
export declare function envHasKey(env: Record<string, string | undefined>, requiredEnv: AutoModelAttempt["requiredEnv"]): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CliProvider } from "./config.js";
|
|
2
2
|
import type { LlmProvider } from "./llm/model-id.js";
|
|
3
|
+
import type { ModelRequestOptions } from "./llm/model-options.js";
|
|
3
4
|
export type FixedModelSpec = {
|
|
4
5
|
transport: "native";
|
|
5
6
|
userModelId: string;
|
|
@@ -10,6 +11,7 @@ export type FixedModelSpec = {
|
|
|
10
11
|
requiredEnv: "XAI_API_KEY" | "OPENAI_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "Z_AI_API_KEY" | "NVIDIA_API_KEY" | "GITHUB_TOKEN";
|
|
11
12
|
openaiBaseUrlOverride?: string | null;
|
|
12
13
|
forceChatCompletions?: boolean;
|
|
14
|
+
requestOptions?: ModelRequestOptions;
|
|
13
15
|
} | {
|
|
14
16
|
transport: "openrouter";
|
|
15
17
|
userModelId: string;
|
|
@@ -18,6 +20,7 @@ export type FixedModelSpec = {
|
|
|
18
20
|
openrouterProviders: string[] | null;
|
|
19
21
|
forceOpenRouter: true;
|
|
20
22
|
requiredEnv: "OPENROUTER_API_KEY";
|
|
23
|
+
requestOptions?: ModelRequestOptions;
|
|
21
24
|
} | {
|
|
22
25
|
transport: "cli";
|
|
23
26
|
userModelId: string;
|
|
@@ -33,4 +36,8 @@ export type RequestedModel = {
|
|
|
33
36
|
} | ({
|
|
34
37
|
kind: "fixed";
|
|
35
38
|
} & FixedModelSpec);
|
|
39
|
+
export declare function resolveOpenAiFastModelId(modelId: string): {
|
|
40
|
+
modelId: string;
|
|
41
|
+
options: ModelRequestOptions;
|
|
42
|
+
} | null;
|
|
36
43
|
export declare function parseRequestedModelId(raw: string): RequestedModel;
|
|
@@ -5,5 +5,8 @@ export declare const UVX_TIP = "Tip: Install uv (uvx) for local Markdown convers
|
|
|
5
5
|
export declare const SUPPORT_URL = "https://github.com/steipete/summarize";
|
|
6
6
|
export declare const TWITTER_HOSTS: Set<string>;
|
|
7
7
|
export declare const MAX_TEXT_BYTES_DEFAULT: number;
|
|
8
|
+
export declare const MAX_PDF_EXTRACT_BYTES: number;
|
|
9
|
+
export declare const GPT_FAST_MODEL_ID = "openai/gpt-5.5";
|
|
10
|
+
export declare const CODEX_GPT_FAST_MODEL_ID = "cli/codex/gpt-fast";
|
|
8
11
|
export declare const BUILTIN_MODELS: Record<string, ModelConfig>;
|
|
9
12
|
export declare const VERBOSE_PREFIX = "[summarize]";
|
|
@@ -7,6 +7,7 @@ import type { SummarizeAssetArgs } from "./summary.js";
|
|
|
7
7
|
* which has a higher size limit (2GB vs 50MB).
|
|
8
8
|
*/
|
|
9
9
|
export declare function isTranscribableExtension(filePath: string): boolean;
|
|
10
|
+
export declare function isPdfExtension(filePath: string): boolean;
|
|
10
11
|
export type AssetInputContext = {
|
|
11
12
|
env: Record<string, string | undefined>;
|
|
12
13
|
envForRun: Record<string, string | undefined>;
|
|
@@ -7,6 +7,7 @@ export type MarkdownModel = {
|
|
|
7
7
|
openaiApiKeyOverride?: string | null;
|
|
8
8
|
openaiBaseUrlOverride?: string | null;
|
|
9
9
|
forceChatCompletions?: boolean;
|
|
10
|
+
requestOptions?: ModelAttempt["requestOptions"];
|
|
10
11
|
requiredEnv?: ModelAttempt["requiredEnv"];
|
|
11
12
|
};
|
|
12
13
|
export type MarkdownConverters = {
|
|
@@ -4,6 +4,7 @@ import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from
|
|
|
4
4
|
import type { LlmCall, RunMetricsReport } from "../../../costs.js";
|
|
5
5
|
import type { StreamMode } from "../../../flags.js";
|
|
6
6
|
import type { OutputLanguage } from "../../../language.js";
|
|
7
|
+
import type { ModelRequestOptions } from "../../../llm/model-options.js";
|
|
7
8
|
import type { ExecFileFn } from "../../../markitdown.js";
|
|
8
9
|
import type { FixedModelSpec, RequestedModel } from "../../../model-spec.js";
|
|
9
10
|
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
@@ -76,6 +77,8 @@ export type UrlFlowModel = {
|
|
|
76
77
|
envForAuto: Record<string, string | undefined>;
|
|
77
78
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
78
79
|
openaiUseChatCompletions: boolean;
|
|
80
|
+
openaiRequestOptions?: ModelRequestOptions;
|
|
81
|
+
openaiRequestOptionsOverride?: ModelRequestOptions;
|
|
79
82
|
openaiWhisperUsdPerMinute: number;
|
|
80
83
|
apiStatus: {
|
|
81
84
|
xaiApiKey: string | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CliProvider, SummarizeConfig } from "../config.js";
|
|
2
2
|
import { parseVideoMode } from "../flags.js";
|
|
3
3
|
import { type OutputLanguage } from "../language.js";
|
|
4
|
+
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
4
5
|
export type ConfigState = {
|
|
5
6
|
config: SummarizeConfig | null;
|
|
6
7
|
configPath: string | null;
|
|
@@ -10,6 +11,8 @@ export type ConfigState = {
|
|
|
10
11
|
cliConfigForRun: SummarizeConfig["cli"] | undefined;
|
|
11
12
|
configForCli: SummarizeConfig | null;
|
|
12
13
|
openaiUseChatCompletions: boolean;
|
|
14
|
+
openaiRequestOptions: ModelRequestOptions | undefined;
|
|
15
|
+
openaiRequestOptionsOverride: ModelRequestOptions | undefined;
|
|
13
16
|
configModelLabel: string | null;
|
|
14
17
|
};
|
|
15
18
|
export declare function resolveConfigState({ envForRun, programOpts, languageExplicitlySet, videoModeExplicitlySet, cliFlagPresent, cliProviderArg, }: {
|
|
@@ -46,5 +46,7 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
46
46
|
cliConfigForRun: import("../config.js").SummarizeConfig["cli"] | undefined;
|
|
47
47
|
configForCli: import("../config.js").SummarizeConfig | null;
|
|
48
48
|
openaiUseChatCompletions: boolean;
|
|
49
|
+
openaiRequestOptions: import("../llm/model-options.js").ModelRequestOptions | undefined;
|
|
50
|
+
openaiRequestOptionsOverride: import("../llm/model-options.js").ModelRequestOptions | undefined;
|
|
49
51
|
configModelLabel: string | null;
|
|
50
52
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InputTarget } from "../content/asset.js";
|
|
2
2
|
import type { RunMetricsReport } from "../costs.js";
|
|
3
3
|
import type { ExecFileFn } from "../markitdown.js";
|
|
4
4
|
import type { AssetExtractContext } from "./flows/asset/extract.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import { runCliModel } from "../llm/cli.js";
|
|
3
|
+
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
3
4
|
import type { Prompt } from "../llm/prompt.js";
|
|
4
5
|
import { type StreamOutputMode } from "./stream-output.js";
|
|
5
6
|
import { summarizeWithModelId } from "./summary-llm.js";
|
|
@@ -18,6 +19,8 @@ export type SummaryEngineDeps = {
|
|
|
18
19
|
verbose: boolean;
|
|
19
20
|
verboseColor: boolean;
|
|
20
21
|
openaiUseChatCompletions: boolean;
|
|
22
|
+
openaiRequestOptions?: ModelRequestOptions;
|
|
23
|
+
openaiRequestOptionsOverride?: ModelRequestOptions;
|
|
21
24
|
cliConfigForRun: Parameters<typeof runCliModel>[0]["config"];
|
|
22
25
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
23
26
|
trackedFetch: typeof fetch;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { generateTextWithModelId } from "../llm/generate-text.js";
|
|
2
2
|
import type { LlmProvider } from "../llm/model-id.js";
|
|
3
3
|
import type { parseGatewayStyleModelId } from "../llm/model-id.js";
|
|
4
|
+
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
4
5
|
import type { Prompt } from "../llm/prompt.js";
|
|
5
6
|
export declare function resolveModelIdForLlmCall({ parsedModel, apiKeys, fetchImpl, timeoutMs, }: {
|
|
6
7
|
parsedModel: ReturnType<typeof parseGatewayStyleModelId>;
|
|
@@ -14,7 +15,7 @@ export declare function resolveModelIdForLlmCall({ parsedModel, apiKeys, fetchIm
|
|
|
14
15
|
note: string | null;
|
|
15
16
|
forceStreamOff: boolean;
|
|
16
17
|
}>;
|
|
17
|
-
export declare function summarizeWithModelId({ modelId, prompt, maxOutputTokens, timeoutMs, fetchImpl, apiKeys, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, zaiBaseUrlOverride, forceChatCompletions, retries, onRetry, }: {
|
|
18
|
+
export declare function summarizeWithModelId({ modelId, prompt, maxOutputTokens, timeoutMs, fetchImpl, apiKeys, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, zaiBaseUrlOverride, forceChatCompletions, requestOptions, retries, onRetry, }: {
|
|
18
19
|
modelId: string;
|
|
19
20
|
prompt: Prompt;
|
|
20
21
|
maxOutputTokens?: number;
|
|
@@ -34,6 +35,7 @@ export declare function summarizeWithModelId({ modelId, prompt, maxOutputTokens,
|
|
|
34
35
|
xaiBaseUrlOverride?: string | null;
|
|
35
36
|
zaiBaseUrlOverride?: string | null;
|
|
36
37
|
forceChatCompletions?: boolean;
|
|
38
|
+
requestOptions?: ModelRequestOptions;
|
|
37
39
|
retries: number;
|
|
38
40
|
onRetry?: (notice: {
|
|
39
41
|
attempt: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import type { LlmProvider } from "../llm/model-id.js";
|
|
3
|
+
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
3
4
|
export type ModelAttemptRequiredEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "GITHUB_TOKEN" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE";
|
|
4
5
|
export type ModelAttempt = {
|
|
5
6
|
transport: "native" | "openrouter" | "cli";
|
|
@@ -11,6 +12,7 @@ export type ModelAttempt = {
|
|
|
11
12
|
openaiBaseUrlOverride?: string | null;
|
|
12
13
|
openaiApiKeyOverride?: string | null;
|
|
13
14
|
forceChatCompletions?: boolean;
|
|
15
|
+
requestOptions?: ModelRequestOptions;
|
|
14
16
|
cliProvider?: CliProvider;
|
|
15
17
|
cliModel?: string | null;
|
|
16
18
|
};
|
|
@@ -24,5 +26,6 @@ export type MarkdownModel = {
|
|
|
24
26
|
openaiApiKeyOverride?: string | null;
|
|
25
27
|
openaiBaseUrlOverride?: string | null;
|
|
26
28
|
forceChatCompletions?: boolean;
|
|
29
|
+
requestOptions?: ModelRequestOptions;
|
|
27
30
|
requiredEnv?: ModelAttemptRequiredEnv;
|
|
28
31
|
};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FALLBACK_VERSION = "0.
|
|
1
|
+
export declare const FALLBACK_VERSION = "0.14.1";
|
|
2
2
|
export declare function resolvePackageVersion(importMetaUrl?: string): string;
|
|
3
3
|
export declare function resolveGitSha(importMetaUrl?: string): string | null;
|
|
4
4
|
export declare function formatVersionLine(importMetaUrl?: string): string;
|
package/docs/chrome-extension.md
CHANGED
|
@@ -144,7 +144,7 @@ See `docs/media.md` for detection and transcript rules.
|
|
|
144
144
|
## Model Selection UX
|
|
145
145
|
|
|
146
146
|
- Settings:
|
|
147
|
-
- Model preset (Options → Advanced): `auto` | `free` | custom string (e.g. `openai/gpt-5-mini`, `openrouter/...`).
|
|
147
|
+
- Model preset (Options → Advanced): `auto` | `free` | custom string (e.g. `openai/gpt-5-mini`, `openai/gpt-5.5`, `openrouter/...`). OpenAI fast service tier is configured via `openai.serviceTier`.
|
|
148
148
|
- Length: `short|medium|long|xl|xxl` (or a character target like `20k`). Tooltips show target ranges + paragraph guidance (from `packages/core/src/prompts/summary-lengths.ts`).
|
|
149
149
|
- Language: `auto` (match source) or a tag like `en`, `de`, `pt-BR` (or free-form like “German”).
|
|
150
150
|
- Prompt override (advanced): custom instruction prefix (context + content still appended).
|
package/docs/cli.md
CHANGED
|
@@ -22,6 +22,11 @@ Summarize can use installed CLIs (Claude, Codex, Gemini, Cursor Agent, OpenClaw,
|
|
|
22
22
|
Use `--cli [provider]` (case-insensitive) for the provider default, or `--model cli/<provider>/<model>` to pin a model.
|
|
23
23
|
If `--cli` is provided without a provider, auto selection is used with CLI enabled.
|
|
24
24
|
|
|
25
|
+
Codex GPT Fast:
|
|
26
|
+
|
|
27
|
+
- `--model codex-fast` maps to `cli/codex/gpt-fast`.
|
|
28
|
+
- OpenAI fast mode is not a CLI model. Use `--model openai/gpt-5.5 --fast --thinking medium`; see `docs/openai.md`.
|
|
29
|
+
|
|
25
30
|
## Auto mode
|
|
26
31
|
|
|
27
32
|
Auto mode can prepend CLI attempts in two ways:
|
package/docs/config.md
CHANGED
|
@@ -234,7 +234,7 @@ Define presets you can select via `--model <preset>`:
|
|
|
234
234
|
```json
|
|
235
235
|
{
|
|
236
236
|
"models": {
|
|
237
|
-
"
|
|
237
|
+
"small": { "id": "openai/gpt-5-mini" },
|
|
238
238
|
"or-free": {
|
|
239
239
|
"rules": [
|
|
240
240
|
{
|
|
@@ -253,12 +253,43 @@ Notes:
|
|
|
253
253
|
|
|
254
254
|
- `auto` is reserved and can’t be defined as a preset.
|
|
255
255
|
- `free` is built-in (OpenRouter `:free` candidates). Override it by defining `models.free` in your config, or regenerate it via `summarize refresh-free`.
|
|
256
|
+
- `gpt-fast` and `fast` remain compatibility aliases for OpenAI GPT-5.5 Fast mode. Prefer `model: "openai/gpt-5.5"` plus `openai.serviceTier` / `openai.thinking`. `codex-fast` is the explicit Codex CLI fast preset.
|
|
257
|
+
|
|
258
|
+
OpenAI request options can be set globally:
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"openai": {
|
|
263
|
+
"serviceTier": "fast",
|
|
264
|
+
"thinking": "medium",
|
|
265
|
+
"textVerbosity": "low"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Or per preset:
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"models": {
|
|
275
|
+
"fast-mini": {
|
|
276
|
+
"id": "openai/gpt-5.4-mini",
|
|
277
|
+
"serviceTier": "fast",
|
|
278
|
+
"thinking": "low"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`thinking` is an alias for `reasoningEffort`. Supported values: `none`, `low`, `medium`, `high`, `xhigh`; shorthand aliases include `off`, `min` (low), `mid`, `med`, `x-high`, and `extra-high`.
|
|
285
|
+
|
|
286
|
+
`serviceTier: "fast"` is the summarize/Codex-facing spelling. Direct OpenAI requests map it to `service_tier="priority"`. CLI `--service-tier default` clears a configured tier for one run.
|
|
256
287
|
|
|
257
288
|
Use a preset as your default `model`:
|
|
258
289
|
|
|
259
290
|
```json
|
|
260
291
|
{
|
|
261
|
-
"model": "
|
|
292
|
+
"model": "small"
|
|
262
293
|
}
|
|
263
294
|
```
|
|
264
295
|
|
package/docs/llm.md
CHANGED
|
@@ -42,6 +42,8 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
|
|
|
42
42
|
- `--model <model>`
|
|
43
43
|
- Examples:
|
|
44
44
|
- `cli/codex/gpt-5.2`
|
|
45
|
+
- `openai/gpt-5.5`
|
|
46
|
+
- `codex-fast` (explicit Codex CLI GPT Fast preset)
|
|
45
47
|
- `cli/claude/sonnet`
|
|
46
48
|
- `cli/gemini/flash`
|
|
47
49
|
- `cli/agent/auto`
|
|
@@ -65,7 +67,7 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
|
|
|
65
67
|
- `--model auto`
|
|
66
68
|
- See `docs/model-auto.md`
|
|
67
69
|
- `--model <preset>`
|
|
68
|
-
- Uses a config-defined preset (see `docs/config.md` → “Presets”).
|
|
70
|
+
- Uses a built-in or config-defined preset (see `docs/config.md` → “Presets”).
|
|
69
71
|
- `--prompt <text>` / `--prompt-file <path>`
|
|
70
72
|
- Overrides the built-in summary instructions (prompt becomes the instruction prefix).
|
|
71
73
|
- Prompts are wrapped in `<instructions>`, `<context>`, `<content>` tags.
|
|
@@ -91,6 +93,13 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
|
|
|
91
93
|
- If omitted, no max token parameter is sent (provider default).
|
|
92
94
|
- Minimum numeric value: 16.
|
|
93
95
|
- Recommendation: prefer `--length` unless you need a hard cap (some providers count “reasoning” into the cap).
|
|
96
|
+
- `--thinking none|low|medium|high|xhigh`
|
|
97
|
+
- Sets OpenAI reasoning effort for `openai/...` GPT-5-family models.
|
|
98
|
+
- Short aliases: `off`, `min` (low), `mid` / `med`, `x-high`, `extra-high`.
|
|
99
|
+
- `--fast`
|
|
100
|
+
- Shorthand for `--service-tier fast` on OpenAI models.
|
|
101
|
+
- `--service-tier default|fast|priority|flex`
|
|
102
|
+
- OpenAI service tier override. `fast` is the summarize-facing alias for OpenAI `priority`; `default` sends no service tier.
|
|
94
103
|
- `--retries <count>`
|
|
95
104
|
- LLM retry attempts on timeout (default: 1).
|
|
96
105
|
- `--json` (includes prompt + summary in one JSON object)
|
package/docs/openai.md
CHANGED
|
@@ -10,6 +10,19 @@ Use OpenAI directly by choosing an `openai/...` model id.
|
|
|
10
10
|
|
|
11
11
|
For the full model/provider matrix, see `docs/llm.md`.
|
|
12
12
|
|
|
13
|
+
Fast mode is a service tier, not a model id. Prefer flags:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
summarize URL --model openai/gpt-5.5 --fast --thinking medium
|
|
17
|
+
summarize URL --model openai/gpt-5.4 --service-tier fast --thinking low
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Compatibility aliases:
|
|
21
|
+
|
|
22
|
+
- `--model gpt-fast` / `--model fast`: `openai/gpt-5.5` with fast service tier and medium thinking.
|
|
23
|
+
- `--model openai/gpt-5.5-fast` or `--model openai/gpt-5.4-mini-fast`: strip the `-fast` suffix for the API model id and use fast service tier.
|
|
24
|
+
- `--model codex-fast`: explicit Codex CLI fast preset.
|
|
25
|
+
|
|
13
26
|
## Env
|
|
14
27
|
|
|
15
28
|
- `OPENAI_API_KEY` (required for `openai/...` models)
|
|
@@ -18,12 +31,30 @@ For the full model/provider matrix, see `docs/llm.md`.
|
|
|
18
31
|
## Flags
|
|
19
32
|
|
|
20
33
|
- `--model openai/<model>`
|
|
34
|
+
- `--fast`
|
|
35
|
+
- `--service-tier default|fast|priority|flex`
|
|
36
|
+
- `--thinking none|low|medium|high|xhigh`
|
|
21
37
|
- `--length short|medium|long|xl|xxl|<chars>`
|
|
22
38
|
- This is _soft guidance_ to the model (no hard truncation).
|
|
23
39
|
- `--max-output-tokens <count>`
|
|
24
40
|
- Hard cap for output tokens (optional).
|
|
25
41
|
- `--json` (includes prompt + summary in one JSON object)
|
|
26
42
|
|
|
43
|
+
## Config
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"openai": {
|
|
48
|
+
"serviceTier": "fast",
|
|
49
|
+
"thinking": "medium"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`openai.reasoningEffort` is the long-form alias for `openai.thinking`. Model presets can also set `serviceTier`, `thinking` / `reasoningEffort`, and `textVerbosity`.
|
|
55
|
+
|
|
56
|
+
Use `"serviceTier": "fast"` in summarize config and model presets. OpenAI API requests map that to `service_tier="priority"`; `"flex"` and explicit `"priority"` pass through as-is. Use `--service-tier default` to clear a configured tier for one run.
|
|
57
|
+
|
|
27
58
|
## PDF inputs
|
|
28
59
|
|
|
29
60
|
- When a PDF is provided and `--preprocess auto` is used, summarize sends the PDF as a file input via the OpenAI Responses API.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steipete/summarize",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Link → clean text → summary.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"summarize": "./dist/cli.js",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mariozechner/pi-ai": "^0.
|
|
35
|
+
"@mariozechner/pi-ai": "^0.70.2",
|
|
36
36
|
"commander": "^14.0.3",
|
|
37
37
|
"file-type": "^22.0.1",
|
|
38
38
|
"gpt-tokenizer": "^3.4.0",
|
|
39
39
|
"json5": "^2.2.3",
|
|
40
40
|
"markdansi": "^0.2.1",
|
|
41
41
|
"mime": "^4.1.0",
|
|
42
|
-
"ora": "^9.
|
|
42
|
+
"ora": "^9.4.0",
|
|
43
43
|
"osc-progress": "^0.3.0",
|
|
44
44
|
"tokentally": "^0.1.1",
|
|
45
45
|
"tslog": "^4.10.2",
|
|
46
|
-
"@steipete/summarize-core": "0.
|
|
46
|
+
"@steipete/summarize-core": "0.14.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@fal-ai/client": "^1.
|
|
49
|
+
"@fal-ai/client": "^1.10.0",
|
|
50
50
|
"@types/jsdom": "^28.0.1",
|
|
51
51
|
"@types/node": "^25.6.0",
|
|
52
52
|
"@types/sanitize-html": "^2.16.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"esbuild": "^0.28.0",
|
|
55
55
|
"oxfmt": "0.46.0",
|
|
56
56
|
"oxlint": "^1.61.0",
|
|
57
|
-
"oxlint-tsgolint": "^0.
|
|
57
|
+
"oxlint-tsgolint": "^0.22.0",
|
|
58
58
|
"rimraf": "^6.1.3",
|
|
59
59
|
"tsx": "^4.21.0",
|
|
60
60
|
"typescript": "^6.0.3",
|