mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
feat: allows ollama usage
Fix https://github.com/Codium-ai/pr-agent/issues/657
This commit is contained in:
@ -61,6 +61,9 @@ class LiteLLMAIHandler(BaseAiHandler):
|
|||||||
if get_settings().get("HUGGINGFACE.API_BASE", None) and 'huggingface' in get_settings().config.model:
|
if get_settings().get("HUGGINGFACE.API_BASE", None) and 'huggingface' in get_settings().config.model:
|
||||||
litellm.api_base = get_settings().huggingface.api_base
|
litellm.api_base = get_settings().huggingface.api_base
|
||||||
self.api_base = get_settings().huggingface.api_base
|
self.api_base = get_settings().huggingface.api_base
|
||||||
|
if get_settings().get("OLLAMA.API_BASE", None) :
|
||||||
|
litellm.api_base = get_settings().ollama.api_base
|
||||||
|
self.api_base = get_settings().ollama.api_base
|
||||||
if get_settings().get("HUGGINGFACE.REPITITION_PENALTY", None):
|
if get_settings().get("HUGGINGFACE.REPITITION_PENALTY", None):
|
||||||
self.repetition_penalty = float(get_settings().huggingface.repetition_penalty)
|
self.repetition_penalty = float(get_settings().huggingface.repetition_penalty)
|
||||||
if get_settings().get("VERTEXAI.VERTEX_PROJECT", None):
|
if get_settings().get("VERTEXAI.VERTEX_PROJECT", None):
|
||||||
@ -150,4 +153,4 @@ class LiteLLMAIHandler(BaseAiHandler):
|
|||||||
if get_settings().config.verbosity_level >= 2:
|
if get_settings().config.verbosity_level >= 2:
|
||||||
get_logger().info(f"\nAI response:\n{resp}")
|
get_logger().info(f"\nAI response:\n{resp}")
|
||||||
|
|
||||||
return resp, finish_reason
|
return resp, finish_reason
|
||||||
|
Reference in New Issue
Block a user