Skip to content

Commit aac3eef

Browse files
committed
fix docstring consistency to match SDK standards
1 parent fee519d commit aac3eef

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

meilisearch/client.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -804,20 +804,31 @@ def create_chat_completion(
804804
) -> Iterator[Dict[str, Any]]:
805805
"""Streams a chat completion from the Meilisearch chat API.
806806
807-
Parameters:
808-
workspace_uid: Unique identifier of the chat workspace to use.
809-
messages: List of message dicts (e.g. {"role": "user", "content": "..."}) comprising the chat history.
810-
model: The model name to use for completion (should correspond to the LLM in workspace settings).
811-
stream: Whether to stream the response. Must be True for now (only streaming is supported).
807+
Parameters
808+
----------
809+
workspace_uid:
810+
Unique identifier of the chat workspace to use.
811+
messages:
812+
List of message dicts (e.g. {"role": "user", "content": "..."}) comprising the chat history.
813+
model:
814+
The model name to use for completion (should correspond to the LLM in workspace settings).
815+
stream:
816+
Whether to stream the response. Must be True for now (only streaming is supported).
812817
813-
Returns:
818+
Returns
819+
-------
820+
chunks:
814821
Parsed chunks of the completion as Python dicts. Each chunk is a partial response (in OpenAI format).
815822
Iteration ends when the completion is done.
816823
817-
Raises:
818-
MeilisearchApiError: If the API returns an error (e.g., invalid workspace or parameters).
819-
MeilisearchCommunicationError: If a network error occurs.
820-
ValueError: If stream=False is passed (not currently supported).
824+
Raises
825+
------
826+
MeilisearchApiError
827+
An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors
828+
MeilisearchCommunicationError
829+
If a network error occurs.
830+
ValueError
831+
If stream=False is passed (not currently supported).
821832
"""
822833
if not stream:
823834
# The API currently only supports streaming responses:
@@ -862,18 +873,18 @@ def get_chat_workspaces(
862873
offset: Optional[int] = None,
863874
limit: Optional[int] = None,
864875
) -> Dict[str, Any]:
865-
"""Return the list of chat workspaces (paginated).
876+
"""Get all chat workspaces.
866877
867878
Parameters
868879
----------
869-
offset (optional): int
880+
offset (optional):
870881
Number of workspaces to skip.
871-
limit (optional): int
882+
limit (optional):
872883
Maximum number of workspaces to return.
873884
874885
Returns
875886
-------
876-
dict:
887+
workspaces:
877888
Dictionary containing the list of chat workspaces and pagination information.
878889
879890
Raises

0 commit comments

Comments
 (0)