@ljoukov/llm 7.0.15 → 7.0.17
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/README.md +13 -6
- package/dist/index.cjs +31 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -10
- package/dist/index.d.ts +31 -10
- package/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -221,7 +221,7 @@ type LlmToolOutputContentItem = {
|
|
|
221
221
|
readonly text: string;
|
|
222
222
|
} | LlmInputImagePart | LlmInputFilePart;
|
|
223
223
|
type LlmImageSize = "1K" | "2K" | "4K";
|
|
224
|
-
type LlmThinkingLevel = "low" | "medium" | "high";
|
|
224
|
+
type LlmThinkingLevel = "low" | "medium" | "high" | "xhigh";
|
|
225
225
|
type LlmWebSearchMode = "cached" | "live";
|
|
226
226
|
type LlmOpenAiShellNetworkPolicy = {
|
|
227
227
|
readonly type: "disabled";
|
|
@@ -435,13 +435,27 @@ type LlmImageData = {
|
|
|
435
435
|
readonly mimeType?: string;
|
|
436
436
|
readonly data: Buffer$1;
|
|
437
437
|
};
|
|
438
|
-
type
|
|
439
|
-
type
|
|
440
|
-
type
|
|
441
|
-
type
|
|
442
|
-
type
|
|
443
|
-
type
|
|
444
|
-
type
|
|
438
|
+
type LlmGptImage2Resolution = OpenAiGptImage2Resolution;
|
|
439
|
+
type LlmGptImage2Quality = OpenAiGptImage2Quality;
|
|
440
|
+
type LlmGptImage2OutputFormat = OpenAiGptImage2OutputFormat;
|
|
441
|
+
type LlmGptImage2Background = OpenAiGptImage2Background;
|
|
442
|
+
type LlmGptImage2Moderation = OpenAiGptImage2Moderation;
|
|
443
|
+
type LlmGptImage2PartialImageCount = OpenAiGptImage2PartialImageCount;
|
|
444
|
+
type LlmGptImage2NumImages = OpenAiGptImage2NumImages;
|
|
445
|
+
type LlmOpenAiImageResolution = LlmGptImage2Resolution;
|
|
446
|
+
type LlmOpenAiImageQuality = LlmGptImage2Quality;
|
|
447
|
+
type LlmOpenAiImageOutputFormat = LlmGptImage2OutputFormat;
|
|
448
|
+
type LlmOpenAiImageBackground = LlmGptImage2Background;
|
|
449
|
+
type LlmOpenAiImageModeration = LlmGptImage2Moderation;
|
|
450
|
+
type LlmOpenAiImagePartialImageCount = LlmGptImage2PartialImageCount;
|
|
451
|
+
type LlmOpenAiImageNumImages = LlmGptImage2NumImages;
|
|
452
|
+
type LlmChatGptImageResolution = LlmGptImage2Resolution;
|
|
453
|
+
type LlmChatGptImageQuality = LlmGptImage2Quality;
|
|
454
|
+
type LlmChatGptImageOutputFormat = LlmGptImage2OutputFormat;
|
|
455
|
+
type LlmChatGptImageBackground = LlmGptImage2Background;
|
|
456
|
+
type LlmChatGptImageModeration = LlmGptImage2Moderation;
|
|
457
|
+
type LlmChatGptImageNumImages = LlmGptImage2NumImages;
|
|
458
|
+
type LlmChatGptImageAction = "auto" | "generate" | "edit";
|
|
445
459
|
type LlmGenerateImagesRequestBase = {
|
|
446
460
|
readonly stylePrompt: string;
|
|
447
461
|
readonly styleImages?: readonly LlmImageData[];
|
|
@@ -462,7 +476,14 @@ type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
|
462
476
|
};
|
|
463
477
|
type LlmChatGptGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
464
478
|
readonly model: ChatGptImageModelId;
|
|
465
|
-
readonly
|
|
479
|
+
readonly imageResolution?: LlmChatGptImageResolution;
|
|
480
|
+
readonly imageQuality?: LlmChatGptImageQuality;
|
|
481
|
+
readonly outputFormat?: LlmChatGptImageOutputFormat;
|
|
482
|
+
readonly outputCompression?: number;
|
|
483
|
+
readonly background?: LlmChatGptImageBackground;
|
|
484
|
+
readonly moderation?: LlmChatGptImageModeration;
|
|
485
|
+
readonly action?: LlmChatGptImageAction;
|
|
486
|
+
readonly numImages?: LlmChatGptImageNumImages;
|
|
466
487
|
};
|
|
467
488
|
type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
468
489
|
readonly model: GeminiImageModelId;
|
|
@@ -1172,4 +1193,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
1172
1193
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
1173
1194
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
1174
1195
|
|
|
1175
|
-
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiContainer, type LlmOpenAiContainerCreateOptions, type LlmOpenAiContainerFile, type LlmOpenAiContainerFileUpload, type LlmOpenAiContainerNetworkPolicy, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiResponseContainerReference, type LlmOpenAiResponseMetadata, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createOpenAiContainer, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, deleteOpenAiContainer, downloadOpenAiContainerFile, downloadOpenAiContainerFileText, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, listOpenAiContainerFiles, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, uploadOpenAiContainerFile, validateOpenAiGptImage2Resolution };
|
|
1196
|
+
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmChatGptImageAction, type LlmChatGptImageBackground, type LlmChatGptImageModeration, type LlmChatGptImageNumImages, type LlmChatGptImageOutputFormat, type LlmChatGptImageQuality, type LlmChatGptImageResolution, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmGptImage2Background, type LlmGptImage2Moderation, type LlmGptImage2NumImages, type LlmGptImage2OutputFormat, type LlmGptImage2PartialImageCount, type LlmGptImage2Quality, type LlmGptImage2Resolution, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiContainer, type LlmOpenAiContainerCreateOptions, type LlmOpenAiContainerFile, type LlmOpenAiContainerFileUpload, type LlmOpenAiContainerNetworkPolicy, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiResponseContainerReference, type LlmOpenAiResponseMetadata, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createOpenAiContainer, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, deleteOpenAiContainer, downloadOpenAiContainerFile, downloadOpenAiContainerFileText, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, listOpenAiContainerFiles, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, uploadOpenAiContainerFile, validateOpenAiGptImage2Resolution };
|
package/dist/index.d.ts
CHANGED
|
@@ -221,7 +221,7 @@ type LlmToolOutputContentItem = {
|
|
|
221
221
|
readonly text: string;
|
|
222
222
|
} | LlmInputImagePart | LlmInputFilePart;
|
|
223
223
|
type LlmImageSize = "1K" | "2K" | "4K";
|
|
224
|
-
type LlmThinkingLevel = "low" | "medium" | "high";
|
|
224
|
+
type LlmThinkingLevel = "low" | "medium" | "high" | "xhigh";
|
|
225
225
|
type LlmWebSearchMode = "cached" | "live";
|
|
226
226
|
type LlmOpenAiShellNetworkPolicy = {
|
|
227
227
|
readonly type: "disabled";
|
|
@@ -435,13 +435,27 @@ type LlmImageData = {
|
|
|
435
435
|
readonly mimeType?: string;
|
|
436
436
|
readonly data: Buffer$1;
|
|
437
437
|
};
|
|
438
|
-
type
|
|
439
|
-
type
|
|
440
|
-
type
|
|
441
|
-
type
|
|
442
|
-
type
|
|
443
|
-
type
|
|
444
|
-
type
|
|
438
|
+
type LlmGptImage2Resolution = OpenAiGptImage2Resolution;
|
|
439
|
+
type LlmGptImage2Quality = OpenAiGptImage2Quality;
|
|
440
|
+
type LlmGptImage2OutputFormat = OpenAiGptImage2OutputFormat;
|
|
441
|
+
type LlmGptImage2Background = OpenAiGptImage2Background;
|
|
442
|
+
type LlmGptImage2Moderation = OpenAiGptImage2Moderation;
|
|
443
|
+
type LlmGptImage2PartialImageCount = OpenAiGptImage2PartialImageCount;
|
|
444
|
+
type LlmGptImage2NumImages = OpenAiGptImage2NumImages;
|
|
445
|
+
type LlmOpenAiImageResolution = LlmGptImage2Resolution;
|
|
446
|
+
type LlmOpenAiImageQuality = LlmGptImage2Quality;
|
|
447
|
+
type LlmOpenAiImageOutputFormat = LlmGptImage2OutputFormat;
|
|
448
|
+
type LlmOpenAiImageBackground = LlmGptImage2Background;
|
|
449
|
+
type LlmOpenAiImageModeration = LlmGptImage2Moderation;
|
|
450
|
+
type LlmOpenAiImagePartialImageCount = LlmGptImage2PartialImageCount;
|
|
451
|
+
type LlmOpenAiImageNumImages = LlmGptImage2NumImages;
|
|
452
|
+
type LlmChatGptImageResolution = LlmGptImage2Resolution;
|
|
453
|
+
type LlmChatGptImageQuality = LlmGptImage2Quality;
|
|
454
|
+
type LlmChatGptImageOutputFormat = LlmGptImage2OutputFormat;
|
|
455
|
+
type LlmChatGptImageBackground = LlmGptImage2Background;
|
|
456
|
+
type LlmChatGptImageModeration = LlmGptImage2Moderation;
|
|
457
|
+
type LlmChatGptImageNumImages = LlmGptImage2NumImages;
|
|
458
|
+
type LlmChatGptImageAction = "auto" | "generate" | "edit";
|
|
445
459
|
type LlmGenerateImagesRequestBase = {
|
|
446
460
|
readonly stylePrompt: string;
|
|
447
461
|
readonly styleImages?: readonly LlmImageData[];
|
|
@@ -462,7 +476,14 @@ type LlmOpenAiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
|
462
476
|
};
|
|
463
477
|
type LlmChatGptGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
464
478
|
readonly model: ChatGptImageModelId;
|
|
465
|
-
readonly
|
|
479
|
+
readonly imageResolution?: LlmChatGptImageResolution;
|
|
480
|
+
readonly imageQuality?: LlmChatGptImageQuality;
|
|
481
|
+
readonly outputFormat?: LlmChatGptImageOutputFormat;
|
|
482
|
+
readonly outputCompression?: number;
|
|
483
|
+
readonly background?: LlmChatGptImageBackground;
|
|
484
|
+
readonly moderation?: LlmChatGptImageModeration;
|
|
485
|
+
readonly action?: LlmChatGptImageAction;
|
|
486
|
+
readonly numImages?: LlmChatGptImageNumImages;
|
|
466
487
|
};
|
|
467
488
|
type LlmGeminiGenerateImagesRequest = LlmGenerateImagesRequestBase & {
|
|
468
489
|
readonly model: GeminiImageModelId;
|
|
@@ -1172,4 +1193,4 @@ declare const FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL: FireworksModelId;
|
|
|
1172
1193
|
declare function isFireworksModelId(value: string): value is FireworksModelId;
|
|
1173
1194
|
declare function resolveFireworksModelId(model: string): string | undefined;
|
|
1174
1195
|
|
|
1175
|
-
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiContainer, type LlmOpenAiContainerCreateOptions, type LlmOpenAiContainerFile, type LlmOpenAiContainerFileUpload, type LlmOpenAiContainerNetworkPolicy, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiResponseContainerReference, type LlmOpenAiResponseMetadata, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createOpenAiContainer, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, deleteOpenAiContainer, downloadOpenAiContainerFile, downloadOpenAiContainerFileText, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, listOpenAiContainerFiles, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, uploadOpenAiContainerFile, validateOpenAiGptImage2Resolution };
|
|
1196
|
+
export { type AgentDirectoryEntry, type AgentFilesystem, type AgentFilesystemToolAccessContext, type AgentFilesystemToolAccessHook, type AgentFilesystemToolAction, type AgentFilesystemToolConfig, type AgentFilesystemToolName, type AgentFilesystemToolProfile, type AgentFilesystemToolSelection, type AgentFilesystemToolsOptions, type AgentLogLineSink, type AgentLoggingConfig, type AgentLoggingSelection, type AgentLoopStream, type AgentPathInfo, type AgentPathKind, type AgentRunCompletedTelemetryEvent, type AgentRunStartedTelemetryEvent, type AgentRunStreamTelemetryEvent, type AgentSubagentToolConfig, type AgentSubagentToolPromptPattern, type AgentSubagentToolSelection, type ApplyPatchAccessContext, type ApplyPatchAccessHook, type ApplyPatchRequest, type ApplyPatchResult, type ApplyPatchToolInput, type AssessmentSubagentInput, CHATGPT_IMAGE_MODEL_IDS, CHATGPT_MODEL_IDS, CODEX_APPLY_PATCH_FREEFORM_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_JSON_TOOL_DESCRIPTION, CODEX_APPLY_PATCH_LARK_GRAMMAR, type CandidateAssessment, type CandidateEvolutionOptions, type CandidateEvolutionResult, type CandidateEvolutionSnapshot, type CandidateEvolutionStats, type CandidateFeedbackEntry, type CandidateIssue, type CandidateProposal, type CandidateRecord, type ChatGptAuthProfile, type ChatGptImageModelId, type ChatGptModelId, type CodexApplyPatchToolInput, type CodexGrepFilesToolInput, type CodexListDirToolInput, type CodexReadFileToolInput, type CodexViewImageToolInput, type CreateApplyPatchToolOptions, DEFAULT_FILE_TTL_SECONDS, DEFAULT_SIGNED_URL_TTL_SECONDS, EXPERIMENTAL_CHATGPT_MODEL_PREFIX, type ExperimentalChatGptModelId, FIREWORKS_DEFAULT_GLM_MODEL, FIREWORKS_DEFAULT_GPT_OSS_120B_MODEL, FIREWORKS_DEFAULT_KIMI_MODEL, FIREWORKS_DEFAULT_MINIMAX_MODEL, FIREWORKS_MODEL_IDS, type FeedbackScope, type FireworksModelId, GEMINI_IMAGE_MODEL_IDS, GEMINI_MODEL_IDS, GEMINI_TEXT_MODEL_IDS, type GeminiGlobToolInput, type GeminiGrepSearchToolInput, type GeminiImageModelId, type GeminiListDirectoryToolInput, type GeminiModelId, type GeminiReadFileToolInput, type GeminiReplaceToolInput, type GeminiRgSearchToolInput, type GeminiTextModelId, type GeminiWriteFileToolInput, type GenerationSubagent, type GenerationSubagentInput, InMemoryAgentFilesystem, type JsonSchema, LLM_IMAGE_MODEL_IDS, LLM_MODEL_IDS, LLM_TEXT_MODEL_IDS, type ListedChatGptModelId, type LlmBaseRequest, type LlmBlockedEvent, type LlmCallCompletedTelemetryEvent, type LlmCallStartedTelemetryEvent, type LlmCallStreamTelemetryEvent, type LlmChatGptGenerateImagesRequest, type LlmChatGptImageAction, type LlmChatGptImageBackground, type LlmChatGptImageModeration, type LlmChatGptImageNumImages, type LlmChatGptImageOutputFormat, type LlmChatGptImageQuality, type LlmChatGptImageResolution, type LlmContent, type LlmContentPart, type LlmCustomTool, type LlmCustomToolInputFormat, type LlmExecutableTool, type LlmFileCreateParams, type LlmFileDeleted, type LlmFileUploadBackend, type LlmFileUploadEvent, type LlmFileUploadMetrics, type LlmFileUploadMode, type LlmFileUploadSource, type LlmFunctionTool, type LlmGeminiGenerateImagesRequest, type LlmGenerateImagesRequest, type LlmGptImage2Background, type LlmGptImage2Moderation, type LlmGptImage2NumImages, type LlmGptImage2OutputFormat, type LlmGptImage2PartialImageCount, type LlmGptImage2Quality, type LlmGptImage2Resolution, type LlmImageData, type LlmImageModelId, type LlmImageSize, type LlmInput, type LlmInputFilePart, type LlmInputImagePart, type LlmInputMessage, LlmJsonCallError, type LlmJsonRequest, type LlmJsonStream, type LlmJsonStreamEvent, type LlmJsonStreamRequest, type LlmMediaResolution, type LlmModelEvent, type LlmModelId, type LlmOpenAiContainer, type LlmOpenAiContainerCreateOptions, type LlmOpenAiContainerFile, type LlmOpenAiContainerFileUpload, type LlmOpenAiContainerNetworkPolicy, type LlmOpenAiGenerateImagesRequest, type LlmOpenAiImageBackground, type LlmOpenAiImageModeration, type LlmOpenAiImageNumImages, type LlmOpenAiImageOutputFormat, type LlmOpenAiImagePartialImageCount, type LlmOpenAiImageQuality, type LlmOpenAiImageResolution, type LlmOpenAiResponseContainerReference, type LlmOpenAiResponseMetadata, type LlmOpenAiShellEnvironment, type LlmOpenAiShellNetworkPolicy, type LlmProvider, type LlmStoredFile, type LlmStreamEvent, type LlmTelemetryOperation, type LlmTextDeltaEvent, type LlmTextModelId, type LlmTextRequest, type LlmTextResult, type LlmTextStream, type LlmThinkingLevel, type LlmToolCallCompletedEvent, type LlmToolCallContext, type LlmToolCallResult, type LlmToolCallStartedEvent, type LlmToolCallStreamEvent, type LlmToolConfig, type LlmToolLoopRequest, type LlmToolLoopResult, type LlmToolLoopSteeringAppendResult, type LlmToolLoopSteeringChannel, type LlmToolLoopSteeringInput, type LlmToolLoopSteeringMessage, type LlmToolLoopStep, type LlmToolLoopStream, type LlmToolSet, type LlmUsageEvent, type LlmUsageTokens, type LlmWebSearchMode, type ModelConcurrencyConfig, type ModelConcurrencyProvider, OPENAI_GPT_IMAGE_2_AUTO_RESOLUTION, OPENAI_GPT_IMAGE_2_BACKGROUNDS, OPENAI_GPT_IMAGE_2_MODERATION_LEVELS, OPENAI_GPT_IMAGE_2_NUM_IMAGES, OPENAI_GPT_IMAGE_2_OUTPUT_FORMATS, OPENAI_GPT_IMAGE_2_PARTIAL_IMAGE_COUNTS, OPENAI_GPT_IMAGE_2_POPULAR_RESOLUTIONS, OPENAI_GPT_IMAGE_2_QUALITY_LEVELS, OPENAI_GPT_IMAGE_2_RESOLUTIONS, OPENAI_GPT_IMAGE_2_SIZE_CONSTRAINTS, OPENAI_IMAGE_MODEL_IDS, OPENAI_MODEL_IDS, type OpenAiGptImage2Background, type OpenAiGptImage2CustomResolution, type OpenAiGptImage2ListedResolution, type OpenAiGptImage2Moderation, type OpenAiGptImage2NumImages, type OpenAiGptImage2OutputFormat, type OpenAiGptImage2PartialImageCount, type OpenAiGptImage2PopularResolution, type OpenAiGptImage2Quality, type OpenAiGptImage2Resolution, type OpenAiGptImage2ResolutionValidationResult, type OpenAiImageModelId, type OpenAiModelId, type ParentSelectionConfig, type ParentSelectionMidpoint, type PostCheckRejection, type PostGenerationCheckInput, type RunAgentLoopRequest, type TelemetryConfig, type TelemetryEvent, type TelemetrySelection, type TelemetrySink, appendMarkdownSourcesSection, applyPatch, configureGemini, configureModelConcurrency, configureTelemetry, convertGooglePartsToLlmParts, createApplyPatchTool, createCodexApplyPatchTool, createCodexFilesystemToolSet, createCodexReadFileTool, createFilesystemToolSetForModel, createGeminiFilesystemToolSet, createGeminiReadFileTool, createGlobTool, createGrepFilesTool, createGrepSearchTool, createInMemoryAgentFilesystem, createListDirTool, createListDirectoryTool, createModelAgnosticFilesystemToolSet, createNodeAgentFilesystem, createOpenAiContainer, createReplaceTool, createRgSearchTool, createToolLoopSteeringChannel, createViewImageTool, createWriteFileTool, customTool, deleteOpenAiContainer, downloadOpenAiContainerFile, downloadOpenAiContainerFileText, emptyFileUploadMetrics, encodeChatGptAuthJson, encodeChatGptAuthJsonB64, estimateCallCostUsd, exchangeChatGptOauthCode, files, generateImageInBatches, generateImages, generateJson, generateText, getChatGptAuthProfile, getCurrentToolCallContext, isChatGptImageModelId, isChatGptModelId, isExperimentalChatGptModelId, isFireworksModelId, isGeminiImageModelId, isGeminiModelId, isGeminiTextModelId, isLlmImageModelId, isLlmModelId, isLlmTextModelId, isOpenAiImageModelId, isOpenAiModelId, listOpenAiContainerFiles, loadEnvFromFile, loadLocalEnv, parseJsonFromLlmText, refreshChatGptOauthToken, resetModelConcurrencyConfig, resetTelemetry, resolveChatGptImageProviderModel, resolveFilesystemToolProfile, resolveFireworksModelId, runAgentLoop, runCandidateEvolution, runToolLoop, sanitisePartForLogging, streamAgentLoop, streamJson, streamText, streamToolLoop, stripCodexCitationMarkers, toGeminiJsonSchema, tool, uploadOpenAiContainerFile, validateOpenAiGptImage2Resolution };
|
package/dist/index.js
CHANGED
|
@@ -5197,6 +5197,8 @@ function resolveOpenAiReasoningEffort(modelId, thinkingLevel) {
|
|
|
5197
5197
|
case "medium":
|
|
5198
5198
|
return "medium";
|
|
5199
5199
|
case "high":
|
|
5200
|
+
return "high";
|
|
5201
|
+
case "xhigh":
|
|
5200
5202
|
return "xhigh";
|
|
5201
5203
|
}
|
|
5202
5204
|
}
|
|
@@ -5214,7 +5216,7 @@ function toOpenAiReasoningEffort(effort) {
|
|
|
5214
5216
|
case "high":
|
|
5215
5217
|
return "high";
|
|
5216
5218
|
case "xhigh":
|
|
5217
|
-
return "
|
|
5219
|
+
return "xhigh";
|
|
5218
5220
|
}
|
|
5219
5221
|
}
|
|
5220
5222
|
function resolveOpenAiVerbosity(modelId) {
|
|
@@ -7507,6 +7509,7 @@ function toGeminiThinkingLevel(thinkingLevel) {
|
|
|
7507
7509
|
case "medium":
|
|
7508
7510
|
return ThinkingLevel.MEDIUM;
|
|
7509
7511
|
case "high":
|
|
7512
|
+
case "xhigh":
|
|
7510
7513
|
return ThinkingLevel.HIGH;
|
|
7511
7514
|
}
|
|
7512
7515
|
}
|
|
@@ -7549,6 +7552,7 @@ function resolveGeminiThinkingBudget(modelId, thinkingLevel) {
|
|
|
7549
7552
|
case "medium":
|
|
7550
7553
|
return 4096;
|
|
7551
7554
|
case "high":
|
|
7555
|
+
case "xhigh":
|
|
7552
7556
|
return 32768;
|
|
7553
7557
|
}
|
|
7554
7558
|
}
|
|
@@ -7559,6 +7563,7 @@ function resolveGeminiThinkingBudget(modelId, thinkingLevel) {
|
|
|
7559
7563
|
case "medium":
|
|
7560
7564
|
return 8192;
|
|
7561
7565
|
case "high":
|
|
7566
|
+
case "xhigh":
|
|
7562
7567
|
return 24576;
|
|
7563
7568
|
}
|
|
7564
7569
|
}
|
|
@@ -7569,6 +7574,7 @@ function resolveGeminiThinkingBudget(modelId, thinkingLevel) {
|
|
|
7569
7574
|
case "medium":
|
|
7570
7575
|
return 8192;
|
|
7571
7576
|
case "high":
|
|
7577
|
+
case "xhigh":
|
|
7572
7578
|
return 16384;
|
|
7573
7579
|
}
|
|
7574
7580
|
}
|
|
@@ -10441,7 +10447,7 @@ function buildOpenAiImagePrompt(params) {
|
|
|
10441
10447
|
params.imagePrompt.trim()
|
|
10442
10448
|
].filter((line) => line.length > 0).join("\n");
|
|
10443
10449
|
}
|
|
10444
|
-
function
|
|
10450
|
+
function resolveGptImage2RequestParams(request) {
|
|
10445
10451
|
if (request.partialImages !== void 0) {
|
|
10446
10452
|
throw new Error("partialImages is only supported for streaming image generation.");
|
|
10447
10453
|
}
|
|
@@ -10455,7 +10461,7 @@ function resolveOpenAiImageRequestParams(request) {
|
|
|
10455
10461
|
const sizeValidation = validateOpenAiGptImage2Resolution(size);
|
|
10456
10462
|
if (!sizeValidation.valid) {
|
|
10457
10463
|
throw new Error(
|
|
10458
|
-
`imageResolution ${JSON.stringify(size)} is not supported by
|
|
10464
|
+
`imageResolution ${JSON.stringify(size)} is not supported by ${request.model}: ${sizeValidation.reason}`
|
|
10459
10465
|
);
|
|
10460
10466
|
}
|
|
10461
10467
|
return {
|
|
@@ -10498,7 +10504,7 @@ async function generateImagesWithOpenAiImageApi(request) {
|
|
|
10498
10504
|
model: request.model
|
|
10499
10505
|
});
|
|
10500
10506
|
const startedAtMs = Date.now();
|
|
10501
|
-
const params =
|
|
10507
|
+
const params = resolveGptImage2RequestParams(request);
|
|
10502
10508
|
const styleImages = await createOpenAiStyleImageFiles(request.styleImages);
|
|
10503
10509
|
const hasStyleImages = Boolean(styleImages && styleImages.length > 0);
|
|
10504
10510
|
const outputMimeType = resolveOpenAiImageMimeType(params.outputFormat);
|
|
@@ -10626,7 +10632,8 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10626
10632
|
model: request.model
|
|
10627
10633
|
});
|
|
10628
10634
|
const startedAtMs = Date.now();
|
|
10629
|
-
const
|
|
10635
|
+
const params = resolveGptImage2RequestParams(request);
|
|
10636
|
+
const outputMimeType = resolveOpenAiImageMimeType(params.outputFormat);
|
|
10630
10637
|
let totalUsage;
|
|
10631
10638
|
let costUsd = 0;
|
|
10632
10639
|
let outputImages = 0;
|
|
@@ -10634,7 +10641,7 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10634
10641
|
type: "llm.call.started",
|
|
10635
10642
|
imagePromptCount: promptEntries.length,
|
|
10636
10643
|
styleImageCount: request.styleImages?.length ?? 0,
|
|
10637
|
-
numImagesPerPrompt
|
|
10644
|
+
numImagesPerPrompt: params.n
|
|
10638
10645
|
});
|
|
10639
10646
|
try {
|
|
10640
10647
|
const images = [];
|
|
@@ -10644,7 +10651,7 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10644
10651
|
imagePrompt,
|
|
10645
10652
|
hasStyleImages: Boolean(request.styleImages && request.styleImages.length > 0)
|
|
10646
10653
|
});
|
|
10647
|
-
for (let imageIndex = 0; imageIndex <
|
|
10654
|
+
for (let imageIndex = 0; imageIndex < params.n; imageIndex += 1) {
|
|
10648
10655
|
const chatGptInput = toChatGptInput(
|
|
10649
10656
|
buildChatGptImageInputContent({
|
|
10650
10657
|
prompt,
|
|
@@ -10661,11 +10668,22 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10661
10668
|
model: providerInfo.model,
|
|
10662
10669
|
store: false,
|
|
10663
10670
|
stream: true,
|
|
10664
|
-
instructions: chatGptInput.instructions ?? "Use the image_generation tool to generate exactly one
|
|
10671
|
+
instructions: chatGptInput.instructions ?? "Use the image_generation tool to generate exactly one image. Do not return prose instead of the image.",
|
|
10665
10672
|
input: preparedInput,
|
|
10666
10673
|
tool_choice: "required",
|
|
10667
10674
|
parallel_tool_calls: false,
|
|
10668
|
-
tools: [
|
|
10675
|
+
tools: [
|
|
10676
|
+
{
|
|
10677
|
+
type: "image_generation",
|
|
10678
|
+
size: params.size,
|
|
10679
|
+
quality: params.quality,
|
|
10680
|
+
output_format: params.outputFormat ?? "png",
|
|
10681
|
+
...request.outputCompression !== void 0 ? { output_compression: request.outputCompression } : {},
|
|
10682
|
+
...params.background ? { background: params.background } : {},
|
|
10683
|
+
...params.moderation ? { moderation: params.moderation } : {},
|
|
10684
|
+
...request.action ? { action: request.action } : {}
|
|
10685
|
+
}
|
|
10686
|
+
]
|
|
10669
10687
|
},
|
|
10670
10688
|
signal: request.signal
|
|
10671
10689
|
});
|
|
@@ -10677,7 +10695,7 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10677
10695
|
}
|
|
10678
10696
|
for (const call of result.imageGenerationCalls) {
|
|
10679
10697
|
images.push({
|
|
10680
|
-
mimeType:
|
|
10698
|
+
mimeType: outputMimeType,
|
|
10681
10699
|
data: Buffer5.from(call.result, "base64")
|
|
10682
10700
|
});
|
|
10683
10701
|
}
|
|
@@ -10688,8 +10706,8 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10688
10706
|
modelId: request.model,
|
|
10689
10707
|
tokens: usage,
|
|
10690
10708
|
responseImages: result.imageGenerationCalls.length,
|
|
10691
|
-
imageSize:
|
|
10692
|
-
imageQuality:
|
|
10709
|
+
imageSize: params.size,
|
|
10710
|
+
imageQuality: params.quality
|
|
10693
10711
|
});
|
|
10694
10712
|
}
|
|
10695
10713
|
}
|
|
@@ -10701,7 +10719,7 @@ async function generateImagesWithChatGptImageTool(request) {
|
|
|
10701
10719
|
usage: totalUsage,
|
|
10702
10720
|
costUsd,
|
|
10703
10721
|
imageCount: images.length,
|
|
10704
|
-
attempts: promptEntries.length *
|
|
10722
|
+
attempts: promptEntries.length * params.n
|
|
10705
10723
|
});
|
|
10706
10724
|
return images;
|
|
10707
10725
|
} catch (error) {
|