Skip to content

Commit

Permalink
refactor: rename get -> retrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed Sep 25, 2024
1 parent d082073 commit 0862582
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cozepy/bot/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(self, base_url: str, auth: Auth, requester: Requester):
self._auth = auth
self._requester = requester

def get_online_info(self, *, bot_id: str) -> Bot:
def retrieve(self, *, bot_id: str) -> Bot:
"""
Get the configuration information of the bot, which must have been published
to the Bot as API channel.
Expand Down
2 changes: 1 addition & 1 deletion cozepy/chat/v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def create(

return ChatIterator(self._requester.request("post", url, Chat, body=body, stream=stream))

def get(
def retrieve(
self,
*,
conversation_id: str,
Expand Down
2 changes: 1 addition & 1 deletion cozepy/conversation/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create(self, *, messages: List[Message] = None, meta_data: Dict[str, str] =
}
return self._requester.request("post", url, Conversation, body=body)

def get(self, *, conversation_id: str) -> Conversation:
def retrieve(self, *, conversation_id: str) -> Conversation:
"""
Get the information of specific conversation.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_bot_v1_list(self):
assert res.has_more
assert len(res.items) > 1

def test_bot_v1_get_online_info(self):
def test_bot_v1_retrieve(self):
bot_id = self.bot_id

cli_list = [
Expand All @@ -31,7 +31,7 @@ def test_bot_v1_get_online_info(self):
Coze(auth=jwt_auth, base_url=COZE_CN_BASE_URL),
]
for cli in cli_list:
bot = cli.bot.v1.get_online_info(bot_id=bot_id)
bot = cli.bot.v1.retrieve(bot_id=bot_id)
assert bot is not None
assert bot.bot_id == bot_id

Expand Down

0 comments on commit 0862582

Please sign in to comment.