Skip to content

Commit

Permalink
fix(knext): fix knext client (#230)
Browse files Browse the repository at this point in the history
* fix knext client

* x
  • Loading branch information
zhuzhongshu123 authored Jan 7, 2025
1 parent 35b1135 commit 57c5aad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kag/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def load_config(prod: bool = False):
if prod:
project_id = os.getenv(KAGConstants.ENV_KAG_PROJECT_ID)
host_addr = os.getenv(KAGConstants.ENV_KAG_PROJECT_HOST_ADDR)
project_client = ProjectClient(host_addr=host_addr)
project_client = ProjectClient(host_addr=host_addr, project_id=project_id)
project = project_client.get_by_id(project_id)
config = json.loads(project.config)
if "project" not in config:
Expand Down
5 changes: 3 additions & 2 deletions knext/common/base/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from abc import ABC

from knext.common import rest
from knext.common.env import env


class Client(ABC):
Expand All @@ -39,8 +40,8 @@ def __init__(self, host_addr: str = None, project_id: str = None):
host_addr (str): The address of the component server. If not provided, the value from the environment variable `KAG_PROJECT_HOST_ADDR` is used.
project_id (int): The ID of the user's project. If not provided, the value from the environment variable `KAG_PROJECT_ID` is used.
"""
self._host_addr = host_addr
self._project_id = project_id
self._host_addr = host_addr or env.host_addr
self._project_id = project_id or env.id

@staticmethod
def serialize(obj):
Expand Down

0 comments on commit 57c5aad

Please sign in to comment.