feat(#59): implement wiki-link parser
- Created wiki-link-parser.ts utility for parsing [[links]] syntax - Supports multiple formats: [[Page Name]], [[Page|display]], [[slug]] - Returns parsed links with target, display text, and position info - Handles edge cases: nested brackets, escaped brackets, code blocks - Code block awareness: skips links in inline code, fenced blocks, and indented code - Comprehensive test suite with 43 passing tests (100% coverage) - Updated README.md with parser documentation Implements KNOW-007 (Issue #59) - Wiki-style linking foundation
This commit is contained in:
59
apps/api/src/ollama/dto/index.ts
Normal file
59
apps/api/src/ollama/dto/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* DTOs for Ollama module
|
||||
*/
|
||||
|
||||
export interface GenerateOptionsDto {
|
||||
temperature?: number;
|
||||
top_p?: number;
|
||||
max_tokens?: number;
|
||||
stop?: string[];
|
||||
stream?: boolean;
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
role: 'system' | 'user' | 'assistant';
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface ChatOptionsDto {
|
||||
temperature?: number;
|
||||
top_p?: number;
|
||||
max_tokens?: number;
|
||||
stop?: string[];
|
||||
stream?: boolean;
|
||||
}
|
||||
|
||||
export interface GenerateResponseDto {
|
||||
response: string;
|
||||
model: string;
|
||||
done: boolean;
|
||||
}
|
||||
|
||||
export interface ChatResponseDto {
|
||||
message: ChatMessage;
|
||||
model: string;
|
||||
done: boolean;
|
||||
}
|
||||
|
||||
export interface EmbedResponseDto {
|
||||
embedding: number[];
|
||||
}
|
||||
|
||||
export interface OllamaModel {
|
||||
name: string;
|
||||
modified_at: string;
|
||||
size: number;
|
||||
digest: string;
|
||||
}
|
||||
|
||||
export interface ListModelsResponseDto {
|
||||
models: OllamaModel[];
|
||||
}
|
||||
|
||||
export interface HealthCheckResponseDto {
|
||||
status: 'healthy' | 'unhealthy';
|
||||
mode: 'local' | 'remote';
|
||||
endpoint: string;
|
||||
available: boolean;
|
||||
error?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user