14 lines
346 B
Python
14 lines
346 B
Python
"""Shared pipeline configuration helpers."""
|
|
|
|
import os
|
|
|
|
_OLLAMA_DEFAULT = "http://127.0.0.1:11434/api/generate"
|
|
_OLLAMA_PATH = "/api/generate"
|
|
|
|
|
|
def resolve_ollama_url(raw: str) -> str:
|
|
"""Ensure the Ollama URL always ends with the API path."""
|
|
if raw.endswith(_OLLAMA_PATH):
|
|
return raw
|
|
return raw.rstrip("/") + _OLLAMA_PATH
|