ExtractorsApi
Method |
HTTP request |
Description |
|---|---|---|
POST /extractors |
Creates extractor. |
|
POST /extractors/{extractor-id}/job |
Create a job to run an extractor on a collection or document |
|
DELETE /extractors/{extractor-id} |
Deletes extractor. |
|
GET /extractors/{extractor-id} |
Fetch an extractor by ID |
|
GET /extractors/{extractor-id}/group-permissions |
Returns a list of group access permissions for a given extractor. |
|
GET /extractors/{extractor-id}/permissions |
Returns a list of users having access to given extractor. |
|
GET /extractors/{extractor-id}/results |
Retrieve extraction results |
|
GET /extractors |
List extractors. |
|
PUT /extractors/{extractor-id}/permissions |
Resets and shares an extractor to a new list of users. |
|
PUT /extractors/{extractor-id}/group-permissions |
Resets and shares an extractor to a new list of groups. |
|
POST /extractors/{extractor-id}/run |
Run an extractor on a collection, document, or uploaded files (synchronous) |
|
PUT /extractors/{extractor-id}/permissions/{username} |
Shares an extractor to a user. |
|
PUT /extractors/{extractor-id}/group-permissions/{group-id} |
Shares an extractor to a group. |
|
DELETE /extractors/{extractor-id}/permissions/{username} |
Removes sharing of an extractor to a user. |
|
DELETE /extractors/{extractor-id}/permissions |
Removes sharing of an extractor to all other users except the original owner. |
|
DELETE /extractors/{extractor-id}/group-permissions/{group-id} |
Removes sharing of an extractor from a group. |
|
PATCH /extractors/{extractor-id} |
Updates attributes of a given extractor. |
|
POST /extractors/{extractor-id}/is-public |
Updates a flag specifying whether an extractor is private or public. |
create_extractor
Extractor create_extractor(extractor_create_request)
Creates extractor.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.extractor import Extractor
from h2ogpte.rest_async.models.extractor_create_request import ExtractorCreateRequest
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_create_request = {"description":"Extracts medical data using Meta Llama 3.1-8B","llm":"meta-llama/Meta-Llama-3.1-8B-Instruct","name":"Medical data extractor","schema":"{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"title\": \"H2O Field Editor Generated Schema\",\n \"type\": \"object\",\n \"properties\": {\n \"fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"clinic_name\": {\n \"type\": \"string\"\n },\n \"patient_surname\": {\n \"type\": \"string\"\n },\n \"patient_first_name\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"required\": [\n \"fields\"\n ]\n}\n"} # ExtractorCreateRequest |
try:
# Creates extractor.
api_response = await api_instance.create_extractor(extractor_create_request)
print("The response of ExtractorsApi->create_extractor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->create_extractor: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_create_request |
Return type
HTTP request headers
Content-Type: application/json
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
OK |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
403 |
Forbidden |
- |
404 |
Not found |
- |
create_extractor_run_job
JobDetails create_extractor_run_job(extractor_id, collection_id=collection_id, document_id=document_id, timeout=timeout)
Create a job to run an extractor on a collection or document
Creates a job to execute the specified extractor by running it on all documents in a collection, or on a single document when document_id is specified. This endpoint is designed for long-running extractions. The endpoint immediately returns a 201 Created response with job details. Exactly one of collection_id or document_id must be provided.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.job_details import JobDetails
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor to run
collection_id = 'collection_id_example' # str | ID of the collection to run the extractor on. Exactly one of collection_id or document_id must be provided. (optional)
document_id = 'document_id_example' # str | ID of the single document to run the extractor on. Exactly one of collection_id or document_id must be provided. (optional)
timeout = 3.4 # float | Timeout in seconds (optional)
try:
# Create a job to run an extractor on a collection or document
api_response = await api_instance.create_extractor_run_job(extractor_id, collection_id=collection_id, document_id=document_id, timeout=timeout)
print("The response of ExtractorsApi->create_extractor_run_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->create_extractor_run_job: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor to run |
|
collection_id |
str |
ID of the collection to run the extractor on. Exactly one of collection_id or document_id must be provided. |
[optional] |
document_id |
str |
ID of the single document to run the extractor on. Exactly one of collection_id or document_id must be provided. |
[optional] |
timeout |
float |
Timeout in seconds |
[optional] |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
201 |
Job created successfully. The job has been accepted and is being processed. Use GET /jobs/{job_id} to check progress. Once completed, retrieve results using `/extractors/{extractor_id}/results?job_id={job_id}`. |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Not found |
- |
delete_extractor
delete_extractor(extractor_id)
Deletes extractor.
Deletes extractor.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor to delete.
try:
# Deletes extractor.
await api_instance.delete_extractor(extractor_id)
except Exception as e:
print("Exception when calling ExtractorsApi->delete_extractor: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor to delete. |
Return type
void (empty response body)
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
204 |
Successful operation |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
get_extractor
Extractor get_extractor(extractor_id)
Fetch an extractor by ID
This endpoint retrieves information about a specific extractor based on its unique ID. It requires an authenticated user and returns a JSON response containing the extractor’s details.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.extractor import Extractor
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor to get.
try:
# Fetch an extractor by ID
api_response = await api_instance.get_extractor(extractor_id)
print("The response of ExtractorsApi->get_extractor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->get_extractor: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor to get. |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
OK |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Not found |
- |
get_extractor_group_permissions
List[GroupSharePermission] get_extractor_group_permissions(extractor_id)
Returns a list of group access permissions for a given extractor.
The returned list of group permissions denoting which groups have access to the extractor.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.group_share_permission import GroupSharePermission
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | Id of the extractor.
try:
# Returns a list of group access permissions for a given extractor.
api_response = await api_instance.get_extractor_group_permissions(extractor_id)
print("The response of ExtractorsApi->get_extractor_group_permissions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->get_extractor_group_permissions: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
Id of the extractor. |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Successful operation |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
get_extractor_permissions
List[SharePermission] get_extractor_permissions(extractor_id)
Returns a list of users having access to given extractor.
The returned list of permissions denotes who has access to the extractor.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.share_permission import SharePermission
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | Id of the extractor.
try:
# Returns a list of users having access to given extractor.
api_response = await api_instance.get_extractor_permissions(extractor_id)
print("The response of ExtractorsApi->get_extractor_permissions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->get_extractor_permissions: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
Id of the extractor. |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Successful operation |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
list_extractor_results
List[DocumentExtractionResult] list_extractor_results(extractor_id, job_id=job_id, offset=offset, limit=limit)
Retrieve extraction results
Retrieves extraction results produced by this extractor. If job_id is specified, returns results for that specific extraction run. If job_id is omitted, returns all results produced by this extractor across all runs.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.document_extraction_result import DocumentExtractionResult
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor
job_id = 'job_id_example' # str | Optional job ID to retrieve results for a specific extraction run. If omitted, returns all results for this extractor. (optional)
offset = 0 # int | How many extraction results to skip before returning. (optional) (default to 0)
limit = 56 # int | How many extraction results to return. (optional)
try:
# Retrieve extraction results
api_response = await api_instance.list_extractor_results(extractor_id, job_id=job_id, offset=offset, limit=limit)
print("The response of ExtractorsApi->list_extractor_results:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->list_extractor_results: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor |
|
job_id |
str |
Optional job ID to retrieve results for a specific extraction run. If omitted, returns all results for this extractor. |
[optional] |
offset |
int |
How many extraction results to skip before returning. |
[optional] [default to 0] |
limit |
int |
How many extraction results to return. |
[optional] |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Extraction results retrieved successfully. Returns an array of extraction results. |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Not found |
- |
list_extractors
List[Extractor] list_extractors(offset=offset, limit=limit, name_filter=name_filter)
List extractors.
List extractors. The output is sorted by create time in descending order.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.extractor import Extractor
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
offset = 0 # int | How many extractors to skip before returning. (optional) (default to 0)
limit = 100 # int | How many extractors to return. (optional) (default to 100)
name_filter = 'name_filter_example' # str | Filter extractors by name. (optional)
try:
# List extractors.
api_response = await api_instance.list_extractors(offset=offset, limit=limit, name_filter=name_filter)
print("The response of ExtractorsApi->list_extractors:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->list_extractors: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
offset |
int |
How many extractors to skip before returning. |
[optional] [default to 0] |
limit |
int |
How many extractors to return. |
[optional] [default to 100] |
name_filter |
str |
Filter extractors by name. |
[optional] |
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Successful operation. Fields llm and schema are not populated. |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
run_extractor
List[DocumentExtractionResult] run_extractor(extractor_id, collection_id=collection_id, document_id=document_id, timeout=timeout, files=files)
Run an extractor on a collection, document, or uploaded files (synchronous)
Executes the specified extractor synchronously and returns results with a 200 OK response. Exactly one of the following must be provided: - collection_id — run on all documents in a collection - document_id — run on a single document in a collection - files — one or more files uploaded directly in the request body (multipart/form-data) without adding them to a collection This endpoint blocks and waits for the extraction to complete, then returns the results. This endpoint is primarily intended for short-running extractions where immediate results are desired. For very long running extractions use the async endpoint /extractors/{extractor_id}/job instead.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.document_extraction_result import DocumentExtractionResult
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor to run
collection_id = 'collection_id_example' # str | ID of the collection to run the extractor on. Exactly one of collection_id or document_id must be provided. (optional)
document_id = 'document_id_example' # str | ID of the single document to run the extractor on. Exactly one of collection_id or document_id must be provided. (optional)
timeout = 3.4 # float | Timeout in seconds (optional)
files = None # List[bytearray] | One or more files to run the extractor on directly, without adding them to a collection. Mutually exclusive with collection_id and document_id. (optional)
try:
# Run an extractor on a collection, document, or uploaded files (synchronous)
api_response = await api_instance.run_extractor(extractor_id, collection_id=collection_id, document_id=document_id, timeout=timeout, files=files)
print("The response of ExtractorsApi->run_extractor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->run_extractor: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor to run |
|
collection_id |
str |
ID of the collection to run the extractor on. Exactly one of collection_id or document_id must be provided. |
[optional] |
document_id |
str |
ID of the single document to run the extractor on. Exactly one of collection_id or document_id must be provided. |
[optional] |
timeout |
float |
Timeout in seconds |
[optional] |
files |
List[bytearray] |
One or more files to run the extractor on directly, without adding them to a collection. Mutually exclusive with collection_id and document_id. |
[optional] |
Return type
HTTP request headers
Content-Type: multipart/form-data
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Extraction completed successfully. Returns an array of extraction results, one for each document processed. |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Not found |
- |
update_extractor
Extractor update_extractor(extractor_id, extractor_update_request)
Updates attributes of a given extractor.
Updates an existing extractor. Only the fields present in the request body are changed; any field left out keeps its current value.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.extractor import Extractor
from h2ogpte.rest_async.models.extractor_update_request import ExtractorUpdateRequest
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | ID of the extractor to update.
extractor_update_request = {"name":"Medical data extractor v2","description":"Extracts medical data using Meta Llama 3.1-8B"} # ExtractorUpdateRequest |
try:
# Updates attributes of a given extractor.
api_response = await api_instance.update_extractor(extractor_id, extractor_update_request)
print("The response of ExtractorsApi->update_extractor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ExtractorsApi->update_extractor: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
ID of the extractor to update. |
|
extractor_update_request |
Return type
HTTP request headers
Content-Type: application/json
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
OK |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Not found |
- |
update_extractor_privacy
update_extractor_privacy(extractor_id, update_extractor_privacy_request)
Updates a flag specifying whether an extractor is private or public.
Updates a flag specifying whether an extractor is private or public.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.update_extractor_privacy_request import UpdateExtractorPrivacyRequest
from h2ogpte.rest_async.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_async.Configuration(
host = "https://h2ogpte.genai.h2o.ai/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_async.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = h2ogpte.rest_async.ExtractorsApi(api_client)
extractor_id = 'extractor_id_example' # str | Id of the extractor.
update_extractor_privacy_request = h2ogpte.rest_async.UpdateExtractorPrivacyRequest() # UpdateExtractorPrivacyRequest |
try:
# Updates a flag specifying whether an extractor is private or public.
await api_instance.update_extractor_privacy(extractor_id, update_extractor_privacy_request)
except Exception as e:
print("Exception when calling ExtractorsApi->update_extractor_privacy: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
extractor_id |
str |
Id of the extractor. |
|
update_extractor_privacy_request |
Return type
void (empty response body)
HTTP request headers
Content-Type: application/json
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
204 |
Successful operation |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
409 |
Conflict |
- |