@midscene/core 1.2.2-beta-20260116114131.0 → 1.2.2-beta-20260119111553.0
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/es/agent/agent.mjs +4 -4
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +3 -4
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/auto-glm/index.mjs +2 -2
- package/dist/es/ai-model/auto-glm/planning.mjs +1 -1
- package/dist/es/ai-model/auto-glm/planning.mjs.map +1 -1
- package/dist/es/ai-model/auto-glm/prompt.mjs +8 -8
- package/dist/es/ai-model/auto-glm/prompt.mjs.map +1 -1
- package/dist/es/ai-model/auto-glm/util.mjs +6 -3
- package/dist/es/ai-model/auto-glm/util.mjs.map +1 -1
- package/dist/es/ai-model/index.mjs +2 -2
- package/dist/es/ai-model/inspect.mjs +12 -12
- package/dist/es/ai-model/inspect.mjs.map +1 -1
- package/dist/es/ai-model/llm-planning.mjs +4 -4
- package/dist/es/ai-model/llm-planning.mjs.map +1 -1
- package/dist/es/ai-model/prompt/common.mjs +2 -2
- package/dist/es/ai-model/prompt/common.mjs.map +1 -1
- package/dist/es/ai-model/prompt/extraction.mjs +3 -1
- package/dist/es/ai-model/prompt/extraction.mjs.map +1 -1
- package/dist/es/ai-model/prompt/llm-locator.mjs +5 -3
- package/dist/es/ai-model/prompt/llm-locator.mjs.map +1 -1
- package/dist/es/ai-model/prompt/llm-planning.mjs +15 -13
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -1
- package/dist/es/ai-model/prompt/llm-section-locator.mjs +5 -3
- package/dist/es/ai-model/prompt/llm-section-locator.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +12 -13
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/ai-model/ui-tars-planning.mjs +2 -24
- package/dist/es/ai-model/ui-tars-planning.mjs.map +1 -1
- package/dist/es/common.mjs +10 -9
- package/dist/es/common.mjs.map +1 -1
- package/dist/es/device/index.mjs +3 -3
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/service/index.mjs +6 -6
- package/dist/es/service/index.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +3 -3
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/tasks.js +2 -3
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/auto-glm/index.js +3 -0
- package/dist/lib/ai-model/auto-glm/planning.js +1 -1
- package/dist/lib/ai-model/auto-glm/planning.js.map +1 -1
- package/dist/lib/ai-model/auto-glm/prompt.js +8 -8
- package/dist/lib/ai-model/auto-glm/prompt.js.map +1 -1
- package/dist/lib/ai-model/auto-glm/util.js +10 -4
- package/dist/lib/ai-model/auto-glm/util.js.map +1 -1
- package/dist/lib/ai-model/index.js +0 -3
- package/dist/lib/ai-model/inspect.js +12 -12
- package/dist/lib/ai-model/inspect.js.map +1 -1
- package/dist/lib/ai-model/llm-planning.js +4 -4
- package/dist/lib/ai-model/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/common.js +2 -2
- package/dist/lib/ai-model/prompt/common.js.map +1 -1
- package/dist/lib/ai-model/prompt/extraction.js +5 -3
- package/dist/lib/ai-model/prompt/extraction.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-locator.js +5 -3
- package/dist/lib/ai-model/prompt/llm-locator.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-planning.js +15 -13
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-section-locator.js +5 -3
- package/dist/lib/ai-model/prompt/llm-section-locator.js.map +1 -1
- package/dist/lib/ai-model/service-caller/index.js +11 -12
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/ai-model/ui-tars-planning.js +1 -26
- package/dist/lib/ai-model/ui-tars-planning.js.map +1 -1
- package/dist/lib/common.js +10 -9
- package/dist/lib/common.js.map +1 -1
- package/dist/lib/device/index.js +3 -3
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/service/index.js +6 -6
- package/dist/lib/service/index.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/agent.d.ts +2 -2
- package/dist/types/ai-model/auto-glm/index.d.ts +1 -1
- package/dist/types/ai-model/auto-glm/prompt.d.ts +3 -3
- package/dist/types/ai-model/auto-glm/util.d.ts +11 -5
- package/dist/types/ai-model/index.d.ts +1 -1
- package/dist/types/ai-model/prompt/common.d.ts +2 -2
- package/dist/types/ai-model/prompt/llm-locator.d.ts +2 -2
- package/dist/types/ai-model/prompt/llm-planning.d.ts +3 -3
- package/dist/types/ai-model/prompt/llm-section-locator.d.ts +2 -2
- package/dist/types/ai-model/service-caller/index.d.ts +2 -2
- package/dist/types/ai-model/ui-tars-planning.d.ts +2 -3
- package/dist/types/common.d.ts +5 -5
- package/dist/types/device/index.d.ts +4 -4
- package/package.json +2 -2
- package/dist/es/ai-model/prompt/assertion.mjs +0 -31
- package/dist/es/ai-model/prompt/assertion.mjs.map +0 -1
- package/dist/lib/ai-model/prompt/assertion.js +0 -65
- package/dist/lib/ai-model/prompt/assertion.js.map +0 -1
- package/dist/types/ai-model/prompt/assertion.d.ts +0 -2
|
@@ -86,7 +86,7 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
86
86
|
} & {
|
|
87
87
|
autoDismissKeyboard?: boolean;
|
|
88
88
|
} & {
|
|
89
|
-
mode?: 'replace' | 'clear' | 'append';
|
|
89
|
+
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
90
90
|
}): Promise<any>;
|
|
91
91
|
/**
|
|
92
92
|
* @deprecated Use aiInput(locatePrompt, opt) instead where opt contains the value
|
|
@@ -94,7 +94,7 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
94
94
|
aiInput(value: string | number, locatePrompt: TUserPrompt, opt?: LocateOption & {
|
|
95
95
|
autoDismissKeyboard?: boolean;
|
|
96
96
|
} & {
|
|
97
|
-
mode?: 'replace' | 'clear' | 'append';
|
|
97
|
+
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
98
98
|
}): Promise<any>;
|
|
99
99
|
aiKeyboardPress(locatePrompt: TUserPrompt, opt: LocateOption & {
|
|
100
100
|
keyName: string;
|
|
@@ -2,5 +2,5 @@ export { getAutoGLMLocatePrompt, getAutoGLMPlanPrompt } from './prompt';
|
|
|
2
2
|
export { parseAutoGLMLocateResponse, parseAutoGLMResponse, parseAction, } from './parser';
|
|
3
3
|
export { autoGLMPlanning } from './planning';
|
|
4
4
|
export { transformAutoGLMAction } from './actions';
|
|
5
|
-
export { isAutoGLM } from './util';
|
|
5
|
+
export { isAutoGLM, isUITars } from './util';
|
|
6
6
|
export type { ParsedAction } from './actions';
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
* Modifications:
|
|
23
23
|
* - Adapted prompts for Midscene.js integration
|
|
24
24
|
*/
|
|
25
|
-
import type {
|
|
26
|
-
export declare const getAutoGLMPlanPrompt: (
|
|
27
|
-
export declare const getAutoGLMLocatePrompt: (
|
|
25
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
26
|
+
export declare const getAutoGLMPlanPrompt: (modelFamily: TModelFamily | undefined) => string;
|
|
27
|
+
export declare const getAutoGLMLocatePrompt: (modelFamily: TModelFamily | undefined) => string;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
2
2
|
/**
|
|
3
|
-
* Check if the
|
|
4
|
-
* @param
|
|
5
|
-
* @returns true if
|
|
3
|
+
* Check if the modelFamily is auto-glm or auto-glm-multilingual
|
|
4
|
+
* @param modelFamily The model family to check
|
|
5
|
+
* @returns true if modelFamily is auto-glm or auto-glm-multilingual
|
|
6
6
|
*/
|
|
7
|
-
export declare function isAutoGLM(
|
|
7
|
+
export declare function isAutoGLM(modelFamily: TModelFamily | undefined): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Check if the modelFamily is a UI-TARS variant
|
|
10
|
+
* @param modelFamily The model family to check
|
|
11
|
+
* @returns true if modelFamily is any UI-TARS variant
|
|
12
|
+
*/
|
|
13
|
+
export declare function isUITars(modelFamily: TModelFamily | undefined): boolean;
|
|
@@ -8,7 +8,7 @@ export { AiLocateElement, AiExtractElementInfo, AiLocateSection, AiJudgeOrderSen
|
|
|
8
8
|
export { plan } from './llm-planning';
|
|
9
9
|
export { autoGLMPlanning } from './auto-glm/planning';
|
|
10
10
|
export { adaptBboxToRect } from '../common';
|
|
11
|
-
export { uiTarsPlanning
|
|
11
|
+
export { uiTarsPlanning } from './ui-tars-planning';
|
|
12
12
|
export { ConversationHistory, type ConversationHistoryOptions, } from './conversation-history';
|
|
13
13
|
export type { AIArgs } from '../common';
|
|
14
14
|
export { getMidsceneLocationSchema, type MidsceneLocationResultType, PointSchema, SizeSchema, RectSchema, TMultimodalPromptSchema, TUserPromptSchema, type TMultimodalPrompt, type TUserPrompt, findAllMidsceneLocatorField, dumpActionParam, parseActionParam, } from '../common';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function bboxDescription(
|
|
1
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
2
|
+
export declare function bboxDescription(modelFamily: TModelFamily | undefined): "box_2d bounding box for the target element, should be [ymin, xmin, ymax, xmax] normalized to 0-1000." | "2d bounding box as [xmin, ymin, xmax, ymax]";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function systemPromptToLocateElement(
|
|
1
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
2
|
+
export declare function systemPromptToLocateElement(modelFamily: TModelFamily | undefined): string;
|
|
3
3
|
export declare const findElementPrompt: (targetElementDescription: string) => string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DeviceAction } from '../../types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
3
3
|
export declare const descriptionForAction: (action: DeviceAction<any>, locatorSchemaTypeDescription: string) => string;
|
|
4
|
-
export declare function systemPromptToTaskPlanning({ actionSpace,
|
|
4
|
+
export declare function systemPromptToTaskPlanning({ actionSpace, modelFamily, includeBbox, includeThought, }: {
|
|
5
5
|
actionSpace: DeviceAction<any>[];
|
|
6
|
-
|
|
6
|
+
modelFamily: TModelFamily | undefined;
|
|
7
7
|
includeBbox: boolean;
|
|
8
8
|
includeThought?: boolean;
|
|
9
9
|
}): Promise<string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function systemPromptToLocateSection(
|
|
1
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
2
|
+
export declare function systemPromptToLocateSection(modelFamily: TModelFamily | undefined): string;
|
|
3
3
|
export declare const sectionLocatorInstruction: (sectionDescription: string) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AIUsageInfo, DeepThinkOption } from '../../types';
|
|
2
2
|
import type { StreamingCallback } from '../../types';
|
|
3
|
-
import { type IModelConfig, type TModelFamily
|
|
3
|
+
import { type IModelConfig, type TModelFamily } from '@midscene/shared/env';
|
|
4
4
|
import type { ChatCompletionMessageParam } from 'openai/resources/index';
|
|
5
5
|
import type { AIArgs } from '../../common';
|
|
6
6
|
export declare function callAI(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
|
|
@@ -35,4 +35,4 @@ export declare function resolveDeepThinkConfig({ deepThink, modelFamily, }: {
|
|
|
35
35
|
debugMessage?: string;
|
|
36
36
|
warningMessage?: string;
|
|
37
37
|
};
|
|
38
|
-
export declare function safeParseJson(input: string,
|
|
38
|
+
export declare function safeParseJson(input: string, modelFamily: TModelFamily | undefined): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PlanningAIResponse,
|
|
2
|
-
import { type IModelConfig
|
|
1
|
+
import type { PlanningAIResponse, UIContext } from '../types';
|
|
2
|
+
import { type IModelConfig } from '@midscene/shared/env';
|
|
3
3
|
import type { ConversationHistory } from './conversation-history';
|
|
4
4
|
type ActionType = 'click' | 'left_double' | 'right_single' | 'drag' | 'type' | 'hotkey' | 'finished' | 'scroll' | 'wait';
|
|
5
5
|
export declare function uiTarsPlanning(userInstruction: string, options: {
|
|
@@ -68,5 +68,4 @@ interface FinishedAction extends BaseAction {
|
|
|
68
68
|
action_inputs: Record<string, never>;
|
|
69
69
|
}
|
|
70
70
|
export type Action = ClickAction | LeftDoubleAction | RightSingleAction | DragAction | TypeAction | HotkeyAction | ScrollAction | FinishedAction | WaitAction;
|
|
71
|
-
export declare function resizeImageForUiTars(imageBase64: string, size: Size, uiTarsVersion: UITarsModelVersion | undefined): Promise<string>;
|
|
72
71
|
export {};
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseElement, DeviceAction, ElementTreeNode, MidsceneYamlFlowItem, PlanningAction, Rect, Size } from './types';
|
|
2
2
|
import type { ChatCompletionMessageParam } from 'openai/resources/index';
|
|
3
3
|
import type { PlanningLocateParam } from './types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { TModelFamily } from '@midscene/shared/env';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export type AIArgs = ChatCompletionMessageParam[];
|
|
7
7
|
type AdaptBboxInput = number[] | string[] | string | (number[] | string[])[];
|
|
@@ -15,20 +15,20 @@ type AdaptBboxInput = number[] | string[] | string | (number[] | string[])[];
|
|
|
15
15
|
* @returns [x1, y1, x2, y2] bbox in [0, 1000] coordinate space
|
|
16
16
|
*/
|
|
17
17
|
export declare function pointToBbox(x: number, y: number, bboxSize?: number): [number, number, number, number];
|
|
18
|
-
export declare function fillBboxParam(locate: PlanningLocateParam, width: number, height: number, rightLimit: number, bottomLimit: number,
|
|
18
|
+
export declare function fillBboxParam(locate: PlanningLocateParam, width: number, height: number, rightLimit: number, bottomLimit: number, modelFamily: TModelFamily | undefined): PlanningLocateParam;
|
|
19
19
|
export declare function adaptQwen2_5Bbox(bbox: number[]): [number, number, number, number];
|
|
20
20
|
export declare function adaptDoubaoBbox(bbox: string[] | number[] | string, width: number, height: number): [number, number, number, number];
|
|
21
|
-
export declare function adaptBbox(bbox: AdaptBboxInput, width: number, height: number, rightLimit: number, bottomLimit: number,
|
|
21
|
+
export declare function adaptBbox(bbox: AdaptBboxInput, width: number, height: number, rightLimit: number, bottomLimit: number, modelFamily: TModelFamily | undefined): [number, number, number, number];
|
|
22
22
|
export declare function normalized01000(bbox: number[], width: number, height: number): [number, number, number, number];
|
|
23
23
|
export declare function adaptGeminiBbox(bbox: number[], width: number, height: number): [number, number, number, number];
|
|
24
|
-
export declare function adaptBboxToRect(bbox: number[], width: number, height: number, offsetX?: number, offsetY?: number, rightLimit?: number, bottomLimit?: number,
|
|
24
|
+
export declare function adaptBboxToRect(bbox: number[], width: number, height: number, offsetX?: number, offsetY?: number, rightLimit?: number, bottomLimit?: number, modelFamily?: TModelFamily | undefined): Rect;
|
|
25
25
|
export declare function mergeRects(rects: Rect[]): {
|
|
26
26
|
left: number;
|
|
27
27
|
top: number;
|
|
28
28
|
width: number;
|
|
29
29
|
height: number;
|
|
30
30
|
};
|
|
31
|
-
export declare function expandSearchArea(rect: Rect, screenSize: Size,
|
|
31
|
+
export declare function expandSearchArea(rect: Rect, screenSize: Size, modelFamily: TModelFamily | undefined): Rect;
|
|
32
32
|
export declare function markupImageForLLM(screenshotBase64: string, tree: ElementTreeNode<BaseElement>, size: Size): Promise<string>;
|
|
33
33
|
export declare function buildYamlFlowFromPlans(plans: PlanningAction[], actionSpace: DeviceAction<any>[]): MidsceneYamlFlowItem[];
|
|
34
34
|
export declare const PointSchema: z.ZodObject<{
|
|
@@ -728,7 +728,7 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
728
728
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
729
729
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
730
730
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
731
|
-
mode: z.ZodOptional<z.ZodDefault<z.ZodEnum<["replace", "clear", "
|
|
731
|
+
mode: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodEnum<["replace", "clear", "typeOnly"]>>>, "replace" | "clear" | "typeOnly" | undefined, unknown>;
|
|
732
732
|
}, "strip", z.ZodTypeAny, {
|
|
733
733
|
value: string;
|
|
734
734
|
locate?: z.objectOutputType<{
|
|
@@ -767,7 +767,7 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
767
767
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
768
768
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
769
769
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
770
|
-
mode?: "replace" | "clear" | "
|
|
770
|
+
mode?: "replace" | "clear" | "typeOnly" | undefined;
|
|
771
771
|
}, {
|
|
772
772
|
value: string | number;
|
|
773
773
|
locate?: z.objectInputType<{
|
|
@@ -806,12 +806,12 @@ export declare const actionInputParamSchema: z.ZodObject<{
|
|
|
806
806
|
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
807
807
|
xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
808
808
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
809
|
-
mode?:
|
|
809
|
+
mode?: unknown;
|
|
810
810
|
}>;
|
|
811
811
|
export type ActionInputParam = {
|
|
812
812
|
value: string;
|
|
813
813
|
locate?: LocateResultElement;
|
|
814
|
-
mode?: 'replace' | 'clear' | 'append';
|
|
814
|
+
mode?: 'replace' | 'clear' | 'typeOnly' | 'append';
|
|
815
815
|
};
|
|
816
816
|
export declare const defineActionInput: (call: (param: ActionInputParam) => Promise<void>) => DeviceAction<ActionInputParam>;
|
|
817
817
|
export declare const actionKeyboardPressParamSchema: z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/core",
|
|
3
3
|
"description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "1.2.2-beta-
|
|
4
|
+
"version": "1.2.2-beta-20260119111553.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"semver": "7.5.2",
|
|
90
90
|
"undici": "^6.0.0",
|
|
91
91
|
"zod": "3.24.3",
|
|
92
|
-
"@midscene/shared": "1.2.2-beta-
|
|
92
|
+
"@midscene/shared": "1.2.2-beta-20260119111553.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@rslib/core": "^0.18.3",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const assertSchema = {
|
|
2
|
-
type: 'json_schema',
|
|
3
|
-
json_schema: {
|
|
4
|
-
name: 'assert',
|
|
5
|
-
strict: true,
|
|
6
|
-
schema: {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
pass: {
|
|
10
|
-
type: 'boolean',
|
|
11
|
-
description: 'Whether the assertion passed or failed'
|
|
12
|
-
},
|
|
13
|
-
thought: {
|
|
14
|
-
type: [
|
|
15
|
-
'string',
|
|
16
|
-
'null'
|
|
17
|
-
],
|
|
18
|
-
description: 'The thought process behind the assertion'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
required: [
|
|
22
|
-
'pass',
|
|
23
|
-
'thought'
|
|
24
|
-
],
|
|
25
|
-
additionalProperties: false
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export { assertSchema };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=assertion.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-model/prompt/assertion.mjs","sources":["../../../../src/ai-model/prompt/assertion.ts"],"sourcesContent":["import type { ResponseFormatJSONSchema } from 'openai/resources/index';\n\nexport const assertSchema: ResponseFormatJSONSchema = {\n type: 'json_schema',\n json_schema: {\n name: 'assert',\n strict: true,\n schema: {\n type: 'object',\n properties: {\n pass: {\n type: 'boolean',\n description: 'Whether the assertion passed or failed',\n },\n thought: {\n type: ['string', 'null'],\n description: 'The thought process behind the assertion',\n },\n },\n required: ['pass', 'thought'],\n additionalProperties: false,\n },\n },\n};\n"],"names":["assertSchema"],"mappings":"AAEO,MAAMA,eAAyC;IACpD,MAAM;IACN,aAAa;QACX,MAAM;QACN,QAAQ;QACR,QAAQ;YACN,MAAM;YACN,YAAY;gBACV,MAAM;oBACJ,MAAM;oBACN,aAAa;gBACf;gBACA,SAAS;oBACP,MAAM;wBAAC;wBAAU;qBAAO;oBACxB,aAAa;gBACf;YACF;YACA,UAAU;gBAAC;gBAAQ;aAAU;YAC7B,sBAAsB;QACxB;IACF;AACF"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
assertSchema: ()=>assertSchema
|
|
28
|
-
});
|
|
29
|
-
const assertSchema = {
|
|
30
|
-
type: 'json_schema',
|
|
31
|
-
json_schema: {
|
|
32
|
-
name: 'assert',
|
|
33
|
-
strict: true,
|
|
34
|
-
schema: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
properties: {
|
|
37
|
-
pass: {
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
description: 'Whether the assertion passed or failed'
|
|
40
|
-
},
|
|
41
|
-
thought: {
|
|
42
|
-
type: [
|
|
43
|
-
'string',
|
|
44
|
-
'null'
|
|
45
|
-
],
|
|
46
|
-
description: 'The thought process behind the assertion'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
required: [
|
|
50
|
-
'pass',
|
|
51
|
-
'thought'
|
|
52
|
-
],
|
|
53
|
-
additionalProperties: false
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.assertSchema = __webpack_exports__.assertSchema;
|
|
58
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
-
"assertSchema"
|
|
60
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
61
|
-
Object.defineProperty(exports, '__esModule', {
|
|
62
|
-
value: true
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=assertion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-model/prompt/assertion.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/prompt/assertion.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { ResponseFormatJSONSchema } from 'openai/resources/index';\n\nexport const assertSchema: ResponseFormatJSONSchema = {\n type: 'json_schema',\n json_schema: {\n name: 'assert',\n strict: true,\n schema: {\n type: 'object',\n properties: {\n pass: {\n type: 'boolean',\n description: 'Whether the assertion passed or failed',\n },\n thought: {\n type: ['string', 'null'],\n description: 'The thought process behind the assertion',\n },\n },\n required: ['pass', 'thought'],\n additionalProperties: false,\n },\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","assertSchema"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;ACJO,MAAMI,eAAyC;IACpD,MAAM;IACN,aAAa;QACX,MAAM;QACN,QAAQ;QACR,QAAQ;YACN,MAAM;YACN,YAAY;gBACV,MAAM;oBACJ,MAAM;oBACN,aAAa;gBACf;gBACA,SAAS;oBACP,MAAM;wBAAC;wBAAU;qBAAO;oBACxB,aAAa;gBACf;YACF;YACA,UAAU;gBAAC;gBAAQ;aAAU;YAC7B,sBAAsB;QACxB;IACF;AACF"}
|