Skip to content

Commit

Permalink
pyping
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Jun 15, 2024
1 parent d9b21b9 commit 0a5aadb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/processors/title_editor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import datetime, timedelta
import logging
import os
import pyping

from pytz import utc
from models.feed_article import FeedArticle
Expand All @@ -10,7 +11,7 @@
from langchain.output_parsers import ResponseSchema, StructuredOutputParser
# from langchain.callbacks.tracers import ConsoleCallbackHandler
from models.utils import calculate_sha1_hash
import pyping


logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand All @@ -20,7 +21,7 @@ class TitleEditor:
def __init__(self):
self.ollama_url = os.getenv('OLLAMA_URL')

self.ping_result = (pyping.ping('google.com').ret_code == 0)
self.ping_result = (pyping.ping(self.ollama_url).ret_code == 0)

if self.ollama_url and self.ping_result:
parser = StructuredOutputParser.from_response_schemas(
Expand Down

0 comments on commit 0a5aadb

Please sign in to comment.