| 75 | } |
| 76 | |
| 77 | function assistantInfo( |
| 78 | id: string, |
| 79 | parentID: string, |
| 80 | error?: SessionV1.Assistant["error"], |
| 81 | meta?: { providerID: string; modelID: string }, |
| 82 | ): SessionV1.Assistant { |
| 83 | const infoModel = meta ?? { providerID: model.providerID, modelID: model.api.id } |
| 84 | return { |
| 85 | id, |
| 86 | sessionID, |
| 87 | role: "assistant", |
| 88 | time: { created: 0 }, |
| 89 | error, |
| 90 | parentID, |
| 91 | modelID: infoModel.modelID, |
| 92 | providerID: infoModel.providerID, |
| 93 | mode: "", |
| 94 | agent: "agent", |
| 95 | path: { cwd: "/", root: "/" }, |
| 96 | cost: 0, |
| 97 | tokens: { |
| 98 | input: 0, |
| 99 | output: 0, |
| 100 | reasoning: 0, |
| 101 | cache: { read: 0, write: 0 }, |
| 102 | }, |
| 103 | } as unknown as SessionV1.Assistant |
| 104 | } |
| 105 | |
| 106 | function basePart(messageID: string, id: string) { |
| 107 | return { |