Create a text splitter
POST/text-splitters
Creates a text splitter: a configured instance of a text splitter provider, with parameters. A text splitter has no name, and a deployment can hold several text splitters of the same provider. Before storing the text splitter, Foundation4 splits a test string with the provider, so the request fails when the provider does not accept the parameters. After creation, only description can change.
Permissions. Write on the text-splitters object type and write on the text splitter provider that provider names.
Embedding models and text splitters shows example requests, and Providers and models lists the parameters of each provider.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 500
The text splitter was created. The body is the new text splitter.
The request is invalid (Invalid parameter), and details.error names the cause: an unknown provider name or a parameter that the provider does not accept.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
The key lacks write permission on the text-splitters object type (Unauthorized: access level AccessLevel(WRITE) required for Text Splitter with id None). The same status reports a license that is not valid (Invalid license: <reason>) and a reached license limit (License limits exceeded for Text Splitter).
The key lacks write permission on the text splitter provider that provider names (Text Splitter not found).
The provider failed while splitting the test string, for example because a parameter value is invalid or the gRPC service is unreachable (Internal error). details.error holds the cause.