Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/integration_tests/test_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def test_completions_temp0(logging_conf):
# 生成request_id
request_id = time.time()
print(f'request_id:{request_id}')
response = client.moderation.moderations.create(
model='moderation', input={'type': 'text', 'text': 'hello world '}
response = client.moderations.create(
model='moderations', input={'type': 'text', 'text': 'hello world '}
)
print(response)

Expand Down
2 changes: 1 addition & 1 deletion zhipuai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(
self.assistant = api_resource.Assistant(self)
self.web_search = api_resource.WebSearchApi(self)
self.audio = api_resource.audio.Audio(self)
self.moderation = api_resource.moderation.Moderation(self)
self.moderations = api_resource.moderation.Moderations(self)
self.agents = api_resource.agents.Agents(self)

@property
Expand Down
2 changes: 1 addition & 1 deletion zhipuai/api_resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
)

from .moderation import (
Moderation
Moderations
)

from .web_search import (
Expand Down
6 changes: 3 additions & 3 deletions zhipuai/api_resource/moderation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .moderation import (
Moderation
from .moderations import (
Moderations
)

__all__ = [
'Moderation'
'Moderations'
]
10 changes: 0 additions & 10 deletions zhipuai/api_resource/moderation/moderation.py

This file was deleted.

2 changes: 1 addition & 1 deletion zhipuai/api_resource/moderation/moderations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if TYPE_CHECKING:
from ..._client import ZhipuAI


__all__ = ["Moderations"]
class Moderations(BaseAPI):
def __init__(self, client: "ZhipuAI") -> None:
super().__init__(client)
Expand Down