This PR introduces the concept of "LlmModel" as a new way to quickly add new LLM models without making any code changes. We are releasing this first version and will add incremental improvements, so expect changes. The AI Bot can't fully take advantage of this feature as users are hard-coded. We'll fix this in a separate PR.s
21 lines
375 B
JavaScript
21 lines
375 B
JavaScript
import RestModel from "discourse/models/rest";
|
|
|
|
export default class AiLlm extends RestModel {
|
|
createProperties() {
|
|
return this.getProperties(
|
|
"display_name",
|
|
"name",
|
|
"provider",
|
|
"tokenizer",
|
|
"max_prompt_tokens"
|
|
);
|
|
}
|
|
|
|
updateProperties() {
|
|
const attrs = this.createProperties();
|
|
attrs.id = this.id;
|
|
|
|
return attrs;
|
|
}
|
|
}
|