File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
ai-assistant/src/core/services/llm Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ export class Llama3_70B implements ILLMModel {
3636 return message ;
3737 }
3838
39+ /**
40+ * Asynchronously asks a prompt and returns the response.
41+ *
42+ * @param {Prompt } prompt - The prompt to ask.
43+ * @returns {Promise<string | null> } A promise that resolves with the response string or null if no response is available.
44+ */
3945 async ask ( prompt : Prompt ) : Promise < string | null > {
4046 // return await this.fromHuggingFace(prompt);
4147
Original file line number Diff line number Diff line change 11import { Prompt } from "../../prompt" ;
22
33export interface ILLMModel {
4+ /**
5+ * Asynchronously asks a prompt and returns the response.
6+ *
7+ * @param {Prompt } prompt - The prompt to ask.
8+ * @returns {Promise<string | null> } A promise that resolves with the response string or null if no response is available.
9+ */
410 ask ( prompt : Prompt ) : Promise < string | null > ;
511}
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ export class Mistral_7B implements ILLMModel {
1212 this . http = http ;
1313 }
1414
15+ /**
16+ * Asynchronously sends a prompt to the server and retrieves a response.
17+ * @param {Prompt } prompt - The prompt object containing the messages to send.
18+ * @returns {Promise<string | null> } A promise that resolves to the response message or null if no response is received.
19+ */
1520 async ask ( prompt : Prompt ) : Promise < string | null > {
1621 const url = `${ this . baseURL } /chat/completions` ;
1722 const res = await this . http . post ( url , {
You can’t perform that action at this time.
0 commit comments