You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-6Lines changed: 1 addition & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,19 +108,14 @@ Some notes on GitHub PRs:
108
108
109
109
-[Convert your PR as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) if your changes are a work in progress: no one will review it until you pass your PR as ready for review.<br>
110
110
The draft PR can be very useful if you want to show that you are working on something and make your work visible.
111
-
- The branch related to the PR must be **up-to-date with `main`** before merging. Fortunately, this project [integrates a bot](https://github.com/meilisearch/integration-guides/blob/main/resources/bors.md) to automatically enforce this requirement without the PR author having to do it manually.
111
+
- The branch related to the PR must be **up-to-date with `main`** before merging.
112
112
- All PRs must be reviewed and approved by at least one maintainer.
113
113
- The PR title should be accurate and descriptive of the changes. The title of the PR will be indeed automatically added to the next [release changelogs](https://github.com/meilisearch/meilisearch-python/releases/).
114
114
115
115
## Release Process (for the internal team only)
116
116
117
117
Meilisearch tools follow the [Semantic Versioning Convention](https://semver.org/).
118
118
119
-
### Automation to Rebase and Merge the PRs <!-- omit in toc -->
120
-
121
-
This project integrates a bot that helps us manage pull requests merging.<br>
122
-
_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/resources/bors.md)._
123
-
124
119
### Automated Changelogs <!-- omit in toc -->
125
120
126
121
This project integrates a tool to create automated changelogs.<br>
"""Streams a chat completion from the Meilisearch chat API.
824
+
825
+
Parameters
826
+
----------
827
+
workspace_uid:
828
+
Unique identifier of the chat workspace to use.
829
+
messages:
830
+
List of message dicts (e.g. {"role": "user", "content": "..."}) comprising the chat history.
831
+
model:
832
+
The model name to use for completion (should correspond to the LLM in workspace settings).
833
+
stream:
834
+
Whether to stream the response. Must be True for now (only streaming is supported).
835
+
836
+
Returns
837
+
-------
838
+
chunks:
839
+
Parsed chunks of the completion as Python dicts. Each chunk is a partial response (in OpenAI format).
840
+
Iteration ends when the completion is done.
841
+
842
+
Raises
843
+
------
844
+
MeilisearchApiError
845
+
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
846
+
MeilisearchCommunicationError
847
+
If a network error occurs.
848
+
ValueError
849
+
If stream=False is passed (not currently supported), or if workspace_uid is empty or contains path separators.
850
+
"""
851
+
ifnotstream:
852
+
# The API currently only supports streaming responses:
853
+
raiseValueError("Non-streaming chat completions are not supported. Use stream=True.")
854
+
855
+
# Basic security validation (only what's needed)
856
+
ifnotworkspace_uid:
857
+
raiseValueError("workspace_uid is required and cannot be empty")
858
+
if"/"inworkspace_uidor"\\"inworkspace_uid:
859
+
raiseValueError("Invalid workspace_uid: must not contain path separators")
Dictionary containing the list of chat workspaces and pagination information.
910
+
911
+
Raises
912
+
------
913
+
MeilisearchApiError
914
+
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
"""Get the settings for a specific chat workspace.
926
+
927
+
Parameters
928
+
----------
929
+
workspace_uid:
930
+
Unique identifier of the chat workspace.
931
+
932
+
Returns
933
+
-------
934
+
settings:
935
+
Dictionary containing the workspace settings.
936
+
937
+
Raises
938
+
------
939
+
MeilisearchApiError
940
+
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
941
+
ValueError
942
+
If workspace_uid is empty or contains path separators.
943
+
"""
944
+
# Basic security validation (only what's needed)
945
+
ifnotworkspace_uid:
946
+
raiseValueError("workspace_uid is required and cannot be empty")
947
+
if"/"inworkspace_uidor"\\"inworkspace_uid:
948
+
raiseValueError("Invalid workspace_uid: must not contain path separators")
"""Update the settings for a specific chat workspace.
956
+
957
+
Parameters
958
+
----------
959
+
workspace_uid:
960
+
Unique identifier of the chat workspace.
961
+
settings:
962
+
Dictionary containing the settings to update.
963
+
964
+
Returns
965
+
-------
966
+
settings:
967
+
Dictionary containing the updated workspace settings.
968
+
969
+
Raises
970
+
------
971
+
MeilisearchApiError
972
+
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
973
+
ValueError
974
+
If workspace_uid is empty or contains path separators, or if settings is empty.
975
+
"""
976
+
# Basic security validation (only what's needed)
977
+
ifnotworkspace_uid:
978
+
raiseValueError("workspace_uid is required and cannot be empty")
979
+
if"/"inworkspace_uidor"\\"inworkspace_uid:
980
+
raiseValueError("Invalid workspace_uid: must not contain path separators")
0 commit comments