import { PromptMixin } from "../prompts/Mixin.js";
function wrapChoice(choice) {
    if (typeof choice === "string") {
        return {
            description: choice
        };
    } else {
        return choice;
    }
}
function wrapQuery(query) {
    if (typeof query === "string") {
        return {
            queryStr: query
        };
    }
    return query;
}
export class BaseSelector extends PromptMixin {
    async select(choices, query) {
        const metadatas = choices.map((choice)=>wrapChoice(choice));
        const queryBundle = wrapQuery(query);
        return await this._select(metadatas, queryBundle);
    }
}
