mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-07 07:58:36 +00:00
fix: refresh protocol models and cron test lint
This commit is contained in:
@@ -2330,20 +2330,17 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
|
||||
public let provider: String?
|
||||
public let model: String?
|
||||
public let voice: String?
|
||||
public let instructions: String?
|
||||
|
||||
public init(
|
||||
sessionkey: String?,
|
||||
provider: String?,
|
||||
model: String?,
|
||||
voice: String?,
|
||||
instructions: String?)
|
||||
voice: String?)
|
||||
{
|
||||
self.sessionkey = sessionkey
|
||||
self.provider = provider
|
||||
self.model = model
|
||||
self.voice = voice
|
||||
self.instructions = instructions
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@@ -2351,7 +2348,6 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
|
||||
case provider
|
||||
case model
|
||||
case voice
|
||||
case instructions
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2330,20 +2330,17 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
|
||||
public let provider: String?
|
||||
public let model: String?
|
||||
public let voice: String?
|
||||
public let instructions: String?
|
||||
|
||||
public init(
|
||||
sessionkey: String?,
|
||||
provider: String?,
|
||||
model: String?,
|
||||
voice: String?,
|
||||
instructions: String?)
|
||||
voice: String?)
|
||||
{
|
||||
self.sessionkey = sessionkey
|
||||
self.provider = provider
|
||||
self.model = model
|
||||
self.voice = voice
|
||||
self.instructions = instructions
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@@ -2351,7 +2348,6 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
|
||||
case provider
|
||||
case model
|
||||
case voice
|
||||
case instructions
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,22 +172,22 @@ async function createDirectCronState(): Promise<DirectCronState> {
|
||||
});
|
||||
}
|
||||
|
||||
async function directCronReq<TPayload = unknown>(
|
||||
async function directCronReq(
|
||||
cronState: DirectCronState,
|
||||
method: string,
|
||||
params: Record<string, unknown>,
|
||||
): Promise<{ ok: boolean; payload?: TPayload; error?: { code?: string; message?: string } }> {
|
||||
): Promise<{ ok: boolean; payload?: unknown; error?: { code?: string; message?: string } }> {
|
||||
const { cronHandlers } = await import("./server-methods/cron.js");
|
||||
let result:
|
||||
| { ok: boolean; payload?: TPayload; error?: { code?: string; message?: string } }
|
||||
| { ok: boolean; payload?: unknown; error?: { code?: string; message?: string } }
|
||||
| undefined;
|
||||
await cronHandlers[method as keyof typeof cronHandlers]({
|
||||
await cronHandlers[method]({
|
||||
req: {} as never,
|
||||
params,
|
||||
respond: (ok, payload, error) => {
|
||||
result = {
|
||||
ok,
|
||||
payload: payload as TPayload,
|
||||
payload,
|
||||
error,
|
||||
};
|
||||
},
|
||||
@@ -204,7 +204,7 @@ async function directCronReq<TPayload = unknown>(
|
||||
isWebchatConnect: () => false,
|
||||
});
|
||||
if (!result) {
|
||||
throw new Error(`${String(method)} did not respond`);
|
||||
throw new Error(`${method} did not respond`);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user