@rodrigobeber/patoai-dtos 4.6.55 → 4.6.56
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/ai/core/provider.enum.d.ts +2 -1
- package/dist/ai/core/provider.enum.js +1 -0
- package/dist/ai/text/ai-types.d.ts +38 -0
- package/dist/ai/text/ai-types.js +7 -0
- package/dist/ai/text/completion-request.dto.d.ts +2 -2
- package/dist/ai/text/index.d.ts +1 -0
- package/dist/ai/text/index.js +1 -0
- package/dist/ai/text/response-create.dto.d.ts +12 -4
- package/dist/ai/text/response.dto.d.ts +2 -2
- package/package.json +1 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic AI types.
|
|
3
|
+
* These replace direct OpenAI SDK imports across the monorepo.
|
|
4
|
+
* Only patoai-openai should import from the `openai` package.
|
|
5
|
+
*/
|
|
6
|
+
export interface AIFunctionTool {
|
|
7
|
+
type: 'function';
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
parameters: Record<string, unknown> | null;
|
|
11
|
+
strict: boolean | null;
|
|
12
|
+
}
|
|
13
|
+
export type AITool = AIFunctionTool;
|
|
14
|
+
export interface AIFunctionCallOutput {
|
|
15
|
+
type: 'function_call_output';
|
|
16
|
+
call_id: string;
|
|
17
|
+
output: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AIFunctionCallItem {
|
|
20
|
+
type: 'function_call';
|
|
21
|
+
call_id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
arguments: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
status?: 'in_progress' | 'completed' | 'incomplete';
|
|
26
|
+
}
|
|
27
|
+
export interface AIMessageItem {
|
|
28
|
+
type: 'message';
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export type AIOutputItem = AIFunctionCallItem | AIMessageItem | {
|
|
32
|
+
type: string;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
export interface AITextConfig {
|
|
36
|
+
format?: Record<string, unknown>;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AITextConfig } from "./ai-types";
|
|
2
2
|
import { InputMessageDto } from "./input-message.dto";
|
|
3
3
|
import { ProviderDto } from "../core";
|
|
4
4
|
export interface CompletionRequestDto {
|
|
@@ -9,6 +9,6 @@ export interface CompletionRequestDto {
|
|
|
9
9
|
maxOutputTokens?: number;
|
|
10
10
|
temperature: number;
|
|
11
11
|
effort: string;
|
|
12
|
-
outputConfig?:
|
|
12
|
+
outputConfig?: AITextConfig;
|
|
13
13
|
userId: string;
|
|
14
14
|
}
|
package/dist/ai/text/index.d.ts
CHANGED
package/dist/ai/text/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai-types"), exports);
|
|
17
18
|
__exportStar(require("./completion-request.dto"), exports);
|
|
18
19
|
__exportStar(require("./completion.dto"), exports);
|
|
19
20
|
__exportStar(require("./input-message.dto"), exports);
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AIFunctionCallOutput, AITextConfig, AITool } from "./ai-types";
|
|
2
2
|
import { InputMessageDto } from "./input-message.dto";
|
|
3
3
|
import { ProviderDto } from "../core/provider.dto";
|
|
4
|
+
export interface ResponseCreateFallbackDto {
|
|
5
|
+
provider: ProviderDto;
|
|
6
|
+
model: string;
|
|
7
|
+
temperature: number;
|
|
8
|
+
maxOutputTokens: number;
|
|
9
|
+
effort?: string;
|
|
10
|
+
}
|
|
4
11
|
export interface ResponseCreateDto {
|
|
5
12
|
provider: ProviderDto;
|
|
6
13
|
model: string;
|
|
7
14
|
background: boolean;
|
|
8
15
|
instructions: string;
|
|
9
16
|
messages: InputMessageDto[];
|
|
10
|
-
toolOutputs:
|
|
17
|
+
toolOutputs: AIFunctionCallOutput[];
|
|
11
18
|
temperature: number;
|
|
12
19
|
effort: string;
|
|
13
20
|
parallelToolCalls: boolean;
|
|
14
21
|
maxOutputTokens: number;
|
|
15
|
-
outputConfig?:
|
|
16
|
-
tools:
|
|
22
|
+
outputConfig?: AITextConfig;
|
|
23
|
+
tools: AITool[];
|
|
17
24
|
userId: string;
|
|
18
25
|
previousResponseId?: string;
|
|
19
26
|
includeFileSearchResults?: boolean;
|
|
27
|
+
fallback?: ResponseCreateFallbackDto;
|
|
20
28
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AIOutputItem } from "./ai-types";
|
|
2
2
|
export interface ResponseDto {
|
|
3
3
|
id: string;
|
|
4
4
|
status: 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete';
|
|
5
5
|
outputText: string;
|
|
6
|
-
outputItems:
|
|
6
|
+
outputItems: AIOutputItem[];
|
|
7
7
|
error: string | null;
|
|
8
8
|
truncationReason: 'max_output_tokens' | 'content_filter' | null;
|
|
9
9
|
tokensIn: number | null;
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rodrigobeber/patoai-dtos",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.56",
|
|
4
4
|
"description": "Data Transfer Objects for PatoAI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"openai": "^6.16.0"
|
|
10
|
-
},
|
|
11
8
|
"devDependencies": {
|
|
12
9
|
"@types/node": "^24.3.1",
|
|
13
10
|
"typescript": "5.9.2"
|