feat(devgen): add Ollama provider and host configuration
Add support for the Ollama provider in the AI generation pipeline and expose a configurable host address. New Features: - Introduce `ollama` as a selectable provider. - Add `ollama_host` configuration option with default `http://localhost:11434`. Enhancements: - Extend provider list in error message to include Ollama.
This commit is contained in:
2 files changed
+3
-1
No files matched your search
+2
-1
@@ -24,7 +24,8 @@ def generate_with_ai(
|
|||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
f"Provider `{provider}` is not a built-in module: {e}. "
|
f"Provider `{provider}` is not a built-in module: {e}. "
|
||||||
f"Available providers: gemini, openai, anthropic, huggingface, openrouter."
|
f"Available providers: gemini, openai, anthropic, huggingface, "
|
||||||
|
f"openrouter, ollama."
|
||||||
) from e
|
) from e
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ def load_config() -> Dict[str, Any]:
|
|||||||
"api_key": "",
|
"api_key": "",
|
||||||
"emoji": True,
|
"emoji": True,
|
||||||
"max_groups": 5,
|
"max_groups": 5,
|
||||||
|
"ollama_host": "http://localhost:11434",
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
with config_path.open("w", encoding="utf-8") as f:
|
with config_path.open("w", encoding="utf-8") as f:
|
||||||
|
|||||||
Reference in new issue
Block a user