Skip to content

Commit 974d7fc

Browse files
cao-junchaocaojunchao
andauthored
bugfix fix moderation path (#80)
* fix moderation 路径 * fix moderation 路径 --------- Co-authored-by: caojunchao <[email protected]>
1 parent b20509d commit 974d7fc

File tree

6 files changed

+8
-18
lines changed

6 files changed

+8
-18
lines changed

tests/integration_tests/test_moderation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def test_completions_temp0(logging_conf):
1313
# 生成request_id
1414
request_id = time.time()
1515
print(f'request_id:{request_id}')
16-
response = client.moderation.moderations.create(
17-
model='moderation', input={'type': 'text', 'text': 'hello world '}
16+
response = client.moderations.create(
17+
model='moderations', input={'type': 'text', 'text': 'hello world '}
1818
)
1919
print(response)
2020

zhipuai/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767
self.assistant = api_resource.Assistant(self)
6868
self.web_search = api_resource.WebSearchApi(self)
6969
self.audio = api_resource.audio.Audio(self)
70-
self.moderation = api_resource.moderation.Moderation(self)
70+
self.moderations = api_resource.moderation.Moderations(self)
7171
self.agents = api_resource.agents.Agents(self)
7272

7373
@property

zhipuai/api_resource/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
)
3939

4040
from .moderation import (
41-
Moderation
41+
Moderations
4242
)
4343

4444
from .web_search import (
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from .moderation import (
2-
Moderation
1+
from .moderations import (
2+
Moderations
33
)
44

55
__all__ = [
6-
'Moderation'
6+
'Moderations'
77
]

zhipuai/api_resource/moderation/moderation.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

zhipuai/api_resource/moderation/moderations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ..._client import ZhipuAI
1414

15-
15+
__all__ = ["Moderations"]
1616
class Moderations(BaseAPI):
1717
def __init__(self, client: "ZhipuAI") -> None:
1818
super().__init__(client)

0 commit comments

Comments
 (0)