Skip to content

Commit 76523ef

Browse files
committed
Added JSDoc documentation for LLM services
1 parent cf9683a commit 76523ef

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

ai-assistant/src/core/services/llm/llama3_70B.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { Prompt } from "../../prompt";
22

33
export 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
}

ai-assistant/src/core/services/llm/mistral_7b.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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, {

0 commit comments

Comments
 (0)