Skip to content

Commit

Permalink
Merge pull request #208 from Scale3-Labs/ali/url-fix
Browse files Browse the repository at this point in the history
fix api host
  • Loading branch information
alizenhom committed Jun 14, 2024
2 parents 15ac7a1 + 0bfb2a8 commit aa60509
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/langtrace_python_sdk/extensions/langtrace_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def __new__(cls, value):


class LangTraceFile(io.BytesIO):
_host: str = os.environ.get("LANGTRACE_API_HOST", None) or LANGTRACE_REMOTE_URL

def __init__(self, fs: "LangTraceFileSystem", path: str, mode: OpenMode):
super().__init__()
self.fs = fs
Expand Down Expand Up @@ -65,7 +67,7 @@ def upload_to_server(self, file_data: bytes) -> None:
else:
print(Fore.GREEN + "Sending results to Langtrace" + Fore.RESET)
response = requests.post(
url=f"{LANGTRACE_REMOTE_URL}/api/run",
url=f"{self._host}/api/run",
data=json.dumps(data),
headers={
"Content-Type": "application/json",
Expand All @@ -80,6 +82,7 @@ def upload_to_server(self, file_data: bytes) -> None:


class LangTraceFileSystem(AbstractFileSystem):
_host: str = os.environ.get("LANGTRACE_API_HOST", None) or LANGTRACE_REMOTE_URL
protocol = "langtracefs"
sep = "/"

Expand Down Expand Up @@ -112,7 +115,7 @@ def fetch_file_from_api(self, dataset_id: str) -> bytes:
+ Fore.RESET
)
response = requests.get(
url=f"{LANGTRACE_REMOTE_URL}/api/dataset/download?id={dataset_id}",
url=f"{self._host}/api/dataset/download?id={dataset_id}",
headers={
"Content-Type": "application/json",
"x-api-key": os.environ.get("LANGTRACE_API_KEY"),
Expand Down
2 changes: 1 addition & 1 deletion src/langtrace_python_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.19"
__version__ = "2.1.20"

0 comments on commit aa60509

Please sign in to comment.