All URIs are relative to https://api.llmpulse.ai/api/v1
| Method | HTTP request | Description |
|---|---|---|
| create_collection | POST /collections | Create a tag |
| delete_collection | DELETE /collections/{id} | Delete a tag |
| update_collection | PATCH /collections/{id} | Update a tag |
create_collection(create_collection_request)
Create a tag
Creates a tag (Collection) in a project. Optional prompt_ids attaches existing prompts in the same call. Tag name must be unique per project (case-insensitive). Requires a read_write scope API key.
- Bearer Authentication (BearerAuth):
import llmpulse
from llmpulse.models.create_collection_request import CreateCollectionRequest
from llmpulse.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.llmpulse.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = llmpulse.Configuration(
host = "https://api.llmpulse.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 = llmpulse.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with llmpulse.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = llmpulse.CollectionsApi(api_client)
create_collection_request = llmpulse.CreateCollectionRequest() # CreateCollectionRequest |
try:
# Create a tag
api_instance.create_collection(create_collection_request)
except Exception as e:
print("Exception when calling CollectionsApi->create_collection: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_collection_request | CreateCollectionRequest |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 403 | API key lacks write permission | - |
| 422 | Invalid parameters | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_collection(project_id, id)
Delete a tag
Deletes a tag/collection. The prompts inside it are NOT deleted; only the grouping disappears. Requires a read_write scope API key.
- Bearer Authentication (BearerAuth):
import llmpulse
from llmpulse.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.llmpulse.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = llmpulse.Configuration(
host = "https://api.llmpulse.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 = llmpulse.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with llmpulse.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = llmpulse.CollectionsApi(api_client)
project_id = 56 # int | Project ID
id = 56 # int |
try:
# Delete a tag
api_instance.delete_collection(project_id, id)
except Exception as e:
print("Exception when calling CollectionsApi->delete_collection: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | int | Project ID | |
| id | int |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Deleted | - |
| 403 | API key lacks write permission | - |
| 404 | Resource not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_collection(id, update_collection_request)
Update a tag
Renames a tag/collection or changes its description. Prompt membership is managed via POST /prompts/assign_tags, not here. Requires a read_write scope API key.
- Bearer Authentication (BearerAuth):
import llmpulse
from llmpulse.models.update_collection_request import UpdateCollectionRequest
from llmpulse.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.llmpulse.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = llmpulse.Configuration(
host = "https://api.llmpulse.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 = llmpulse.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with llmpulse.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = llmpulse.CollectionsApi(api_client)
id = 56 # int |
update_collection_request = llmpulse.UpdateCollectionRequest() # UpdateCollectionRequest |
try:
# Update a tag
api_instance.update_collection(id, update_collection_request)
except Exception as e:
print("Exception when calling CollectionsApi->update_collection: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ||
| update_collection_request | UpdateCollectionRequest |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Updated | - |
| 403 | API key lacks write permission | - |
| 404 | Resource not found | - |
| 422 | Invalid parameters | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]