feat(core): expose session switching endpoints

This commit is contained in:
Dax Raad
2026-06-21 23:59:22 -04:00
parent 9dadc2455f
commit 35b3fc85d0
7 changed files with 283 additions and 4 deletions
+86
View File
@@ -353,6 +353,10 @@ import type {
V2SessionQuestionRejectResponses,
V2SessionQuestionReplyErrors,
V2SessionQuestionReplyResponses,
V2SessionSwitchAgentErrors,
V2SessionSwitchAgentResponses,
V2SessionSwitchModelErrors,
V2SessionSwitchModelResponses,
V2SessionWaitErrors,
V2SessionWaitResponses,
V2SkillListErrors,
@@ -5337,6 +5341,88 @@ export class Session3 extends HeyApiClient {
})
}
/**
* Switch session agent
*
* Switch the agent used by subsequent session activity.
*/
public switchAgent<ThrowOnError extends boolean = false>(
parameters: {
sessionID: string
agent?: string
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "sessionID" },
{ in: "body", key: "agent" },
],
},
],
)
return (options?.client ?? this.client).post<
V2SessionSwitchAgentResponses,
V2SessionSwitchAgentErrors,
ThrowOnError
>({
url: "/api/session/{sessionID}/agent",
...options,
...params,
headers: {
"Content-Type": "application/json",
...options?.headers,
...params.headers,
},
})
}
/**
* Switch session model
*
* Switch the model used by subsequent session activity.
*/
public switchModel<ThrowOnError extends boolean = false>(
parameters: {
sessionID: string
model?: {
id: string
providerID: string
variant?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "sessionID" },
{ in: "body", key: "model" },
],
},
],
)
return (options?.client ?? this.client).post<
V2SessionSwitchModelResponses,
V2SessionSwitchModelErrors,
ThrowOnError
>({
url: "/api/session/{sessionID}/model",
...options,
...params,
headers: {
"Content-Type": "application/json",
...options?.headers,
...params.headers,
},
})
}
/**
* Send message
*