Skip to content

Commit

Permalink
feat: re-added is_up which was lost for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserRuben committed Aug 14, 2024
1 parent 66eec00 commit aa5c9c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ai/LLM/Strategies/OLLAMAService.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@

logger = logging.getLogger(__name__)

def is_up() -> bool:
# res = requests.post(os.getenv('OLLAMA_URL') + '/api/show', json={'name': os.getenv('OLLAMA_MODEL', 'llama3')})
res = httpx.post(
config.ollama_url + "/api/show",
json={"name": config.ollama_model},
)
if res.status_code == 200:
return True


class OLLAMAService(BaseLLMService, LLMServiceMixin):
def __init__(
Expand Down

0 comments on commit aa5c9c0

Please sign in to comment.