@openrouter/sdk 1.5.6 → 1.5.7
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/errors/index.d.ts +0 -2
- package/esm/models/errors/index.js +0 -2
- package/esm/models/index.d.ts +0 -40
- package/esm/models/index.js +0 -40
- package/esm/models/operations/index.d.ts +0 -15
- package/esm/models/operations/index.js +0 -15
- package/esm/sdk/sdk.d.ts +0 -3
- package/esm/sdk/sdk.js +0 -4
- package/jsr.json +1 -1
- package/package.json +9 -9
- package/esm/funcs/internsChat.d.ts +0 -42
- package/esm/funcs/internsChat.js +0 -109
- package/esm/funcs/internsCreateIntern.d.ts +0 -21
- package/esm/funcs/internsCreateIntern.js +0 -103
- package/esm/funcs/internsDeleteIntern.d.ts +0 -21
- package/esm/funcs/internsDeleteIntern.js +0 -108
- package/esm/funcs/internsGetIntern.d.ts +0 -21
- package/esm/funcs/internsGetIntern.js +0 -105
- package/esm/funcs/internsGetInternConnections.d.ts +0 -21
- package/esm/funcs/internsGetInternConnections.js +0 -105
- package/esm/funcs/internsGetInternDaemon.d.ts +0 -21
- package/esm/funcs/internsGetInternDaemon.js +0 -105
- package/esm/funcs/internsGetInternDaemonAccess.d.ts +0 -23
- package/esm/funcs/internsGetInternDaemonAccess.js +0 -107
- package/esm/funcs/internsGetInternIcon.d.ts +0 -20
- package/esm/funcs/internsGetInternIcon.js +0 -109
- package/esm/funcs/internsInvoke.d.ts +0 -26
- package/esm/funcs/internsInvoke.js +0 -119
- package/esm/funcs/internsListInterns.d.ts +0 -21
- package/esm/funcs/internsListInterns.js +0 -107
- package/esm/funcs/internsProvisionIntern.d.ts +0 -21
- package/esm/funcs/internsProvisionIntern.js +0 -105
- package/esm/funcs/internsSignInternDaemonAccessRequest.d.ts +0 -22
- package/esm/funcs/internsSignInternDaemonAccessRequest.js +0 -109
- package/esm/funcs/internsSignInternDaemonRequest.d.ts +0 -20
- package/esm/funcs/internsSignInternDaemonRequest.js +0 -109
- package/esm/funcs/internsSuspendIntern.d.ts +0 -21
- package/esm/funcs/internsSuspendIntern.js +0 -105
- package/esm/funcs/internsUpdateIntern.d.ts +0 -21
- package/esm/funcs/internsUpdateIntern.js +0 -108
- package/esm/models/createinternrequest.d.ts +0 -43
- package/esm/models/createinternrequest.js +0 -24
- package/esm/models/deleteinternrequest.d.ts +0 -18
- package/esm/models/deleteinternrequest.js +0 -18
- package/esm/models/deleteinternresponse.d.ts +0 -10
- package/esm/models/deleteinternresponse.js +0 -14
- package/esm/models/errors/internchaterrorresponse.d.ts +0 -31
- package/esm/models/errors/internchaterrorresponse.js +0 -35
- package/esm/models/errors/internlifecycleerror.d.ts +0 -25
- package/esm/models/errors/internlifecycleerror.js +0 -35
- package/esm/models/intern.d.ts +0 -120
- package/esm/models/intern.js +0 -74
- package/esm/models/internapprovalmode.d.ts +0 -16
- package/esm/models/internapprovalmode.js +0 -15
- package/esm/models/internchatassistantmessage.d.ts +0 -24
- package/esm/models/internchatassistantmessage.js +0 -22
- package/esm/models/internchatchoice.d.ts +0 -37
- package/esm/models/internchatchoice.js +0 -33
- package/esm/models/internchatcompletionchunk.d.ts +0 -48
- package/esm/models/internchatcompletionchunk.js +0 -34
- package/esm/models/internchatcompletionrequest.d.ts +0 -40
- package/esm/models/internchatcompletionrequest.js +0 -25
- package/esm/models/internchatdelta.d.ts +0 -24
- package/esm/models/internchatdelta.js +0 -28
- package/esm/models/internchatdevelopermessage.d.ts +0 -21
- package/esm/models/internchatdevelopermessage.js +0 -15
- package/esm/models/internchatechoedtoolcall.d.ts +0 -21
- package/esm/models/internchatechoedtoolcall.js +0 -15
- package/esm/models/internchatechoedtoolcallfunction.d.ts +0 -17
- package/esm/models/internchatechoedtoolcallfunction.js +0 -14
- package/esm/models/internchaterror.d.ts +0 -22
- package/esm/models/internchaterror.js +0 -17
- package/esm/models/internchaterrormetadata.d.ts +0 -48
- package/esm/models/internchaterrormetadata.js +0 -39
- package/esm/models/internchatmessage.d.ts +0 -16
- package/esm/models/internchatmessage.js +0 -22
- package/esm/models/internchatmessagecontent.d.ts +0 -12
- package/esm/models/internchatmessagecontent.js +0 -12
- package/esm/models/internchatprompttokensdetails.d.ts +0 -13
- package/esm/models/internchatprompttokensdetails.js +0 -19
- package/esm/models/internchatsteeredresponse.d.ts +0 -33
- package/esm/models/internchatsteeredresponse.js +0 -28
- package/esm/models/internchatstreamerror.d.ts +0 -22
- package/esm/models/internchatstreamerror.js +0 -17
- package/esm/models/internchatstreamingresponse.d.ts +0 -17
- package/esm/models/internchatstreamingresponse.js +0 -29
- package/esm/models/internchatsystemmessage.d.ts +0 -21
- package/esm/models/internchatsystemmessage.js +0 -15
- package/esm/models/internchattextpart.d.ts +0 -24
- package/esm/models/internchattextpart.js +0 -19
- package/esm/models/internchattoolcall.d.ts +0 -30
- package/esm/models/internchattoolcall.js +0 -23
- package/esm/models/internchattoolcallfunction.d.ts +0 -24
- package/esm/models/internchattoolcallfunction.js +0 -20
- package/esm/models/internchattoolmessage.d.ts +0 -23
- package/esm/models/internchattoolmessage.js +0 -21
- package/esm/models/internchatusage.d.ts +0 -24
- package/esm/models/internchatusage.js +0 -27
- package/esm/models/internchatusermessage.d.ts +0 -21
- package/esm/models/internchatusermessage.js +0 -15
- package/esm/models/internconnection.d.ts +0 -118
- package/esm/models/internconnection.js +0 -105
- package/esm/models/internconnectionlist.d.ts +0 -11
- package/esm/models/internconnectionlist.js +0 -15
- package/esm/models/interndaemonaccess.d.ts +0 -24
- package/esm/models/interndaemonaccess.js +0 -23
- package/esm/models/interninvokeacceptedresponse.d.ts +0 -34
- package/esm/models/interninvokeacceptedresponse.js +0 -30
- package/esm/models/interninvokerequest.d.ts +0 -23
- package/esm/models/interninvokerequest.js +0 -19
- package/esm/models/internlifecycleerror.d.ts +0 -23
- package/esm/models/internlifecycleerror.js +0 -32
- package/esm/models/internlistresponse.d.ts +0 -22
- package/esm/models/internlistresponse.js +0 -23
- package/esm/models/operations/createintern.d.ts +0 -61
- package/esm/models/operations/createintern.js +0 -25
- package/esm/models/operations/createinternchatcompletion.d.ts +0 -77
- package/esm/models/operations/createinternchatcompletion.js +0 -71
- package/esm/models/operations/deleteintern.d.ts +0 -61
- package/esm/models/operations/deleteintern.js +0 -24
- package/esm/models/operations/getintern.d.ts +0 -58
- package/esm/models/operations/getintern.js +0 -21
- package/esm/models/operations/getinternconnections.d.ts +0 -58
- package/esm/models/operations/getinternconnections.js +0 -21
- package/esm/models/operations/getinterndaemon.d.ts +0 -58
- package/esm/models/operations/getinterndaemon.js +0 -21
- package/esm/models/operations/getinterndaemonaccess.d.ts +0 -58
- package/esm/models/operations/getinterndaemonaccess.js +0 -21
- package/esm/models/operations/getinternicon.d.ts +0 -63
- package/esm/models/operations/getinternicon.js +0 -22
- package/esm/models/operations/invokeintern.d.ts +0 -72
- package/esm/models/operations/invokeintern.js +0 -38
- package/esm/models/operations/listinterns.d.ts +0 -87
- package/esm/models/operations/listinterns.js +0 -40
- package/esm/models/operations/provisionintern.d.ts +0 -58
- package/esm/models/operations/provisionintern.js +0 -21
- package/esm/models/operations/signinterndaemonaccessrequest.d.ts +0 -72
- package/esm/models/operations/signinterndaemonaccessrequest.js +0 -38
- package/esm/models/operations/signinterndaemonrequest.d.ts +0 -72
- package/esm/models/operations/signinterndaemonrequest.js +0 -38
- package/esm/models/operations/suspendintern.d.ts +0 -58
- package/esm/models/operations/suspendintern.js +0 -21
- package/esm/models/operations/updateintern.d.ts +0 -61
- package/esm/models/operations/updateintern.js +0 -24
- package/esm/models/provisioninternresponse.d.ts +0 -10
- package/esm/models/provisioninternresponse.js +0 -14
- package/esm/models/signinterndaemonrequest.d.ts +0 -54
- package/esm/models/signinterndaemonrequest.js +0 -30
- package/esm/models/signinterndaemonresponse.d.ts +0 -32
- package/esm/models/signinterndaemonresponse.js +0 -27
- package/esm/models/suspendinternresponse.d.ts +0 -10
- package/esm/models/suspendinternresponse.js +0 -14
- package/esm/models/updateinternrequest.d.ts +0 -33
- package/esm/models/updateinternrequest.js +0 -16
- package/esm/sdk/interns.d.ts +0 -143
- package/esm/sdk/interns.js +0 -163
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 280574b56b8f
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export const DeleteInternResponse$inboundSchema = z.object({
|
|
9
|
-
deleting: z.literal(true),
|
|
10
|
-
});
|
|
11
|
-
export function deleteInternResponseFromJSON(jsonString) {
|
|
12
|
-
return safeParse(jsonString, (x) => DeleteInternResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteInternResponse' from JSON`);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=deleteinternresponse.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import * as models from "../index.js";
|
|
3
|
-
import { OpenRouterError } from "./openroutererror.js";
|
|
4
|
-
/**
|
|
5
|
-
* A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.
|
|
6
|
-
*/
|
|
7
|
-
export type InternChatErrorResponseData = {
|
|
8
|
-
/**
|
|
9
|
-
* The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`.
|
|
10
|
-
*/
|
|
11
|
-
error: models.InternChatError;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare class InternChatErrorResponse extends OpenRouterError {
|
|
17
|
-
/**
|
|
18
|
-
* The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`.
|
|
19
|
-
*/
|
|
20
|
-
error: models.InternChatError;
|
|
21
|
-
/** The original data that was passed to this error instance. */
|
|
22
|
-
data$: InternChatErrorResponseData;
|
|
23
|
-
constructor(err: InternChatErrorResponseData, httpMeta: {
|
|
24
|
-
response: Response;
|
|
25
|
-
request: Request;
|
|
26
|
-
body: string;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/** @internal */
|
|
30
|
-
export declare const InternChatErrorResponse$inboundSchema: z.ZodType<InternChatErrorResponse, unknown>;
|
|
31
|
-
//# sourceMappingURL=internchaterrorresponse.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: bb73eae2fe73
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { InternChatError$inboundSchema as models_InternChatError$inboundSchema } from "../internchaterror.js";
|
|
7
|
-
import { OpenRouterError } from "./openroutererror.js";
|
|
8
|
-
/**
|
|
9
|
-
* A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.
|
|
10
|
-
*/
|
|
11
|
-
export class InternChatErrorResponse extends OpenRouterError {
|
|
12
|
-
constructor(err, httpMeta) {
|
|
13
|
-
const message = err.error?.message
|
|
14
|
-
|| `API error occurred: ${JSON.stringify(err)}`;
|
|
15
|
-
super(message, httpMeta);
|
|
16
|
-
this.data$ = err;
|
|
17
|
-
this.error = err.error;
|
|
18
|
-
this.name = "InternChatErrorResponse";
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/** @internal */
|
|
22
|
-
export const InternChatErrorResponse$inboundSchema = z.object({
|
|
23
|
-
error: models_InternChatError$inboundSchema,
|
|
24
|
-
request$: z.custom(x => x instanceof Request),
|
|
25
|
-
response$: z.custom(x => x instanceof Response),
|
|
26
|
-
body$: z.string(),
|
|
27
|
-
})
|
|
28
|
-
.transform((v) => {
|
|
29
|
-
return new InternChatErrorResponse(v, {
|
|
30
|
-
request: v.request$,
|
|
31
|
-
response: v.response$,
|
|
32
|
-
body: v.body$,
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=internchaterrorresponse.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import * as models from "../index.js";
|
|
3
|
-
import { OpenRouterError } from "./openroutererror.js";
|
|
4
|
-
/**
|
|
5
|
-
* Intern lifecycle request failure.
|
|
6
|
-
*/
|
|
7
|
-
export type InternLifecycleErrorData = {
|
|
8
|
-
error: models.InternLifecycleErrorError;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Intern lifecycle request failure.
|
|
12
|
-
*/
|
|
13
|
-
export declare class InternLifecycleError extends OpenRouterError {
|
|
14
|
-
error: models.InternLifecycleErrorError;
|
|
15
|
-
/** The original data that was passed to this error instance. */
|
|
16
|
-
data$: InternLifecycleErrorData;
|
|
17
|
-
constructor(err: InternLifecycleErrorData, httpMeta: {
|
|
18
|
-
response: Response;
|
|
19
|
-
request: Request;
|
|
20
|
-
body: string;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare const InternLifecycleError$inboundSchema: z.ZodType<InternLifecycleError, unknown>;
|
|
25
|
-
//# sourceMappingURL=internlifecycleerror.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 31cfc72977f7
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { InternLifecycleErrorError$inboundSchema as models_InternLifecycleErrorError$inboundSchema } from "../internlifecycleerror.js";
|
|
7
|
-
import { OpenRouterError } from "./openroutererror.js";
|
|
8
|
-
/**
|
|
9
|
-
* Intern lifecycle request failure.
|
|
10
|
-
*/
|
|
11
|
-
export class InternLifecycleError extends OpenRouterError {
|
|
12
|
-
constructor(err, httpMeta) {
|
|
13
|
-
const message = err.error?.message
|
|
14
|
-
|| `API error occurred: ${JSON.stringify(err)}`;
|
|
15
|
-
super(message, httpMeta);
|
|
16
|
-
this.data$ = err;
|
|
17
|
-
this.error = err.error;
|
|
18
|
-
this.name = "InternLifecycleError";
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/** @internal */
|
|
22
|
-
export const InternLifecycleError$inboundSchema = z.object({
|
|
23
|
-
error: z.lazy(() => models_InternLifecycleErrorError$inboundSchema),
|
|
24
|
-
request$: z.custom(x => x instanceof Request),
|
|
25
|
-
response$: z.custom(x => x instanceof Response),
|
|
26
|
-
body$: z.string(),
|
|
27
|
-
})
|
|
28
|
-
.transform((v) => {
|
|
29
|
-
return new InternLifecycleError(v, {
|
|
30
|
-
request: v.request$,
|
|
31
|
-
response: v.response$,
|
|
32
|
-
body: v.body$,
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=internlifecycleerror.js.map
|
package/esm/models/intern.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
/**
|
|
6
|
-
* Active provisioning step, or null once provisioning has settled.
|
|
7
|
-
*/
|
|
8
|
-
export type Progress = {
|
|
9
|
-
/**
|
|
10
|
-
* Human-readable label of the active provisioning step.
|
|
11
|
-
*/
|
|
12
|
-
stepLabel: string;
|
|
13
|
-
/**
|
|
14
|
-
* One-based index of the active step.
|
|
15
|
-
*/
|
|
16
|
-
stepNumber: number;
|
|
17
|
-
/**
|
|
18
|
-
* Number of provisioning steps.
|
|
19
|
-
*/
|
|
20
|
-
totalSteps: number;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Lifecycle status.
|
|
24
|
-
*/
|
|
25
|
-
export declare const InternStatus: {
|
|
26
|
-
readonly AwaitingSlackInstall: "awaiting_slack_install";
|
|
27
|
-
readonly Queued: "queued";
|
|
28
|
-
readonly Provisioning: "provisioning";
|
|
29
|
-
readonly Running: "running";
|
|
30
|
-
readonly Failed: "failed";
|
|
31
|
-
readonly Stopped: "stopped";
|
|
32
|
-
readonly Destroying: "destroying";
|
|
33
|
-
readonly DestroyFailed: "destroy_failed";
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Lifecycle status.
|
|
37
|
-
*/
|
|
38
|
-
export type InternStatus = OpenEnum<typeof InternStatus>;
|
|
39
|
-
/**
|
|
40
|
-
* Public lifecycle state and settings for one intern.
|
|
41
|
-
*/
|
|
42
|
-
export type Intern = {
|
|
43
|
-
/**
|
|
44
|
-
* Vault the intern borrows from another intern, or null when it borrows none.
|
|
45
|
-
*/
|
|
46
|
-
attachedVaultId: string | null;
|
|
47
|
-
/**
|
|
48
|
-
* Whether this key may change the intern (update, provision, suspend, delete). Present on list and retrieve; false while lifecycle writes are closed for the account.
|
|
49
|
-
*/
|
|
50
|
-
canEdit?: boolean | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* ISO 8601 creation time.
|
|
53
|
-
*/
|
|
54
|
-
createdAt: string;
|
|
55
|
-
/**
|
|
56
|
-
* Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user.
|
|
57
|
-
*/
|
|
58
|
-
createdByYou?: boolean | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Free-form description.
|
|
61
|
-
*/
|
|
62
|
-
description: string | null;
|
|
63
|
-
/**
|
|
64
|
-
* Public hostname the intern is reachable at, or null until provisioning has assigned one.
|
|
65
|
-
*/
|
|
66
|
-
hostname: string | null;
|
|
67
|
-
/**
|
|
68
|
-
* SHA-256 of the intern icon, or null when it has none. Present on list and retrieve; fetch the bytes from `GET /api/v1/interns/{intern_id}/icon`.
|
|
69
|
-
*/
|
|
70
|
-
iconSha256?: string | null | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Intern id.
|
|
73
|
-
*/
|
|
74
|
-
id: string;
|
|
75
|
-
/**
|
|
76
|
-
* Standing instructions the intern boots with.
|
|
77
|
-
*/
|
|
78
|
-
instructions: string | null;
|
|
79
|
-
/**
|
|
80
|
-
* Why the last provisioning attempt failed, when status is failed.
|
|
81
|
-
*/
|
|
82
|
-
lastFailureMessage: string | null;
|
|
83
|
-
/**
|
|
84
|
-
* OpenRouter model slug the intern runs, or null for the workspace default.
|
|
85
|
-
*/
|
|
86
|
-
model: string | null;
|
|
87
|
-
/**
|
|
88
|
-
* Intern name, unique per creator within a workspace.
|
|
89
|
-
*/
|
|
90
|
-
name: string;
|
|
91
|
-
/**
|
|
92
|
-
* Active provisioning step, or null once provisioning has settled.
|
|
93
|
-
*/
|
|
94
|
-
progress: Progress | null;
|
|
95
|
-
/**
|
|
96
|
-
* Lifecycle status.
|
|
97
|
-
*/
|
|
98
|
-
status: InternStatus;
|
|
99
|
-
/**
|
|
100
|
-
* ISO 8601 last update time.
|
|
101
|
-
*/
|
|
102
|
-
updatedAt: string;
|
|
103
|
-
/**
|
|
104
|
-
* Vault the intern owns, or null before it has been created.
|
|
105
|
-
*/
|
|
106
|
-
vaultId: string | null;
|
|
107
|
-
/**
|
|
108
|
-
* Workspace that owns the intern and scopes its secrets.
|
|
109
|
-
*/
|
|
110
|
-
workspaceId: string;
|
|
111
|
-
};
|
|
112
|
-
/** @internal */
|
|
113
|
-
export declare const Progress$inboundSchema: z.ZodType<Progress, unknown>;
|
|
114
|
-
export declare function progressFromJSON(jsonString: string): SafeParseResult<Progress, SDKValidationError>;
|
|
115
|
-
/** @internal */
|
|
116
|
-
export declare const InternStatus$inboundSchema: z.ZodType<InternStatus, unknown>;
|
|
117
|
-
/** @internal */
|
|
118
|
-
export declare const Intern$inboundSchema: z.ZodType<Intern, unknown>;
|
|
119
|
-
export declare function internFromJSON(jsonString: string): SafeParseResult<Intern, SDKValidationError>;
|
|
120
|
-
//# sourceMappingURL=intern.d.ts.map
|
package/esm/models/intern.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 88580bab3ce4
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import * as openEnums from "../types/enums.js";
|
|
9
|
-
/**
|
|
10
|
-
* Lifecycle status.
|
|
11
|
-
*/
|
|
12
|
-
export const InternStatus = {
|
|
13
|
-
AwaitingSlackInstall: "awaiting_slack_install",
|
|
14
|
-
Queued: "queued",
|
|
15
|
-
Provisioning: "provisioning",
|
|
16
|
-
Running: "running",
|
|
17
|
-
Failed: "failed",
|
|
18
|
-
Stopped: "stopped",
|
|
19
|
-
Destroying: "destroying",
|
|
20
|
-
DestroyFailed: "destroy_failed",
|
|
21
|
-
};
|
|
22
|
-
/** @internal */
|
|
23
|
-
export const Progress$inboundSchema = z.object({
|
|
24
|
-
step_label: z.string(),
|
|
25
|
-
step_number: z.int(),
|
|
26
|
-
total_steps: z.int(),
|
|
27
|
-
}).transform((v) => {
|
|
28
|
-
return remap$(v, {
|
|
29
|
-
"step_label": "stepLabel",
|
|
30
|
-
"step_number": "stepNumber",
|
|
31
|
-
"total_steps": "totalSteps",
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
export function progressFromJSON(jsonString) {
|
|
35
|
-
return safeParse(jsonString, (x) => Progress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Progress' from JSON`);
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const InternStatus$inboundSchema = openEnums.inboundSchema(InternStatus);
|
|
39
|
-
/** @internal */
|
|
40
|
-
export const Intern$inboundSchema = z.object({
|
|
41
|
-
attached_vault_id: z.nullable(z.string()),
|
|
42
|
-
can_edit: z.boolean().optional(),
|
|
43
|
-
created_at: z.string(),
|
|
44
|
-
created_by_you: z.boolean().optional(),
|
|
45
|
-
description: z.nullable(z.string()),
|
|
46
|
-
hostname: z.nullable(z.string()),
|
|
47
|
-
icon_sha256: z.nullable(z.string()).optional(),
|
|
48
|
-
id: z.string(),
|
|
49
|
-
instructions: z.nullable(z.string()),
|
|
50
|
-
last_failure_message: z.nullable(z.string()),
|
|
51
|
-
model: z.nullable(z.string()),
|
|
52
|
-
name: z.string(),
|
|
53
|
-
progress: z.nullable(z.lazy(() => Progress$inboundSchema)),
|
|
54
|
-
status: InternStatus$inboundSchema,
|
|
55
|
-
updated_at: z.string(),
|
|
56
|
-
vault_id: z.nullable(z.string()),
|
|
57
|
-
workspace_id: z.string(),
|
|
58
|
-
}).transform((v) => {
|
|
59
|
-
return remap$(v, {
|
|
60
|
-
"attached_vault_id": "attachedVaultId",
|
|
61
|
-
"can_edit": "canEdit",
|
|
62
|
-
"created_at": "createdAt",
|
|
63
|
-
"created_by_you": "createdByYou",
|
|
64
|
-
"icon_sha256": "iconSha256",
|
|
65
|
-
"last_failure_message": "lastFailureMessage",
|
|
66
|
-
"updated_at": "updatedAt",
|
|
67
|
-
"vault_id": "vaultId",
|
|
68
|
-
"workspace_id": "workspaceId",
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
export function internFromJSON(jsonString) {
|
|
72
|
-
return safeParse(jsonString, (x) => Intern$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Intern' from JSON`);
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=intern.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
/**
|
|
4
|
-
* How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
|
|
5
|
-
*/
|
|
6
|
-
export declare const InternApprovalMode: {
|
|
7
|
-
readonly Manual: "manual";
|
|
8
|
-
readonly SelfDrive: "self-drive";
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
|
|
12
|
-
*/
|
|
13
|
-
export type InternApprovalMode = OpenEnum<typeof InternApprovalMode>;
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare const InternApprovalMode$outboundSchema: z.ZodType<string, InternApprovalMode>;
|
|
16
|
-
//# sourceMappingURL=internapprovalmode.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: cccfde70a06c
|
|
4
|
-
*/
|
|
5
|
-
import * as openEnums from "../types/enums.js";
|
|
6
|
-
/**
|
|
7
|
-
* How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
|
|
8
|
-
*/
|
|
9
|
-
export const InternApprovalMode = {
|
|
10
|
-
Manual: "manual",
|
|
11
|
-
SelfDrive: "self-drive",
|
|
12
|
-
};
|
|
13
|
-
/** @internal */
|
|
14
|
-
export const InternApprovalMode$outboundSchema = openEnums.outboundSchema(InternApprovalMode);
|
|
15
|
-
//# sourceMappingURL=internapprovalmode.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { InternChatEchoedToolCall, InternChatEchoedToolCall$Outbound } from "./internchatechoedtoolcall.js";
|
|
3
|
-
import { InternChatMessageContent, InternChatMessageContent$Outbound } from "./internchatmessagecontent.js";
|
|
4
|
-
/**
|
|
5
|
-
* An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message.
|
|
6
|
-
*/
|
|
7
|
-
export type InternChatAssistantMessage = {
|
|
8
|
-
/**
|
|
9
|
-
* Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history.
|
|
10
|
-
*/
|
|
11
|
-
content?: InternChatMessageContent | null | undefined;
|
|
12
|
-
role: "assistant";
|
|
13
|
-
toolCalls?: Array<InternChatEchoedToolCall> | undefined;
|
|
14
|
-
};
|
|
15
|
-
/** @internal */
|
|
16
|
-
export type InternChatAssistantMessage$Outbound = {
|
|
17
|
-
content?: InternChatMessageContent$Outbound | null | undefined;
|
|
18
|
-
role: "assistant";
|
|
19
|
-
tool_calls?: Array<InternChatEchoedToolCall$Outbound> | undefined;
|
|
20
|
-
};
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare const InternChatAssistantMessage$outboundSchema: z.ZodType<InternChatAssistantMessage$Outbound, InternChatAssistantMessage>;
|
|
23
|
-
export declare function internChatAssistantMessageToJSON(internChatAssistantMessage: InternChatAssistantMessage): string;
|
|
24
|
-
//# sourceMappingURL=internchatassistantmessage.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: db891c763d46
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { InternChatEchoedToolCall$outboundSchema, } from "./internchatechoedtoolcall.js";
|
|
8
|
-
import { InternChatMessageContent$outboundSchema, } from "./internchatmessagecontent.js";
|
|
9
|
-
/** @internal */
|
|
10
|
-
export const InternChatAssistantMessage$outboundSchema = z.object({
|
|
11
|
-
content: z.nullable(InternChatMessageContent$outboundSchema).optional(),
|
|
12
|
-
role: z.literal("assistant"),
|
|
13
|
-
toolCalls: z.array(InternChatEchoedToolCall$outboundSchema).optional(),
|
|
14
|
-
}).transform((v) => {
|
|
15
|
-
return remap$(v, {
|
|
16
|
-
toolCalls: "tool_calls",
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
export function internChatAssistantMessageToJSON(internChatAssistantMessage) {
|
|
20
|
-
return JSON.stringify(InternChatAssistantMessage$outboundSchema.parse(internChatAssistantMessage));
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=internchatassistantmessage.js.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
import { InternChatDelta } from "./internchatdelta.js";
|
|
6
|
-
/**
|
|
7
|
-
* `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.
|
|
8
|
-
*/
|
|
9
|
-
export declare const InternChatChoiceFinishReason: {
|
|
10
|
-
readonly Error: "error";
|
|
11
|
-
readonly Stop: "stop";
|
|
12
|
-
readonly ToolCalls: "tool_calls";
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.
|
|
16
|
-
*/
|
|
17
|
-
export type InternChatChoiceFinishReason = OpenEnum<typeof InternChatChoiceFinishReason>;
|
|
18
|
-
/**
|
|
19
|
-
* The single choice this endpoint streams.
|
|
20
|
-
*/
|
|
21
|
-
export type InternChatChoice = {
|
|
22
|
-
/**
|
|
23
|
-
* The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry.
|
|
24
|
-
*/
|
|
25
|
-
delta: InternChatDelta;
|
|
26
|
-
/**
|
|
27
|
-
* `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.
|
|
28
|
-
*/
|
|
29
|
-
finishReason: InternChatChoiceFinishReason | null;
|
|
30
|
-
index: number;
|
|
31
|
-
};
|
|
32
|
-
/** @internal */
|
|
33
|
-
export declare const InternChatChoiceFinishReason$inboundSchema: z.ZodType<InternChatChoiceFinishReason, unknown>;
|
|
34
|
-
/** @internal */
|
|
35
|
-
export declare const InternChatChoice$inboundSchema: z.ZodType<InternChatChoice, unknown>;
|
|
36
|
-
export declare function internChatChoiceFromJSON(jsonString: string): SafeParseResult<InternChatChoice, SDKValidationError>;
|
|
37
|
-
//# sourceMappingURL=internchatchoice.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: f10a43356b30
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import * as openEnums from "../types/enums.js";
|
|
9
|
-
import { InternChatDelta$inboundSchema, } from "./internchatdelta.js";
|
|
10
|
-
/**
|
|
11
|
-
* `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.
|
|
12
|
-
*/
|
|
13
|
-
export const InternChatChoiceFinishReason = {
|
|
14
|
-
Error: "error",
|
|
15
|
-
Stop: "stop",
|
|
16
|
-
ToolCalls: "tool_calls",
|
|
17
|
-
};
|
|
18
|
-
/** @internal */
|
|
19
|
-
export const InternChatChoiceFinishReason$inboundSchema = openEnums.inboundSchema(InternChatChoiceFinishReason);
|
|
20
|
-
/** @internal */
|
|
21
|
-
export const InternChatChoice$inboundSchema = z.object({
|
|
22
|
-
delta: InternChatDelta$inboundSchema,
|
|
23
|
-
finish_reason: z.nullable(InternChatChoiceFinishReason$inboundSchema),
|
|
24
|
-
index: z.int(),
|
|
25
|
-
}).transform((v) => {
|
|
26
|
-
return remap$(v, {
|
|
27
|
-
"finish_reason": "finishReason",
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
export function internChatChoiceFromJSON(jsonString) {
|
|
31
|
-
return safeParse(jsonString, (x) => InternChatChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternChatChoice' from JSON`);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=internchatchoice.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
import { InternChatChoice } from "./internchatchoice.js";
|
|
6
|
-
import { InternChatStreamError } from "./internchatstreamerror.js";
|
|
7
|
-
import { InternChatUsage } from "./internchatusage.js";
|
|
8
|
-
export declare const InternChatCompletionChunkObject: {
|
|
9
|
-
readonly ChatCompletionChunk: "chat.completion.chunk";
|
|
10
|
-
};
|
|
11
|
-
export type InternChatCompletionChunkObject = ClosedEnum<typeof InternChatCompletionChunkObject>;
|
|
12
|
-
/**
|
|
13
|
-
* One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`.
|
|
14
|
-
*/
|
|
15
|
-
export type InternChatCompletionChunk = {
|
|
16
|
-
/**
|
|
17
|
-
* One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`.
|
|
18
|
-
*/
|
|
19
|
-
choices: Array<InternChatChoice>;
|
|
20
|
-
created: number;
|
|
21
|
-
/**
|
|
22
|
-
* A failure after the response headers were sent. The chunk that carries it has `finish_reason: "error"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation.
|
|
23
|
-
*/
|
|
24
|
-
error?: InternChatStreamError | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* The completion id, constant for the whole response.
|
|
27
|
-
*/
|
|
28
|
-
id: string;
|
|
29
|
-
/**
|
|
30
|
-
* The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used.
|
|
31
|
-
*/
|
|
32
|
-
model: string;
|
|
33
|
-
object: InternChatCompletionChunkObject;
|
|
34
|
-
/**
|
|
35
|
-
* On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon.
|
|
36
|
-
*/
|
|
37
|
-
sessionId?: string | null | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over.
|
|
40
|
-
*/
|
|
41
|
-
usage?: InternChatUsage | null | undefined;
|
|
42
|
-
};
|
|
43
|
-
/** @internal */
|
|
44
|
-
export declare const InternChatCompletionChunkObject$inboundSchema: z.ZodEnum<typeof InternChatCompletionChunkObject>;
|
|
45
|
-
/** @internal */
|
|
46
|
-
export declare const InternChatCompletionChunk$inboundSchema: z.ZodType<InternChatCompletionChunk, unknown>;
|
|
47
|
-
export declare function internChatCompletionChunkFromJSON(jsonString: string): SafeParseResult<InternChatCompletionChunk, SDKValidationError>;
|
|
48
|
-
//# sourceMappingURL=internchatcompletionchunk.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 3492df914b61
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import { InternChatChoice$inboundSchema, } from "./internchatchoice.js";
|
|
9
|
-
import { InternChatStreamError$inboundSchema, } from "./internchatstreamerror.js";
|
|
10
|
-
import { InternChatUsage$inboundSchema, } from "./internchatusage.js";
|
|
11
|
-
export const InternChatCompletionChunkObject = {
|
|
12
|
-
ChatCompletionChunk: "chat.completion.chunk",
|
|
13
|
-
};
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const InternChatCompletionChunkObject$inboundSchema = z.enum(InternChatCompletionChunkObject);
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const InternChatCompletionChunk$inboundSchema = z.object({
|
|
18
|
-
choices: z.array(InternChatChoice$inboundSchema),
|
|
19
|
-
created: z.int(),
|
|
20
|
-
error: InternChatStreamError$inboundSchema.optional(),
|
|
21
|
-
id: z.string(),
|
|
22
|
-
model: z.string(),
|
|
23
|
-
object: InternChatCompletionChunkObject$inboundSchema,
|
|
24
|
-
session_id: z.nullable(z.string()).optional(),
|
|
25
|
-
usage: z.nullable(InternChatUsage$inboundSchema).optional(),
|
|
26
|
-
}).transform((v) => {
|
|
27
|
-
return remap$(v, {
|
|
28
|
-
"session_id": "sessionId",
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
export function internChatCompletionChunkFromJSON(jsonString) {
|
|
32
|
-
return safeParse(jsonString, (x) => InternChatCompletionChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternChatCompletionChunk' from JSON`);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=internchatcompletionchunk.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { InternApprovalMode } from "./internapprovalmode.js";
|
|
3
|
-
import { InternChatMessage, InternChatMessage$Outbound } from "./internchatmessage.js";
|
|
4
|
-
/**
|
|
5
|
-
* An OpenAI-compatible streaming chat completion request for one intern. Other OpenAI fields such as `temperature` or `tools` are ignored. The intern owns its sampling and its tools.
|
|
6
|
-
*/
|
|
7
|
-
export type InternChatCompletionRequest = {
|
|
8
|
-
/**
|
|
9
|
-
* How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
|
|
10
|
-
*/
|
|
11
|
-
approvalMode?: InternApprovalMode | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`.
|
|
14
|
-
*/
|
|
15
|
-
messages: Array<InternChatMessage>;
|
|
16
|
-
/**
|
|
17
|
-
* Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.
|
|
18
|
-
*/
|
|
19
|
-
model?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`.
|
|
22
|
-
*/
|
|
23
|
-
sessionId?: string | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`.
|
|
26
|
-
*/
|
|
27
|
-
stream: true;
|
|
28
|
-
};
|
|
29
|
-
/** @internal */
|
|
30
|
-
export type InternChatCompletionRequest$Outbound = {
|
|
31
|
-
approval_mode?: string | undefined;
|
|
32
|
-
messages: Array<InternChatMessage$Outbound>;
|
|
33
|
-
model?: string | undefined;
|
|
34
|
-
session_id?: string | undefined;
|
|
35
|
-
stream: true;
|
|
36
|
-
};
|
|
37
|
-
/** @internal */
|
|
38
|
-
export declare const InternChatCompletionRequest$outboundSchema: z.ZodType<InternChatCompletionRequest$Outbound, InternChatCompletionRequest>;
|
|
39
|
-
export declare function internChatCompletionRequestToJSON(internChatCompletionRequest: InternChatCompletionRequest): string;
|
|
40
|
-
//# sourceMappingURL=internchatcompletionrequest.d.ts.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 46664fa50bff
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { InternApprovalMode$outboundSchema, } from "./internapprovalmode.js";
|
|
8
|
-
import { InternChatMessage$outboundSchema, } from "./internchatmessage.js";
|
|
9
|
-
/** @internal */
|
|
10
|
-
export const InternChatCompletionRequest$outboundSchema = z.object({
|
|
11
|
-
approvalMode: InternApprovalMode$outboundSchema.optional(),
|
|
12
|
-
messages: z.array(InternChatMessage$outboundSchema),
|
|
13
|
-
model: z.string().optional(),
|
|
14
|
-
sessionId: z.string().optional(),
|
|
15
|
-
stream: z.literal(true),
|
|
16
|
-
}).transform((v) => {
|
|
17
|
-
return remap$(v, {
|
|
18
|
-
approvalMode: "approval_mode",
|
|
19
|
-
sessionId: "session_id",
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
export function internChatCompletionRequestToJSON(internChatCompletionRequest) {
|
|
23
|
-
return JSON.stringify(InternChatCompletionRequest$outboundSchema.parse(internChatCompletionRequest));
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=internchatcompletionrequest.js.map
|