Skip to content

Commit e18dcb9

Browse files
review @GitHK
1 parent 910f649 commit e18dcb9

File tree

1 file changed

+3
-5
lines changed
  • services/web/server/src/simcore_service_webserver/chatbot

1 file changed

+3
-5
lines changed

services/web/server/src/simcore_service_webserver/chatbot/_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ def _chatbot_retry():
6161

6262

6363
class ChatbotRestClient:
64-
def __init__(self, base_url: str, chatbot_settings: ChatbotSettings) -> None:
64+
def __init__(self, chatbot_settings: ChatbotSettings) -> None:
6565
self._client = httpx.AsyncClient()
66-
self._base_url = base_url
6766
self._chatbot_settings = chatbot_settings
6867

6968
async def get_settings(self) -> dict[str, Any]:
7069
"""Fetches chatbot settings"""
71-
url = urljoin(f"{self._base_url}", "/v1/chat/settings")
70+
url = urljoin(f"{self._chatbot_settings.base_url}", "/v1/chat/settings")
7271

7372
@_chatbot_retry()
7473
async def _request() -> httpx.Response:
@@ -87,7 +86,7 @@ async def _request() -> httpx.Response:
8786

8887
async def ask_question(self, question: str) -> ChatResponse:
8988
"""Asks a question to the chatbot"""
90-
url = urljoin(f"{self._base_url}", "/v1/chat")
89+
url = urljoin(f"{self._chatbot_settings.base_url}", "/v1/chat")
9190

9291
@_chatbot_retry()
9392
async def _request() -> httpx.Response:
@@ -131,7 +130,6 @@ async def setup_chatbot_rest_client(app: web.Application) -> None:
131130
chatbot_settings = get_plugin_settings(app)
132131

133132
client = ChatbotRestClient(
134-
base_url=chatbot_settings.base_url,
135133
chatbot_settings=chatbot_settings,
136134
)
137135

0 commit comments

Comments
 (0)