Skip to content

Commit

Permalink
fix set config async (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
drf7 authored Dec 18, 2024
1 parent e25d8b1 commit fe8e4fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 4.3.11 (unreleased)


- Nothing changed yet.
- Fix async nua `set_config`


## 4.3.10 (2024-12-17)
Expand Down
10 changes: 5 additions & 5 deletions nuclia/lib/nua.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ async def _stream(
async def add_config_predict(
self, kbid: str, config: LearningConfigurationCreation
):
endpoint = f"{CONFIG}/{kbid}"
endpoint = f"{self.url}{CONFIG}/{kbid}"
await self._request(
"GET", endpoint, payload=config.dict(exclude_none=True), output=Empty
"POST", endpoint, payload=config.dict(exclude_none=True), output=Empty
)

async def del_config_predict(self, kbid: str):
Expand All @@ -433,15 +433,15 @@ async def del_config_predict(self, kbid: str):
async def update_config_predict(
self, kbid: str, config: LearningConfigurationUpdate
):
endpoint = f"{CONFIG}/{kbid}"
endpoint = f"{self.url}{CONFIG}/{kbid}"
await self._request(
"POST", endpoint, payload=config.dict(exclude_none=True), output=Empty
)

async def schema_predict(self, kbid: Optional[str] = None) -> ConfigSchema:
endpoint = f"{SCHEMA}"
endpoint = f"{self.url}{SCHEMA}"
if kbid is not None:
endpoint = f"{SCHEMA_KBID}/{kbid}"
endpoint = f"{self.url}{SCHEMA_KBID}/{kbid}"
return await self._request("GET", endpoint, output=ConfigSchema) # type: ignore

async def config_predict(
Expand Down

0 comments on commit fe8e4fc

Please sign in to comment.