Skip to content

Commit

Permalink
Remove sdk documentation logic (#2205)
Browse files Browse the repository at this point in the history
  • Loading branch information
lferran authored May 30, 2024
1 parent fc242f5 commit fbf4d61
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 605 deletions.
1 change: 1 addition & 0 deletions nucliadb/nucliadb/search/api/v1/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class SyncChatResponse(pydantic.BaseModel):
description="Chat on a Knowledge Box",
tags=["Search"],
response_model=None,
deprecated=True,
)
@requires(NucliaDBRoles.READER)
@version(1)
Expand Down
2 changes: 0 additions & 2 deletions nucliadb/nucliadb/search/api/v1/resource/ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ async def resource_ask_endpoint_by_uuid(
description="Ask questions to a resource",
tags=["Search"],
response_model=SyncAskResponse,
# Add this to OpenAPI schema when endpoint is not in beta anymore
include_in_schema=False,
)
@requires(NucliaDBRoles.READER)
@version(1)
Expand Down
2 changes: 2 additions & 0 deletions nucliadb/nucliadb/search/api/v1/resource/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
description="Chat with a resource",
tags=["Search"],
response_model=None,
deprecated=True,
)
@requires(NucliaDBRoles.READER)
@version(1)
Expand Down Expand Up @@ -82,6 +83,7 @@ async def resource_chat_endpoint_by_uuid(
description="Chat with a resource",
tags=["Search"],
response_model=None,
deprecated=True,
)
@requires(NucliaDBRoles.READER)
@version(1)
Expand Down
10 changes: 0 additions & 10 deletions nucliadb_sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ ndb = NucliaDB(region=Region.ON_PREM, api="http://localhost:8080/api")

Then, each method of the `NucliaDB` class maps to an HTTP endpoint of the NucliaDB API. The parameters it accepts correspond to the Pydantic models associated to the request body scheme of the endpoint.

You can use Python's built-in `help` directive to check the list of available methods with their signature:

```python
from nucliadb_sdk import NucliaDB

help(NucliaDB)
help(NucliaDB.chat)
help(NucliaDB.create_resource)
```

The method-to-endpoint mappings for the sdk are declared in-code [in the _NucliaDBBase class](https://github.com/nuclia/nucliadb/blob/main/nucliadb_sdk/nucliadb_sdk/v2/sdk.py).

For instance, to create a resource in your Knowledge Box, the endpoint is defined [here](https://docs.nuclia.dev/docs/api#tag/Resources/operation/Create_Resource_kb__kbid__resources_post).
Expand Down
Loading

3 comments on commit fbf4d61

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: fbf4d61 Previous: 08db1e8 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 2822.2566107948805 iter/sec (stddev: 0.0000018938402254798875) 3041.132211072051 iter/sec (stddev: 0.0000011628635974660105) 1.08

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: fbf4d61 Previous: 08db1e8 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 2928.3861112119594 iter/sec (stddev: 0.0000026925570350430733) 3041.132211072051 iter/sec (stddev: 0.0000011628635974660105) 1.04

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: fbf4d61 Previous: 08db1e8 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 3086.78431020449 iter/sec (stddev: 0.000003174772256113213) 3041.132211072051 iter/sec (stddev: 0.0000011628635974660105) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.