Reformatting, fixing tests, adding basic RAG pipeline implementation

This commit is contained in:
Alex Selimov 2025-07-05 15:16:18 -04:00
parent a6cdbf1761
commit 24bfef99a2
12 changed files with 721 additions and 131 deletions

View file

@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from pathlib import Path
from typing import List
@ -7,9 +7,12 @@ from typing import List
class OllamaConfig:
"""Configuration for Ollama client."""
model: str
chat_model: str
embedding_model: str
base_url: str
system_prompt: str
# TODO: Update this to be a passed in value
temperature: float = field(default=0.7)
@dataclass(frozen=True)
@ -22,10 +25,20 @@ class ReviewConfig:
def create_ollama_config(
model: str, server_url: str, system_prompt: str
model: str,
server_url: str,
system_prompt: str,
temperature=0.7,
embedding_model="nomic-embed-text",
) -> OllamaConfig:
"""Create OllamaConfig with validated parameters."""
return OllamaConfig(model=model, base_url=server_url, system_prompt=system_prompt)
return OllamaConfig(
chat_model=model,
embedding_model=embedding_model,
base_url=server_url,
system_prompt=system_prompt,
temperature=temperature,
)
def create_review_config(
@ -43,7 +56,7 @@ def create_config_from_vars(
base_branch: str,
):
ollama_config = OllamaConfig(
model=model, base_url=server_url, system_prompt=system_prompt
chat_model=model, base_url=server_url, system_prompt=system_prompt
)
return create_review_config(paths, ollama_config, base_branch)