mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-23 01:49:58 +00:00
feat(core): Multiple ways to run dbgpts (#1734)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""This module contains the client for the DB-GPT API."""
|
||||
|
||||
import atexit
|
||||
import json
|
||||
import os
|
||||
@@ -102,6 +103,15 @@ class Client:
|
||||
)
|
||||
atexit.register(self.close)
|
||||
|
||||
def _base_url(self):
|
||||
parsed_url = urlparse(self._api_url)
|
||||
host = parsed_url.hostname
|
||||
scheme = parsed_url.scheme
|
||||
port = parsed_url.port
|
||||
if port:
|
||||
return f"{scheme}://{host}:{port}"
|
||||
return f"{scheme}://{host}"
|
||||
|
||||
async def chat(
|
||||
self,
|
||||
model: str,
|
||||
|
Reference in New Issue
Block a user