mirror of
https://github.com/aldo-g/obsidian-llm-test.git
synced 2026-07-22 05:42:19 +00:00
60 lines
No EOL
1.1 KiB
TypeScript
60 lines
No EOL
1.1 KiB
TypeScript
/*
|
|
This file contains shared type definitions for the Obsidian RAG Test Plugin,
|
|
including types for LLM responses and generated tests.
|
|
*/
|
|
|
|
/**
|
|
* Represents the response structure from the LLM API.
|
|
*/
|
|
export interface LLMResponse {
|
|
data: any;
|
|
}
|
|
|
|
/**
|
|
* Represents a generated test question (and an optional answer) from the LLM.
|
|
*/
|
|
export interface GeneratedTest {
|
|
question: string;
|
|
answer?: string;
|
|
}
|
|
|
|
/**
|
|
* Represents the test status for a note.
|
|
*/
|
|
export interface TestStatus {
|
|
testsReady: boolean;
|
|
passed: number;
|
|
total: number;
|
|
}
|
|
|
|
/**
|
|
* Represents an indexed note with its file path, content, and test status.
|
|
*/
|
|
export interface IndexedNote {
|
|
filePath: string;
|
|
content: string;
|
|
testStatus: TestStatus;
|
|
}
|
|
|
|
/**
|
|
* Shared type definitions for indexed notes and LLM responses.
|
|
*/
|
|
|
|
export interface LLMResponse {
|
|
id: string;
|
|
object: string;
|
|
created: number;
|
|
model: string;
|
|
choices: {
|
|
index: number;
|
|
message: {
|
|
role: string;
|
|
content: string;
|
|
};
|
|
}[];
|
|
usage: {
|
|
prompt_tokens: number;
|
|
completion_tokens: number;
|
|
total_tokens: number;
|
|
};
|
|
} |