diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 897c0f0..e06ad0c 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: c75567cf-9def-4617-8ae7-65af6f367b68 management: - docChecksum: b257fe397b830f66ca9655441beb6bbb + docChecksum: 552d84cd05ab94ffe7766e00a1642d41 docVersion: 2.0.0 speakeasyVersion: 1.570.2 generationVersion: 2.638.5 - releaseVersion: 1.0.0 - configChecksum: 5c696518717cf88e97b25602d10ac86a + releaseVersion: 1.0.3 + configChecksum: f8263b93221ce3b52c95e02f71d7f53d features: python: additionalDependencies: 1.0.0 @@ -48,7 +48,7 @@ generatedFiles: - docs/errors/notfounderror.md - docs/errors/requestvalidationerror.md - docs/errors/unauthorizederror.md - - docs/models/addknowledgeknowledgebaseidindexpostrequest.md + - docs/models/addknowledgeknowledgebaseidaddpostrequest.md - docs/models/addrequest.md - docs/models/annotation.md - docs/models/annotationurlcitation.md @@ -143,7 +143,6 @@ generatedFiles: - docs/models/examplein.md - docs/models/file.md - docs/models/filefile.md - - docs/models/fileprocessconfiguration.md - docs/models/filter_.md - docs/models/finishreason.md - docs/models/functioncallconfiguration.md @@ -213,7 +212,6 @@ generatedFiles: - docs/models/paginatedresponselistspanmetricsresponse.md - docs/models/paginatedresponselisttracesresponse.md - docs/models/payload.md - - docs/models/pdfprocessorname.md - docs/models/prompttokensdetails.md - docs/models/querydatasetentriesdatasetsdatasetidentriesquerypostrequest.md - docs/models/querydatasetentriesresponse.md @@ -243,6 +241,7 @@ generatedFiles: - docs/models/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md - docs/models/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostresponse.md - docs/models/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostresponsebody.md + - docs/models/textprocessingconfiguration.md - docs/models/tmodel.md - docs/models/tmodel1.md - docs/models/toplogprob.md @@ -311,7 +310,7 @@ generatedFiles: - src/opperai/knowledge.py - src/opperai/language_models.py - src/opperai/models/__init__.py - - src/opperai/models/add_knowledge_knowledge_base_id_index_postop.py + - src/opperai/models/add_knowledge_knowledge_base_id_add_postop.py - src/opperai/models/addrequest.py - src/opperai/models/annotation.py - src/opperai/models/annotationurlcitation.py @@ -376,7 +375,6 @@ generatedFiles: - src/opperai/models/examplein.py - src/opperai/models/file.py - src/opperai/models/filefile.py - - src/opperai/models/fileprocessconfiguration.py - src/opperai/models/filter_.py - src/opperai/models/function_output.py - src/opperai/models/function_stream_call_stream_postop.py @@ -439,7 +437,6 @@ generatedFiles: - src/opperai/models/paginatedresponse_listlanguagemodelsresponse_.py - src/opperai/models/paginatedresponse_listspanmetricsresponse_.py - src/opperai/models/paginatedresponse_listtracesresponse_.py - - src/opperai/models/pdfprocessorname.py - src/opperai/models/prompttokensdetails.py - src/opperai/models/query_dataset_entries_datasets_dataset_id_entries_query_postop.py - src/opperai/models/query_knowledge_base_knowledge_knowledge_base_id_query_postop.py @@ -462,6 +459,7 @@ generatedFiles: - src/opperai/models/spanschema.py - src/opperai/models/stream_function_functions_function_id_call_stream_postop.py - src/opperai/models/stream_function_revision_functions_function_id_call_stream_revision_id_postop.py + - src/opperai/models/textprocessingconfiguration.py - src/opperai/models/tmodel.py - src/opperai/models/toplogprob.py - src/opperai/models/update_custom_model_models_custom_model_id_patchop.py @@ -584,7 +582,6 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/examplein.go - tests/mockserver/internal/sdk/models/components/file.go - tests/mockserver/internal/sdk/models/components/filefile.go - - tests/mockserver/internal/sdk/models/components/fileprocessconfiguration.go - tests/mockserver/internal/sdk/models/components/filter.go - tests/mockserver/internal/sdk/models/components/functioncallconfiguration.go - tests/mockserver/internal/sdk/models/components/functioncallinput.go @@ -627,7 +624,6 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/paginatedresponselistlanguagemodelsresponse.go - tests/mockserver/internal/sdk/models/components/paginatedresponselistspanmetricsresponse.go - tests/mockserver/internal/sdk/models/components/paginatedresponselisttracesresponse.go - - tests/mockserver/internal/sdk/models/components/pdfprocessorname.go - tests/mockserver/internal/sdk/models/components/prompttokensdetails.go - tests/mockserver/internal/sdk/models/components/querydatasetentriesresponse.go - tests/mockserver/internal/sdk/models/components/queryknowledgebaserequest.go @@ -644,6 +640,7 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/spandata.go - tests/mockserver/internal/sdk/models/components/spanmetricdata.go - tests/mockserver/internal/sdk/models/components/spanschema.go + - tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go - tests/mockserver/internal/sdk/models/components/tmodel.go - tests/mockserver/internal/sdk/models/components/toplogprob.go - tests/mockserver/internal/sdk/models/components/updatecustommodelrequest.go @@ -659,7 +656,7 @@ generatedFiles: - tests/mockserver/internal/sdk/models/components/websearchoptions.go - tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocation.go - tests/mockserver/internal/sdk/models/components/websearchoptionsuserlocationapproximate.go - - tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidindexpost.go + - tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go - tests/mockserver/internal/sdk/models/operations/callfunctionfunctionsfunctionidcallpost.go - tests/mockserver/internal/sdk/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.go - tests/mockserver/internal/sdk/models/operations/chatcompletionsopenaichatcompletionspost.go @@ -997,7 +994,7 @@ examples: path: span_id: "77b258a2-45c1-4b87-a50c-9116bc8ed1d6" requestBody: - application/json: {"name": "my span", "start_time": "2025-06-27T08:51:47.800056Z", "type": "email_tool", "end_time": "2025-06-27T08:51:47.800118Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} + application/json: {"name": "my span", "start_time": "2025-06-27T11:37:21.302644Z", "type": "email_tool", "end_time": "2025-06-27T11:37:21.302704Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} responses: "200": application/json: {"name": "my span", "start_time": "2024-03-20T10:00:00+00:00", "id": "84d9ffc8-336c-4953-b92f-fe05d5405951", "trace_id": "123e4567-e89b-12d3-a456-426614174000", "parent_id": "123e4567-e89b-12d3-a456-426614174000", "type": "email_tool", "end_time": "2024-03-20T10:00:10+00:00", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} @@ -1832,5 +1829,23 @@ examples: application/json: {"type": "NotFoundError", "message": "The resource was not found", "detail": "Span 123e4567-e89b-12d3-a456-426614174000 not found"} "422": application/json: {"type": "RequestValidationError", "message": "The request is invalid", "detail": {"input": "input value", "loc": ["path", "to", "error"], "msg": "error message", "type": "type of error"}} + add_knowledge__knowledge_base_id__add_post: + speakeasy-default-add-knowledge-knowledge-base-id-add-post: + parameters: + path: + knowledge_base_id: "c441b497-32db-4e24-8f41-ab160e1329fc" + requestBody: + application/json: {"key": "paris_123", "content": "The capital of France is Paris", "metadata": {"category": "product", "price": 100}} + responses: + "201": + application/json: "" + "400": + application/json: {"type": "BadRequestError", "message": "The request is invalid", "detail": "The request is invalid"} + "401": + application/json: {"type": "UnauthorizedError", "message": "The request is unauthorized", "detail": "The API key is invalid"} + "404": + application/json: {"type": "NotFoundError", "message": "The resource was not found", "detail": "Span 123e4567-e89b-12d3-a456-426614174000 not found"} + "422": + application/json: {"type": "RequestValidationError", "message": "The request is invalid", "detail": {"input": "input value", "loc": ["path", "to", "error"], "msg": "error message", "type": "type of error"}} examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index eaf9fd3..7548c48 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -25,7 +25,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.0.0 + version: 1.0.3 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/speakeasy-modifications-overlay.yaml b/.speakeasy/speakeasy-modifications-overlay.yaml index 12941c4..152c37d 100644 --- a/.speakeasy/speakeasy-modifications-overlay.yaml +++ b/.speakeasy/speakeasy-modifications-overlay.yaml @@ -2,7 +2,7 @@ overlay: 1.0.0 x-speakeasy-jsonpath: rfc9535 info: title: Speakeasy Modifications - version: 0.0.28 + version: 0.0.30 x-speakeasy-metadata: after: "" before: "" @@ -709,8 +709,12 @@ actions: x-speakeasy-metadata: created_at: 1750925230100 type: user-edit - - target: $["paths"]["/knowledge"]["post"]["x-speakeasy-name-override"] - update: create + - target: $["paths"]["/knowledge/{knowledge_base_id}/add"]["post"] + update: + x-speakeasy-name-override: add x-speakeasy-metadata: - created_at: 1750925236399 - type: user-edit + after: sdk.knowledge.add() + before: sdk.knowledge.add_knowledge__knowledge_base_id__add_post() + created_at: 1751029113444 + reviewed_at: 1751029118113 + type: method-name diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index cfbff96..db1695d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.570.2 sources: FastAPI: sourceNamespace: fast-api - sourceRevisionDigest: sha256:66206b6c88c3c61ce2ba62b8badc9b6d792a1f3b2bb3b53ffe56ebb6e33c0e6f - sourceBlobDigest: sha256:c589aa220d2edd1ec19274af5a82e4f42afba6ee13c29b7b94ea86c6c6750669 + sourceRevisionDigest: sha256:b66f7e1f7511a3a98ba9cd12b772ec995f5cf4362a60fdcc5b2582f1fa09b05b + sourceBlobDigest: sha256:46c3eaf6d76d253f805f2e4bb527f5a3e1ee391f78222af96eebb199446604b1 tags: - latest - 2.0.0 @@ -11,10 +11,10 @@ targets: opper: source: FastAPI sourceNamespace: fast-api - sourceRevisionDigest: sha256:66206b6c88c3c61ce2ba62b8badc9b6d792a1f3b2bb3b53ffe56ebb6e33c0e6f - sourceBlobDigest: sha256:c589aa220d2edd1ec19274af5a82e4f42afba6ee13c29b7b94ea86c6c6750669 + sourceRevisionDigest: sha256:b66f7e1f7511a3a98ba9cd12b772ec995f5cf4362a60fdcc5b2582f1fa09b05b + sourceBlobDigest: sha256:46c3eaf6d76d253f805f2e4bb527f5a3e1ee391f78222af96eebb199446604b1 codeSamplesNamespace: fast-api-python-code-samples - codeSamplesRevisionDigest: sha256:222418eb8b09f35c79d23b886cb48984f58f7d5f3c9cbc4f8064c707cee1783a + codeSamplesRevisionDigest: sha256:27f0e2c1eed1575de750c05307aa2e88414496aea05007fc0a2f81e5797d1d6b workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index ce13bc1..c237bf4 100644 --- a/README.md +++ b/README.md @@ -370,7 +370,7 @@ with Opper( ### [knowledge](docs/sdks/knowledge/README.md) -* [create](docs/sdks/knowledge/README.md#create) - Create Knowledge Base +* [creat](docs/sdks/knowledge/README.md#creat) - Create Knowledge Base * [list](docs/sdks/knowledge/README.md#list) - List Knowledge Bases * [get](docs/sdks/knowledge/README.md#get) - Get Knowledge Base * [delete](docs/sdks/knowledge/README.md#delete) - Delete Knowledge Base diff --git a/docs/models/addknowledgeknowledgebaseidindexpostrequest.md b/docs/models/addknowledgeknowledgebaseidaddpostrequest.md similarity index 94% rename from docs/models/addknowledgeknowledgebaseidindexpostrequest.md rename to docs/models/addknowledgeknowledgebaseidaddpostrequest.md index e1f9925..4af2d92 100644 --- a/docs/models/addknowledgeknowledgebaseidindexpostrequest.md +++ b/docs/models/addknowledgeknowledgebaseidaddpostrequest.md @@ -1,4 +1,4 @@ -# AddKnowledgeKnowledgeBaseIDIndexPostRequest +# AddKnowledgeKnowledgeBaseIDAddPostRequest ## Fields diff --git a/docs/models/addrequest.md b/docs/models/addrequest.md index e36ff91..5cc07e7 100644 --- a/docs/models/addrequest.md +++ b/docs/models/addrequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | The key of the document | paris_123 | -| `content` | *str* | :heavy_check_mark: | N/A | The capital of France is Paris | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata of the document | {
"category": "product",
"price": 100
} | -| `configuration` | [OptionalNullable[models.FileProcessConfiguration]](../models/fileprocessconfiguration.md) | :heavy_minus_sign: | The configuration for the document | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | The key of the document | paris_123 | +| `content` | *str* | :heavy_check_mark: | N/A | The capital of France is Paris | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata of the document | {
"category": "product",
"price": 100
} | +| `configuration` | [OptionalNullable[models.TextProcessingConfiguration]](../models/textprocessingconfiguration.md) | :heavy_minus_sign: | The configuration for the document | | \ No newline at end of file diff --git a/docs/models/fileprocessconfiguration.md b/docs/models/fileprocessconfiguration.md deleted file mode 100644 index cce13e2..0000000 --- a/docs/models/fileprocessconfiguration.md +++ /dev/null @@ -1,10 +0,0 @@ -# FileProcessConfiguration - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `chunk_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `chunk_overlap` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `pdf_processor` | [Optional[models.PdfProcessorName]](../models/pdfprocessorname.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pdfprocessorname.md b/docs/models/pdfprocessorname.md deleted file mode 100644 index 9f079ad..0000000 --- a/docs/models/pdfprocessorname.md +++ /dev/null @@ -1,8 +0,0 @@ -# PdfProcessorName - - -## Values - -| Name | Value | -| ------- | ------- | -| `PYPDF` | pypdf | \ No newline at end of file diff --git a/docs/models/registerfileuploadrequest.md b/docs/models/registerfileuploadrequest.md index 62579cb..6a73b78 100644 --- a/docs/models/registerfileuploadrequest.md +++ b/docs/models/registerfileuploadrequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `filename` | *str* | :heavy_check_mark: | The filename of the file to register | example.pdf | -| `file_id` | *str* | :heavy_check_mark: | The id of the file to register | | -| `content_type` | *str* | :heavy_check_mark: | The content type of the file to register | application/pdf | -| `configuration` | [OptionalNullable[models.FileProcessConfiguration]](../models/fileprocessconfiguration.md) | :heavy_minus_sign: | The configuration for the file to register | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `filename` | *str* | :heavy_check_mark: | The filename of the file to register | example.pdf | +| `file_id` | *str* | :heavy_check_mark: | The id of the file to register | | +| `content_type` | *str* | :heavy_check_mark: | The content type of the file to register | application/pdf | +| `configuration` | [OptionalNullable[models.TextProcessingConfiguration]](../models/textprocessingconfiguration.md) | :heavy_minus_sign: | The configuration for the file to register | | \ No newline at end of file diff --git a/docs/models/textprocessingconfiguration.md b/docs/models/textprocessingconfiguration.md new file mode 100644 index 0000000..e4cf7a5 --- /dev/null +++ b/docs/models/textprocessingconfiguration.md @@ -0,0 +1,9 @@ +# TextProcessingConfiguration + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `text_processing_chunk_size` | *Optional[int]* | :heavy_minus_sign: | The chunk size to use for the document. This is the number of characters to use for the chunk. The default is 2000 characters. | +| `text_processing_chunk_overlap` | *Optional[int]* | :heavy_minus_sign: | The chunk overlap to use for the document. This is the number of characters to overlap between chunks. The default is 200 characters. | \ No newline at end of file diff --git a/docs/models/updatespanrequest.md b/docs/models/updatespanrequest.md index 7b969aa..287b198 100644 --- a/docs/models/updatespanrequest.md +++ b/docs/models/updatespanrequest.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the span, something descriptive about the span that will be used to identify it when querying | my span | -| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T08:51:47.800056Z | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:21.302644Z | | `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the span | email_tool | -| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T08:51:47.800118Z | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:21.302704Z | | `input` | *OptionalNullable[str]* | :heavy_minus_sign: | The input of the span | Hello, world! | | `output` | *OptionalNullable[str]* | :heavy_minus_sign: | The output of the span | Hello, world! | | `error` | *OptionalNullable[str]* | :heavy_minus_sign: | In case of an error, the error message | Exception: This is an error message | diff --git a/docs/sdks/knowledge/README.md b/docs/sdks/knowledge/README.md index ddc6c9b..0573e11 100644 --- a/docs/sdks/knowledge/README.md +++ b/docs/sdks/knowledge/README.md @@ -5,7 +5,7 @@ ### Available Operations -* [create](#create) - Create Knowledge Base +* [creat](#creat) - Create Knowledge Base * [list](#list) - List Knowledge Bases * [get](#get) - Get Knowledge Base * [delete](#delete) - Delete Knowledge Base @@ -16,7 +16,7 @@ * [query](#query) - Query Knowledge Base * [add](#add) - Add -## create +## creat Create a knowledge base @@ -31,7 +31,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.knowledge.create(name="", embedding_model="azure/text-embedding-3-large") + res = opper.knowledge.creat(name="", embedding_model="azure/text-embedding-3-large") # Handle response print(res) @@ -306,14 +306,14 @@ with Opper( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `knowledge_base_id` | *str* | :heavy_check_mark: | The id of the knowledge base to register the file for | | -| `filename` | *str* | :heavy_check_mark: | The filename of the file to register | example.pdf | -| `file_id` | *str* | :heavy_check_mark: | The id of the file to register | | -| `content_type` | *str* | :heavy_check_mark: | The content type of the file to register | application/pdf | -| `configuration` | [OptionalNullable[models.FileProcessConfiguration]](../../models/fileprocessconfiguration.md) | :heavy_minus_sign: | The configuration for the file to register | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `knowledge_base_id` | *str* | :heavy_check_mark: | The id of the knowledge base to register the file for | | +| `filename` | *str* | :heavy_check_mark: | The filename of the file to register | example.pdf | +| `file_id` | *str* | :heavy_check_mark: | The id of the file to register | | +| `content_type` | *str* | :heavy_check_mark: | The content type of the file to register | application/pdf | +| `configuration` | [OptionalNullable[models.TextProcessingConfiguration]](../../models/textprocessingconfiguration.md) | :heavy_minus_sign: | The configuration for the file to register | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -446,7 +446,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.knowledge.add(knowledge_base_id="b07d062e-0da0-4feb-9181-eefc10945b3a", content="The capital of France is Paris", key="paris_123", metadata={ + res = opper.knowledge.add(knowledge_base_id="c441b497-32db-4e24-8f41-ab160e1329fc", content="The capital of France is Paris", key="paris_123", metadata={ "category": "product", "price": 100, }) @@ -458,14 +458,14 @@ with Opper( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `knowledge_base_id` | *str* | :heavy_check_mark: | The id of the knowledge base to add the data to | | -| `content` | *str* | :heavy_check_mark: | N/A | The capital of France is Paris | -| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | The key of the document | paris_123 | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata of the document | {
"category": "product",
"price": 100
} | -| `configuration` | [OptionalNullable[models.FileProcessConfiguration]](../../models/fileprocessconfiguration.md) | :heavy_minus_sign: | The configuration for the document | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `knowledge_base_id` | *str* | :heavy_check_mark: | The id of the knowledge base to add the data to | | +| `content` | *str* | :heavy_check_mark: | N/A | The capital of France is Paris | +| `key` | *OptionalNullable[str]* | :heavy_minus_sign: | The key of the document | paris_123 | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | The metadata of the document | {
"category": "product",
"price": 100
} | +| `configuration` | [OptionalNullable[models.TextProcessingConfiguration]](../../models/textprocessingconfiguration.md) | :heavy_minus_sign: | The configuration for the document | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/spans/README.md b/docs/sdks/spans/README.md index 212ed0f..b7923ba 100644 --- a/docs/sdks/spans/README.md +++ b/docs/sdks/spans/README.md @@ -127,7 +127,7 @@ with Opper( http_bearer=os.getenv("OPPER_HTTP_BEARER", ""), ) as opper: - res = opper.spans.update(span_id="77b258a2-45c1-4b87-a50c-9116bc8ed1d6", name="my span", start_time=parse_datetime("2025-06-27T08:51:47.800056Z"), type_="email_tool", end_time=parse_datetime("2025-06-27T08:51:47.800118Z"), input_="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ + res = opper.spans.update(span_id="77b258a2-45c1-4b87-a50c-9116bc8ed1d6", name="my span", start_time=parse_datetime("2025-06-27T11:37:21.302644Z"), type_="email_tool", end_time=parse_datetime("2025-06-27T11:37:21.302704Z"), input_="Hello, world!", output="Hello, world!", error="Exception: This is an error message", meta={ "key": "value", }, score=10) @@ -142,9 +142,9 @@ with Opper( | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `span_id` | *str* | :heavy_check_mark: | The ID of the span to update | | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the span, something descriptive about the span that will be used to identify it when querying | my span | -| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T08:51:47.800056Z | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The start time of the span in UTC | 2025-06-27T11:37:21.302644Z | | `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the span | email_tool | -| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T08:51:47.800118Z | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The end time of the span in UTC | 2025-06-27T11:37:21.302704Z | | `input` | *OptionalNullable[str]* | :heavy_minus_sign: | The input of the span | Hello, world! | | `output` | *OptionalNullable[str]* | :heavy_minus_sign: | The output of the span | Hello, world! | | `error` | *OptionalNullable[str]* | :heavy_minus_sign: | In case of an error, the error message | Exception: This is an error message | diff --git a/pyproject.toml b/pyproject.toml index 7224251..2d7df06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "opperai" -version = "1.0.0" +version = "1.0.3" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README.md" diff --git a/src/opperai/_version.py b/src/opperai/_version.py index b0d3688..b92cda6 100644 --- a/src/opperai/_version.py +++ b/src/opperai/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "opperai" -__version__: str = "1.0.0" +__version__: str = "1.0.3" __openapi_doc_version__: str = "2.0.0" __gen_version__: str = "2.638.5" -__user_agent__: str = "speakeasy-sdk/python 1.0.0 2.638.5 2.0.0 opperai" +__user_agent__: str = "speakeasy-sdk/python 1.0.3 2.638.5 2.0.0 opperai" try: if __package__ is not None: diff --git a/src/opperai/knowledge.py b/src/opperai/knowledge.py index 2d924ac..752309a 100644 --- a/src/opperai/knowledge.py +++ b/src/opperai/knowledge.py @@ -9,7 +9,7 @@ class Knowledge(BaseSDK): - def create( + def creat( self, *, name: str, @@ -132,7 +132,7 @@ def create( http_res, ) - async def create_async( + async def creat_async( self, *, name: str, @@ -1444,8 +1444,8 @@ def register_file_upload( content_type: str, configuration: OptionalNullable[ Union[ - models.FileProcessConfiguration, - models.FileProcessConfigurationTypedDict, + models.TextProcessingConfiguration, + models.TextProcessingConfigurationTypedDict, ] ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1490,7 +1490,8 @@ def register_file_upload( file_id=file_id, content_type=content_type, configuration=utils.get_pydantic_model( - configuration, OptionalNullable[models.FileProcessConfiguration] + configuration, + OptionalNullable[models.TextProcessingConfiguration], ), ), ) @@ -1596,8 +1597,8 @@ async def register_file_upload_async( content_type: str, configuration: OptionalNullable[ Union[ - models.FileProcessConfiguration, - models.FileProcessConfigurationTypedDict, + models.TextProcessingConfiguration, + models.TextProcessingConfigurationTypedDict, ] ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1642,7 +1643,8 @@ async def register_file_upload_async( file_id=file_id, content_type=content_type, configuration=utils.get_pydantic_model( - configuration, OptionalNullable[models.FileProcessConfiguration] + configuration, + OptionalNullable[models.TextProcessingConfiguration], ), ), ) @@ -2280,8 +2282,8 @@ def add( metadata: Optional[Dict[str, Any]] = None, configuration: OptionalNullable[ Union[ - models.FileProcessConfiguration, - models.FileProcessConfigurationTypedDict, + models.TextProcessingConfiguration, + models.TextProcessingConfigurationTypedDict, ] ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -2313,21 +2315,21 @@ def add( else: base_url = self._get_url(base_url, url_variables) - request = models.AddKnowledgeKnowledgeBaseIDIndexPostRequest( + request = models.AddKnowledgeKnowledgeBaseIDAddPostRequest( knowledge_base_id=knowledge_base_id, add_request=models.AddRequest( key=key, content=content, metadata=metadata, configuration=utils.get_pydantic_model( - configuration, OptionalNullable[models.FileProcessConfiguration] + configuration, OptionalNullable[models.TextProcessingConfiguration] ), ), ) req = self._build_request( method="POST", - path="/knowledge/{knowledge_base_id}/index", + path="/knowledge/{knowledge_base_id}/add", base_url=base_url, url_variables=url_variables, request=request, @@ -2356,7 +2358,7 @@ def add( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="add_knowledge__knowledge_base_id__index_post", + operation_id="add_knowledge__knowledge_base_id__add_post", oauth2_scopes=[], security_source=get_security_from_env( self.sdk_configuration.security, models.Security @@ -2419,8 +2421,8 @@ async def add_async( metadata: Optional[Dict[str, Any]] = None, configuration: OptionalNullable[ Union[ - models.FileProcessConfiguration, - models.FileProcessConfigurationTypedDict, + models.TextProcessingConfiguration, + models.TextProcessingConfigurationTypedDict, ] ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -2452,21 +2454,21 @@ async def add_async( else: base_url = self._get_url(base_url, url_variables) - request = models.AddKnowledgeKnowledgeBaseIDIndexPostRequest( + request = models.AddKnowledgeKnowledgeBaseIDAddPostRequest( knowledge_base_id=knowledge_base_id, add_request=models.AddRequest( key=key, content=content, metadata=metadata, configuration=utils.get_pydantic_model( - configuration, OptionalNullable[models.FileProcessConfiguration] + configuration, OptionalNullable[models.TextProcessingConfiguration] ), ), ) req = self._build_request_async( method="POST", - path="/knowledge/{knowledge_base_id}/index", + path="/knowledge/{knowledge_base_id}/add", base_url=base_url, url_variables=url_variables, request=request, @@ -2495,7 +2497,7 @@ async def add_async( hook_ctx=HookContext( config=self.sdk_configuration, base_url=base_url or "", - operation_id="add_knowledge__knowledge_base_id__index_post", + operation_id="add_knowledge__knowledge_base_id__add_post", oauth2_scopes=[], security_source=get_security_from_env( self.sdk_configuration.security, models.Security diff --git a/src/opperai/models/__init__.py b/src/opperai/models/__init__.py index e0fc5ea..e55750e 100644 --- a/src/opperai/models/__init__.py +++ b/src/opperai/models/__init__.py @@ -4,9 +4,9 @@ from importlib import import_module if TYPE_CHECKING: - from .add_knowledge_knowledge_base_id_index_postop import ( - AddKnowledgeKnowledgeBaseIDIndexPostRequest, - AddKnowledgeKnowledgeBaseIDIndexPostRequestTypedDict, + from .add_knowledge_knowledge_base_id_add_postop import ( + AddKnowledgeKnowledgeBaseIDAddPostRequest, + AddKnowledgeKnowledgeBaseIDAddPostRequestTypedDict, ) from .addrequest import AddRequest, AddRequestTypedDict from .annotation import Annotation, AnnotationTypedDict @@ -280,10 +280,6 @@ from .examplein import ExampleIn, ExampleInTypedDict from .file import File, FileTypedDict from .filefile import FileFile, FileFileTypedDict - from .fileprocessconfiguration import ( - FileProcessConfiguration, - FileProcessConfigurationTypedDict, - ) from .filter_ import ( Filter, FilterTypedDict, @@ -492,7 +488,6 @@ PaginatedResponseListTracesResponse, PaginatedResponseListTracesResponseTypedDict, ) - from .pdfprocessorname import PdfProcessorName from .prompttokensdetails import PromptTokensDetails, PromptTokensDetailsTypedDict from .query_dataset_entries_datasets_dataset_id_entries_query_postop import ( QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest, @@ -575,6 +570,10 @@ StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBodyTypedDict, StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseTypedDict, ) + from .textprocessingconfiguration import ( + TextProcessingConfiguration, + TextProcessingConfigurationTypedDict, + ) from .tmodel import TModel, TModel1, TModel1TypedDict, TModelTypedDict from .toplogprob import TopLogprob, TopLogprobTypedDict from .update_custom_model_models_custom_model_id_patchop import ( @@ -650,8 +649,8 @@ ) __all__ = [ - "AddKnowledgeKnowledgeBaseIDIndexPostRequest", - "AddKnowledgeKnowledgeBaseIDIndexPostRequestTypedDict", + "AddKnowledgeKnowledgeBaseIDAddPostRequest", + "AddKnowledgeKnowledgeBaseIDAddPostRequestTypedDict", "AddRequest", "AddRequestTypedDict", "Annotation", @@ -826,8 +825,6 @@ "File", "FileFile", "FileFileTypedDict", - "FileProcessConfiguration", - "FileProcessConfigurationTypedDict", "FileTypedDict", "Filter", "FilterTypedDict", @@ -963,7 +960,6 @@ "PaginatedResponseListTracesResponseTypedDict", "Payload", "PayloadTypedDict", - "PdfProcessorName", "PromptTokensDetails", "PromptTokensDetailsTypedDict", "QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest", @@ -1025,6 +1021,8 @@ "TModel1", "TModel1TypedDict", "TModelTypedDict", + "TextProcessingConfiguration", + "TextProcessingConfigurationTypedDict", "TopLogprob", "TopLogprobTypedDict", "UpdateCustomModelModelsCustomModelIDPatchRequest", @@ -1075,8 +1073,8 @@ ] _dynamic_imports: dict[str, str] = { - "AddKnowledgeKnowledgeBaseIDIndexPostRequest": ".add_knowledge_knowledge_base_id_index_postop", - "AddKnowledgeKnowledgeBaseIDIndexPostRequestTypedDict": ".add_knowledge_knowledge_base_id_index_postop", + "AddKnowledgeKnowledgeBaseIDAddPostRequest": ".add_knowledge_knowledge_base_id_add_postop", + "AddKnowledgeKnowledgeBaseIDAddPostRequestTypedDict": ".add_knowledge_knowledge_base_id_add_postop", "AddRequest": ".addrequest", "AddRequestTypedDict": ".addrequest", "Annotation": ".annotation", @@ -1261,8 +1259,6 @@ "FileTypedDict": ".file", "FileFile": ".filefile", "FileFileTypedDict": ".filefile", - "FileProcessConfiguration": ".fileprocessconfiguration", - "FileProcessConfigurationTypedDict": ".fileprocessconfiguration", "Filter": ".filter_", "FilterTypedDict": ".filter_", "Value1": ".filter_", @@ -1395,7 +1391,6 @@ "PaginatedResponseListSpanMetricsResponseTypedDict": ".paginatedresponse_listspanmetricsresponse_", "PaginatedResponseListTracesResponse": ".paginatedresponse_listtracesresponse_", "PaginatedResponseListTracesResponseTypedDict": ".paginatedresponse_listtracesresponse_", - "PdfProcessorName": ".pdfprocessorname", "PromptTokensDetails": ".prompttokensdetails", "PromptTokensDetailsTypedDict": ".prompttokensdetails", "QueryDatasetEntriesDatasetsDatasetIDEntriesQueryPostRequest": ".query_dataset_entries_datasets_dataset_id_entries_query_postop", @@ -1452,6 +1447,8 @@ "StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBody": ".stream_function_revision_functions_function_id_call_stream_revision_id_postop", "StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseBodyTypedDict": ".stream_function_revision_functions_function_id_call_stream_revision_id_postop", "StreamFunctionRevisionFunctionsFunctionIDCallStreamRevisionIDPostResponseTypedDict": ".stream_function_revision_functions_function_id_call_stream_revision_id_postop", + "TextProcessingConfiguration": ".textprocessingconfiguration", + "TextProcessingConfigurationTypedDict": ".textprocessingconfiguration", "TModel": ".tmodel", "TModel1": ".tmodel", "TModel1TypedDict": ".tmodel", diff --git a/src/opperai/models/add_knowledge_knowledge_base_id_index_postop.py b/src/opperai/models/add_knowledge_knowledge_base_id_add_postop.py similarity index 85% rename from src/opperai/models/add_knowledge_knowledge_base_id_index_postop.py rename to src/opperai/models/add_knowledge_knowledge_base_id_add_postop.py index 2e0de43..58c9d6b 100644 --- a/src/opperai/models/add_knowledge_knowledge_base_id_index_postop.py +++ b/src/opperai/models/add_knowledge_knowledge_base_id_add_postop.py @@ -7,13 +7,13 @@ from typing_extensions import Annotated, TypedDict -class AddKnowledgeKnowledgeBaseIDIndexPostRequestTypedDict(TypedDict): +class AddKnowledgeKnowledgeBaseIDAddPostRequestTypedDict(TypedDict): knowledge_base_id: str r"""The id of the knowledge base to add the data to""" add_request: AddRequestTypedDict -class AddKnowledgeKnowledgeBaseIDIndexPostRequest(BaseModel): +class AddKnowledgeKnowledgeBaseIDAddPostRequest(BaseModel): knowledge_base_id: Annotated[ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) ] diff --git a/src/opperai/models/addrequest.py b/src/opperai/models/addrequest.py index 4acc61e..63ee7f7 100644 --- a/src/opperai/models/addrequest.py +++ b/src/opperai/models/addrequest.py @@ -1,9 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .fileprocessconfiguration import ( - FileProcessConfiguration, - FileProcessConfigurationTypedDict, +from .textprocessingconfiguration import ( + TextProcessingConfiguration, + TextProcessingConfigurationTypedDict, ) from opperai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -17,7 +17,7 @@ class AddRequestTypedDict(TypedDict): r"""The key of the document""" metadata: NotRequired[Dict[str, Any]] r"""The metadata of the document""" - configuration: NotRequired[Nullable[FileProcessConfigurationTypedDict]] + configuration: NotRequired[Nullable[TextProcessingConfigurationTypedDict]] r"""The configuration for the document""" @@ -30,7 +30,7 @@ class AddRequest(BaseModel): metadata: Optional[Dict[str, Any]] = None r"""The metadata of the document""" - configuration: OptionalNullable[FileProcessConfiguration] = UNSET + configuration: OptionalNullable[TextProcessingConfiguration] = UNSET r"""The configuration for the document""" @model_serializer(mode="wrap") diff --git a/src/opperai/models/fileprocessconfiguration.py b/src/opperai/models/fileprocessconfiguration.py deleted file mode 100644 index 87bd1c5..0000000 --- a/src/opperai/models/fileprocessconfiguration.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .pdfprocessorname import PdfProcessorName -from opperai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class FileProcessConfigurationTypedDict(TypedDict): - chunk_size: NotRequired[int] - chunk_overlap: NotRequired[int] - pdf_processor: NotRequired[PdfProcessorName] - - -class FileProcessConfiguration(BaseModel): - chunk_size: Optional[int] = 2000 - - chunk_overlap: Optional[int] = 200 - - pdf_processor: Optional[PdfProcessorName] = None diff --git a/src/opperai/models/pdfprocessorname.py b/src/opperai/models/pdfprocessorname.py deleted file mode 100644 index f1358a7..0000000 --- a/src/opperai/models/pdfprocessorname.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - - -class PdfProcessorName(str, Enum): - PYPDF = "pypdf" diff --git a/src/opperai/models/registerfileuploadrequest.py b/src/opperai/models/registerfileuploadrequest.py index 78d866f..4ae8c3d 100644 --- a/src/opperai/models/registerfileuploadrequest.py +++ b/src/opperai/models/registerfileuploadrequest.py @@ -1,9 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .fileprocessconfiguration import ( - FileProcessConfiguration, - FileProcessConfigurationTypedDict, +from .textprocessingconfiguration import ( + TextProcessingConfiguration, + TextProcessingConfigurationTypedDict, ) from opperai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer @@ -17,7 +17,7 @@ class RegisterFileUploadRequestTypedDict(TypedDict): r"""The id of the file to register""" content_type: str r"""The content type of the file to register""" - configuration: NotRequired[Nullable[FileProcessConfigurationTypedDict]] + configuration: NotRequired[Nullable[TextProcessingConfigurationTypedDict]] r"""The configuration for the file to register""" @@ -31,7 +31,7 @@ class RegisterFileUploadRequest(BaseModel): content_type: str r"""The content type of the file to register""" - configuration: OptionalNullable[FileProcessConfiguration] = UNSET + configuration: OptionalNullable[TextProcessingConfiguration] = UNSET r"""The configuration for the file to register""" @model_serializer(mode="wrap") diff --git a/src/opperai/models/textprocessingconfiguration.py b/src/opperai/models/textprocessingconfiguration.py new file mode 100644 index 0000000..608cfd6 --- /dev/null +++ b/src/opperai/models/textprocessingconfiguration.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from opperai.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TextProcessingConfigurationTypedDict(TypedDict): + text_processing_chunk_size: NotRequired[int] + r"""The chunk size to use for the document. This is the number of characters to use for the chunk. The default is 2000 characters.""" + text_processing_chunk_overlap: NotRequired[int] + r"""The chunk overlap to use for the document. This is the number of characters to overlap between chunks. The default is 200 characters.""" + + +class TextProcessingConfiguration(BaseModel): + text_processing_chunk_size: Annotated[ + Optional[int], pydantic.Field(alias="text_processing.chunk_size") + ] = 2000 + r"""The chunk size to use for the document. This is the number of characters to use for the chunk. The default is 2000 characters.""" + + text_processing_chunk_overlap: Annotated[ + Optional[int], pydantic.Field(alias="text_processing.chunk_overlap") + ] = 200 + r"""The chunk overlap to use for the document. This is the number of characters to overlap between chunks. The default is 200 characters.""" diff --git a/tests/mockserver/internal/sdk/models/components/addrequest.go b/tests/mockserver/internal/sdk/models/components/addrequest.go index 671c018..3215a89 100644 --- a/tests/mockserver/internal/sdk/models/components/addrequest.go +++ b/tests/mockserver/internal/sdk/models/components/addrequest.go @@ -9,7 +9,7 @@ type AddRequest struct { // The metadata of the document Metadata map[string]any `json:"metadata,omitempty"` // The configuration for the document - Configuration *FileProcessConfiguration `json:"configuration,omitempty"` + Configuration *TextProcessingConfiguration `json:"configuration,omitempty"` } func (o *AddRequest) GetKey() *string { @@ -33,7 +33,7 @@ func (o *AddRequest) GetMetadata() map[string]any { return o.Metadata } -func (o *AddRequest) GetConfiguration() *FileProcessConfiguration { +func (o *AddRequest) GetConfiguration() *TextProcessingConfiguration { if o == nil { return nil } diff --git a/tests/mockserver/internal/sdk/models/components/fileprocessconfiguration.go b/tests/mockserver/internal/sdk/models/components/fileprocessconfiguration.go deleted file mode 100644 index ea3dca6..0000000 --- a/tests/mockserver/internal/sdk/models/components/fileprocessconfiguration.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" -) - -type FileProcessConfiguration struct { - ChunkSize *int64 `default:"2000" json:"chunk_size"` - ChunkOverlap *int64 `default:"200" json:"chunk_overlap"` - PdfProcessor *PdfProcessorName `json:"pdf_processor,omitempty"` -} - -func (f FileProcessConfiguration) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileProcessConfiguration) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileProcessConfiguration) GetChunkSize() *int64 { - if o == nil { - return nil - } - return o.ChunkSize -} - -func (o *FileProcessConfiguration) GetChunkOverlap() *int64 { - if o == nil { - return nil - } - return o.ChunkOverlap -} - -func (o *FileProcessConfiguration) GetPdfProcessor() *PdfProcessorName { - if o == nil { - return nil - } - return o.PdfProcessor -} diff --git a/tests/mockserver/internal/sdk/models/components/pdfprocessorname.go b/tests/mockserver/internal/sdk/models/components/pdfprocessorname.go deleted file mode 100644 index 5129710..0000000 --- a/tests/mockserver/internal/sdk/models/components/pdfprocessorname.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type PdfProcessorName string - -const ( - PdfProcessorNamePypdf PdfProcessorName = "pypdf" -) - -func (e PdfProcessorName) ToPointer() *PdfProcessorName { - return &e -} -func (e *PdfProcessorName) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "pypdf": - *e = PdfProcessorName(v) - return nil - default: - return fmt.Errorf("invalid value for PdfProcessorName: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go b/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go index e70507f..b5b6e78 100644 --- a/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go +++ b/tests/mockserver/internal/sdk/models/components/registerfileuploadrequest.go @@ -10,7 +10,7 @@ type RegisterFileUploadRequest struct { // The content type of the file to register ContentType string `json:"content_type"` // The configuration for the file to register - Configuration *FileProcessConfiguration `json:"configuration,omitempty"` + Configuration *TextProcessingConfiguration `json:"configuration,omitempty"` } func (o *RegisterFileUploadRequest) GetFilename() string { @@ -34,7 +34,7 @@ func (o *RegisterFileUploadRequest) GetContentType() string { return o.ContentType } -func (o *RegisterFileUploadRequest) GetConfiguration() *FileProcessConfiguration { +func (o *RegisterFileUploadRequest) GetConfiguration() *TextProcessingConfiguration { if o == nil { return nil } diff --git a/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go b/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go new file mode 100644 index 0000000..6f4058d --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/textprocessingconfiguration.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" +) + +type TextProcessingConfiguration struct { + // The chunk size to use for the document. This is the number of characters to use for the chunk. The default is 2000 characters. + TextProcessingChunkSize *int64 `default:"2000" json:"text_processing.chunk_size"` + // The chunk overlap to use for the document. This is the number of characters to overlap between chunks. The default is 200 characters. + TextProcessingChunkOverlap *int64 `default:"200" json:"text_processing.chunk_overlap"` +} + +func (t TextProcessingConfiguration) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TextProcessingConfiguration) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TextProcessingConfiguration) GetTextProcessingChunkSize() *int64 { + if o == nil { + return nil + } + return o.TextProcessingChunkSize +} + +func (o *TextProcessingConfiguration) GetTextProcessingChunkOverlap() *int64 { + if o == nil { + return nil + } + return o.TextProcessingChunkOverlap +} diff --git a/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidindexpost.go b/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go similarity index 61% rename from tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidindexpost.go rename to tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go index da7e568..6adca75 100644 --- a/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidindexpost.go +++ b/tests/mockserver/internal/sdk/models/operations/addknowledgeknowledgebaseidaddpost.go @@ -6,40 +6,40 @@ import ( "mockserver/internal/sdk/models/components" ) -type AddKnowledgeKnowledgeBaseIDIndexPostRequest struct { +type AddKnowledgeKnowledgeBaseIDAddPostRequest struct { // The id of the knowledge base to add the data to KnowledgeBaseID string `pathParam:"style=simple,explode=false,name=knowledge_base_id"` AddRequest components.AddRequest `request:"mediaType=application/json"` } -func (o *AddKnowledgeKnowledgeBaseIDIndexPostRequest) GetKnowledgeBaseID() string { +func (o *AddKnowledgeKnowledgeBaseIDAddPostRequest) GetKnowledgeBaseID() string { if o == nil { return "" } return o.KnowledgeBaseID } -func (o *AddKnowledgeKnowledgeBaseIDIndexPostRequest) GetAddRequest() components.AddRequest { +func (o *AddKnowledgeKnowledgeBaseIDAddPostRequest) GetAddRequest() components.AddRequest { if o == nil { return components.AddRequest{} } return o.AddRequest } -type AddKnowledgeKnowledgeBaseIDIndexPostResponse struct { +type AddKnowledgeKnowledgeBaseIDAddPostResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful Response Any any } -func (o *AddKnowledgeKnowledgeBaseIDIndexPostResponse) GetHTTPMeta() components.HTTPMetadata { +func (o *AddKnowledgeKnowledgeBaseIDAddPostResponse) GetHTTPMeta() components.HTTPMetadata { if o == nil { return components.HTTPMetadata{} } return o.HTTPMeta } -func (o *AddKnowledgeKnowledgeBaseIDIndexPostResponse) GetAny() any { +func (o *AddKnowledgeKnowledgeBaseIDAddPostResponse) GetAny() any { if o == nil { return nil }