添加模型支持,更新提示功能以接收模型参数
This commit is contained in:
@@ -12,6 +12,11 @@ export type RuntimeHealth = {
|
||||
version: string;
|
||||
};
|
||||
|
||||
type RuntimeModelOverride = {
|
||||
providerID: string;
|
||||
modelID: string;
|
||||
};
|
||||
|
||||
export class OpencodeRuntimeAdapter {
|
||||
private clientPromise: Promise<OpencodeClient> | null = null;
|
||||
private closeServer: (() => void) | null = null;
|
||||
@@ -52,10 +57,11 @@ export class OpencodeRuntimeAdapter {
|
||||
return this.messages(sessionId);
|
||||
}
|
||||
|
||||
async prompt(sessionId: string, text: string) {
|
||||
async prompt(sessionId: string, text: string, model?: RuntimeModelOverride) {
|
||||
const client = await this.ensureClient();
|
||||
await client.session.prompt({
|
||||
sessionID: sessionId,
|
||||
model,
|
||||
parts: [{ type: "text", text }],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user