mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 18:01:46 +00:00
fix(discord): avoid bundling pi-ai runtime deps
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Api, Model } from "@mariozechner/pi-ai";
|
||||
import { complete, type Api, type Model } from "@mariozechner/pi-ai";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveAgentDir, resolveAgentEffectiveModelPrimary } from "./agent-scope.js";
|
||||
import { DEFAULT_PROVIDER } from "./defaults.js";
|
||||
@@ -231,3 +231,15 @@ export async function prepareSimpleCompletionModelForAgent(params: {
|
||||
auth: prepared.auth,
|
||||
};
|
||||
}
|
||||
|
||||
export async function completeWithPreparedSimpleCompletionModel(params: {
|
||||
model: Model<Api>;
|
||||
auth: ResolvedProviderAuth;
|
||||
context: Parameters<typeof complete>[1];
|
||||
options?: Omit<Parameters<typeof complete>[2], "apiKey">;
|
||||
}) {
|
||||
return await complete(params.model, params.context, {
|
||||
...params.options,
|
||||
apiKey: params.auth.apiKey,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user