Update Continue.ts
This commit is contained in:
parent
48bc95bd8c
commit
2a51fc1cb2
1 changed files with 8 additions and 2 deletions
|
|
@ -40,6 +40,7 @@ export class Continue {
|
|||
*/
|
||||
static async from(options: ContinueClientOptions): Promise<ContinueResult> {
|
||||
const baseURL = options.baseURL || "https://api.continue.dev/";
|
||||
|
||||
const api = new DefaultApi(
|
||||
new Configuration({
|
||||
basePath: baseURL,
|
||||
|
|
@ -55,13 +56,18 @@ export class Continue {
|
|||
};
|
||||
}
|
||||
|
||||
const { ownerSlug, packageSlug } = decodePackageSlug(options.assistant);
|
||||
if (!ownerSlug || !packageSlug) {
|
||||
throw new Error(
|
||||
`Invalid assistant identifier: ${options.assistant}. Expected format: owner-slug/package-slug`,
|
||||
);
|
||||
}
|
||||
|
||||
const assistants = await api.listAssistants({
|
||||
organizationId: options.organizationId,
|
||||
alwaysUseProxy: "true",
|
||||
});
|
||||
|
||||
const { ownerSlug, packageSlug } = decodePackageSlug(options.assistant);
|
||||
|
||||
const assistantRes = assistants.find(
|
||||
(a) => a.ownerSlug === ownerSlug && a.packageSlug === packageSlug,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue