Initial integration
- Clean up a few functions - Combine all components into a single pipeline
This commit is contained in:
parent
0bff803b91
commit
cb49495211
5 changed files with 103 additions and 39 deletions
|
@ -1,3 +1,4 @@
|
|||
import argparse
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
@ -48,15 +49,13 @@ def create_review_config(
|
|||
return ReviewConfig(paths=paths, ollama=ollama_config, base_branch=base_branch)
|
||||
|
||||
|
||||
def create_config_from_vars(
|
||||
paths: List[Path],
|
||||
model: str,
|
||||
server_url: str,
|
||||
system_prompt: str,
|
||||
base_branch: str,
|
||||
def namespace_to_config(
|
||||
namespace: argparse.Namespace
|
||||
):
|
||||
"""Transform argparse namespace into ReviewConfig."""
|
||||
paths = [Path(path_str) for path_str in namespace.paths]
|
||||
ollama_config = OllamaConfig(
|
||||
chat_model=model, base_url=server_url, system_prompt=system_prompt
|
||||
chat_model=namespace.model, base_url=namespace.server_url, system_prompt=namespace.system_prompt, embedding_model=namespace.embedding_model
|
||||
)
|
||||
|
||||
return create_review_config(paths, ollama_config, base_branch)
|
||||
return create_review_config(paths, ollama_config, namespace.base_branch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue