From bdaed197329961b45f329d725692272df6667bf6 Mon Sep 17 00:00:00 2001
From: enrique Represents the AI Query API. Args:Global Variables
-
+
class
AIQueryApi
class
- AIQueryApi
get_steps
: Gets the steps
- get_tasks_from_agents
: Gets the tasks from the agents
- search_step
: Searches for steps
__init__
__init__(opts: BackendApiOptions)
create_steps
create_steps(did: str, task_id: str, steps: Any)
-Creates steps for a task.
+It creates the step/s required to complete an AI Task. This method is used by the AI Agent to create the steps required to complete the AI Task.
Args:
did
(str): The DID of the service. create_steps
steps
(Any): The steps to create. create_task
create_task(did: str, task: Any, jwt: Optional[str] = None)
-Creates a task for an agent to execute.
+Subscribers can create an AI Task for an Agent. The task must contain the input query that will be used by the AI Agent. This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent. Because only subscribers can create AI Tasks, the method requires the access token to interact with the AI Agent/Service. This is given using the queryOpts
object (accessToken attribute).
Args:
did
(str): The DID of the service. task
(Any): The task to create. jwt
(Optional[str]): The JWT token. Example: + task = { "query": "https://www.youtube.com/watch?v=0tZFQs7qBfQ", "name": "transcribe", "additional_params": [], "artifacts": [] } task = subscriber.ai_protocol.create_task(agent.did, task) print('Task created:', task.json())
+get_step
get_step(step_id: str)
+
+It retrieves all the steps that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user.
+Args:
+did
(str): The DID of the service. task_id
(str): The task ID. step_id
(str): The step ID. get_steps
get_steps(
status: AgentExecutionStatus = <AgentExecutionStatus.Pending: 'Pending'>,
@@ -197,11 +213,11 @@ method get_steps
dids
(List[str]): The list of DIDs.
-
+
method get_steps_from_task
get_steps_from_task(did: str, task_id: str, status: Optional[str] = None)
-Gets the steps from a task.
+It retrieves all the steps that the agent needs to execute to complete a specific task associated to the user. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user.
Args:
did
(str): The DID of the service.
@@ -209,11 +225,12 @@ method get_steps_from_task<
status
(Optional[str]): The status of the steps.
-
+
method get_task_with_steps
get_task_with_steps(did: str, task_id: str, jwt: Optional[str] = None)
-Gets a task with its steps.
+It returns the full task and the steps resulted of the execution of the task.
+This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent.
Args:
did
(str): The DID of the service.
@@ -221,33 +238,33 @@ method get_task_with_steps<
jwt
(Optional[str]): The JWT token.
-
+
method get_tasks_from_agents
get_tasks_from_agents()
-Gets the tasks from the agents.
+It retrieves all the tasks that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user
-
+
method search_step
search_step(search_params: Any)
-Searches for steps.
+It search steps based on the search parameters. The steps belongs to the tasks part of the AI Agents owned by the user. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user.
Args:
search_params
(Any): The search parameters.
-
+
method search_tasks
search_tasks(search_params: Any)
-Searches for tasks.
+It searches tasks based on the search parameters associated to the user.
Args:
search_params
(Any): The search parameters.
-
+
method subscribe
subscribe(
callback: Any,
@@ -257,8 +274,17 @@ method subscribe
get_pending_events_on_subscribe: bool = True
)
+It subscribes to the Nevermined network to retrieve new AI Tasks requested by other users. This method is used by AI agents to subscribe and receive new AI Tasks sent by other subscribers.
+Args:
+
+callback
(Any): The callback function to be called when a new event is received.
+join_account_room
(bool): If True, it will join the account room.
+join_agent_rooms
(Optional[Union[str, List[str]]]): The agent rooms to join.
+subscribe_event_types
(Optional[List[str]]): The event types to subscribe to.
+get_pending_events_on_subscribe
(bool): If True, it will get the pending events on subscribe.
+
-
+
method update_step
update_step(
did: str,
@@ -268,13 +294,13 @@ method update_step
jwt: Optional[str] = None
)
-Updates a step.
+It updates the step with the new information. This method is used by the AI Agent to update the status and output of an step. This method can not be called by a subscriber.
Args:
did
(str): The DID of the service.
task_id
(str): The task ID.
step_id
(str): The step ID.
-step
(Any): The step to update.
+step
(Any): The step object to update. https://docs.nevermined.io/docs/protocol/query-protocol#steps-attributes
jwt
(Optional[str]): The JWT token.
diff --git a/site/index.html b/site/index.html
index a33132f..cd145af 100644
--- a/site/index.html
+++ b/site/index.html
@@ -129,7 +129,7 @@ Classes
data_models.Step
: Represents a step in the execution of a task.
data_models.Task
: Represents a task that an agent should execute, composed of multiple steps.
environments.Environment
: Enum class to define the different environments
-nvm_backend.BackendApiOptions
+nvm_backend.BackendApiOptions
: Represents the backend API options.
nvm_backend.NVMBackendApi
payments.Payments
: A class representing a payment system.
@@ -187,5 +187,5 @@ Functions
diff --git a/site/nvm_backend/index.html b/site/nvm_backend/index.html
index ccbca97..06c1a0a 100644
--- a/site/nvm_backend/index.html
+++ b/site/nvm_backend/index.html
@@ -133,9 +133,17 @@
module nvm_backend
-
+
class BackendApiOptions
-
+Represents the backend API options.
+Args:
+
+environment
(Environment): The environment.
+api_key
(Optional[str]): The Nevermined API Key. This key identify your user and is required to interact with the Nevermined API. You can get your API key by logging in to the Nevermined App. See https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys
+headers
(Optional[Dict[str, str]]): Additional headers to send with the requests
+web_socket_options
(Optional[Dict[str, Any]]): Configuration of the websocket connection
+
+
method __init__
__init__(
environment: Environment,
@@ -145,39 +153,39 @@ method __init__
)
-
+
class NVMBackendApi
-
+
method __init__
__init__(opts: BackendApiOptions)
-
+
method connect_socket
connect_socket()
-
+
method delete
delete(url: str, data: Any)
-
+
method disconnect
disconnect()
-
+
method disconnect_socket
disconnect_socket()
-
+
method get
get(url: str)
-
+
method get_service_token
get_service_token(service_did: str) → ServiceTokenResultDto
@@ -197,32 +205,32 @@ method get_service_tokenExample:
response = your_instance.get_service_token(service_did="did:nv:xyz789") print(response)
-
+
method join_room
join_room(join_account_room: bool, room_ids: Optional[str, List[str]] = None)
-
+
method parse_url_to_backend
parse_url_to_backend(uri: str) → str
-
+
method parse_url_to_proxy
parse_url_to_proxy(uri: str) → str
-
+
method post
post(url: str, data: Any)
-
+
method put
put(url: str, data: Any)
-
+
method set_bearer_token
set_bearer_token(token: str)
diff --git a/site/payments/index.html b/site/payments/index.html
index c183bee..4d1493d 100644
--- a/site/payments/index.html
+++ b/site/payments/index.html
@@ -182,11 +182,12 @@ method __init__
)
burn_credits
burn_credits(plan_did: str, amount: str) → BurnResultDto
-Burns credits associated with a plan that you own.
+Burn credits for a given Payment Plan DID.
+This method is only can be called by the owner of the Payment Plan.
Args:
plan_did
(str): The DID of the plan. create_credits_plan<
tags: Optional[List[str]] = None
) → CreateAssetResultDto
-Creates a new credits plan.
+It allows to an AI Builder to create a Payment Plan on Nevermined based on Credits. A Nevermined Credits Plan limits the access by the access/usage of the Plan. With them, AI Builders control the number of requests that can be made to an agent or service. Every time a user accesses any resouce associated to the Payment Plan, the usage consumes from a capped amount of credits. When the user consumes all the credits, the plan automatically expires and the user needs to top up to continue using the service.
+This method is oriented to AI Builders.
+https://docs.nevermined.app/docs/tutorials/builders/create-plan
Args:
name
(str): The name of the plan. create_credits_plan<
Example:
response = your_instance.create_credits_plan(name="Basic Plan", description="100 credits plan", price=1, token_address="0x1234", amount_of_credits=100, tags=["basic"]) print(response)
-
+
method create_file
create_file(
plan_did: str,
@@ -257,7 +260,9 @@ method create_file
tags: Optional[List[str]] = None
) → CreateAssetResultDto
-Creates a new file.
+It creates a new asset with file associated to it. The file asset must be associated to a Payment Plan. Users that are subscribers of a payment plan can download the files attached to it. Depending on the Payment Plan and the configuration of the file asset, the download will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue downloading the files.
+This method is oriented to AI Builders
+https://docs.nevermined.app/docs/tutorials/builders/register-file-asset
Args:
plan_did
(str): The DID of the plan.
@@ -289,7 +294,7 @@ method create_file
Example:
response = your_instance.create_file(plan_did="did:nv:xyz789", asset_type="dataset", name="Sample Dataset", description="A sample dataset", files=[{"name": "file1.csv", "url": "https://example.com/file1.csv"}]) print(response)
-
+
method create_service
create_service(
plan_did: str,
@@ -317,7 +322,9 @@ method create_service
-Creates a new service.
+It creates a new AI Agent or Service on Nevermined. The agent/service must be associated to a Payment Plan. Users that are subscribers of a payment plan can access the agent/service. Depending on the Payment Plan and the configuration of the agent/service, the usage of the agent/service will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue using the agent/service.
+This method is oriented to AI Builders
+https://docs.nevermined.app/docs/tutorials/builders/register-agent
Args:
plan_did
(str): The DID of the plan.
@@ -355,7 +362,7 @@ method create_service
Example:
response = your_instance.create_service(plan_did="did:nv:abc123", service_type="service", name="My Service", description="A sample service", service_charge_type="fixed", auth_type="none") print(response)
-
+
method create_time_plan
create_time_plan(
name: str,
@@ -366,7 +373,9 @@ method create_time_plan
tags: Optional[List[str]] = None
) → CreateAssetResultDto
-Creates a new time plan.
+It allows to an AI Builder to create a Payment Plan on Nevermined based on Time. A Nevermined Time Plan limits the access by the a specific amount of time. With them, AI Builders can specify the duration of the Payment Plan (1 month, 1 year, etc.). When the time period is over, the plan automatically expires and the user needs to renew it.
+This method is oriented to AI Builders
+https://docs.nevermined.app/docs/tutorials/builders/create-plan
Args:
name
(str): The name of the plan.
@@ -387,7 +396,7 @@ method create_time_plan
Example:
response = your_instance.create_time_plan(name="Yearly Plan", description="Annual plan", price=1200, token_address="0x5678", duration=365, tags=["yearly", "premium"]) print(response)
-
+
method download_file
download_file(
file_did: str,
@@ -417,21 +426,22 @@ method download_file
Example:
response = your_instance.download_file(file_did="did:nv:7e38d39405445ab3e5435d8c1c6653a00ddc425ba629789f58fbefccaa5e5a5d", destination="/tmp") print(response)
-
+
method get_asset_ddo
get_asset_ddo(did: str)
-Gets the asset DDO.
+Get the Metadata (aka Decentralized Document or DDO) for a given asset identifier (DID).
+https://docs.nevermined.io/docs/architecture/specs/Spec-DID https://docs.nevermined.io/docs/architecture/specs/Spec-METADATA
Args:
-did
(str): The DID of the asset.
+did
(str): The unique identifier (aka DID) of the asset (payment plan, agent, file, etc).
Returns:
Response
: The response from the API call.
-
+
method get_checkout_plan
get_checkout_plan(plan_did: str)
@@ -445,7 +455,7 @@ method get_checkout_planResponse
: The url of the checkout plan.
get_file_details_url
get_file_details_url(file_did: str)
@@ -459,11 +469,11 @@ get_file_details_ur
Response
: The url of the file details.
-
+
method get_plan_associated_files
get_plan_associated_files(plan_did: str)
-Gets the plan associated files.
+Get array of files DIDs associated with a payment plan.
Args:
plan_did
(str): The DID of the plan.
@@ -473,11 +483,11 @@ method get_plan_assoc
Response
: List of DIDs of the associated files.
-
+
method get_plan_associated_services
get_plan_associated_services(plan_did: str)
-Gets the plan associated services.
+Get array of services/agent DIDs associated with a payment plan.
Args:
plan_did
(str): The DID of the plan.
@@ -487,11 +497,11 @@ method get_plan_as
Response
: List of DIDs of the associated services.
-
+
method get_plan_balance
get_plan_balance(plan_did: str, account_address: str) → BalanceResultDto
-Gets the plan balance.
+Get the balance of an account for a Payment Plan.
Args:
plan_did
(str): The DID of the plan.
@@ -509,7 +519,7 @@ method get_plan_balance
response = your_instance.get_plan_balance(plan_did="did:example:123456", account_address="0xABC123") response.raise_for_status() balance = BalanceResultDto.model_validate(response.json()) print(balance)
Expected Response: { "planType": "credits", "isOwner": True, "isSubscriptor": True, "balance": 10000000 }
-
+
method get_plan_details_url
get_plan_details_url(plan_did: str)
@@ -523,7 +533,7 @@ method get_plan_details_ur
Response
: The url of the plan details.
-
+
method get_service_details_url
get_service_details_url(service_did: str)
@@ -537,11 +547,13 @@ method get_service_deta
Response
: The url of the service details.
-
+
method get_service_token
get_service_token(service_did: str) → ServiceTokenResultDto
-Gets the service token.
+Get the required configuration for accessing a remote service agent. This configuration includes:
+ - The JWT access token
+ - The Proxy url that can be used to query the agent/service.
Args:
service_did
(str): The DID of the service.
@@ -557,7 +569,7 @@ method get_service_tokenExample:
response = your_instance.get_service_token(service_did="did:nv:xyz789") print(response)
-
+
method mint_credits
mint_credits(plan_did: str, amount: str, receiver: str) → MintResultDto
@@ -579,14 +591,15 @@ method mint_credits
Example:
response = your_instance.mint_credits(plan_did="did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5", amount="12", receiver="0x4fe3e7d42fA83be4E8cF03451Ac3F25980a73fF6") print(response)
-
+
method order_plan
order_plan(
plan_did: str,
agreementId: Optional[str] = None
) → OrderPlanResultDto
-Orders the plan.
+Orders a Payment Plan. The user needs to have enough balance in the token selected by the owner of the Payment Plan.
+The payment is done using Crypto. Payments using Fiat can be done via the Nevermined App.
Args:
plan_did
(str): The DID of the plan.
diff --git a/site/search/search_index.json b/site/search/search_index.json
index 601ea55..6cce14f 100644
--- a/site/search/search_index.json
+++ b/site/search/search_index.json
@@ -1 +1 @@
-{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"API Overview Modules ai_query_api data_models environments nvm_backend payments utils Classes ai_query_api.AIQueryApi : Represents the AI Query API. data_models.AgentExecutionStatus : An enumeration. data_models.Artifact : Represents an artifact with a unique identifier and a URL reference. data_models.BalanceResultDto data_models.BurnResultDto data_models.CreateAssetResultDto data_models.DownloadFileResultDto data_models.ExecutionInput : Represents the input for a task, such as a query and additional parameters or artifacts. data_models.ExecutionOptions : Represents options for executing a task or step, such as input, status, and output. data_models.ExecutionOutput : Represents the output of a task or step execution. data_models.MintResultDto data_models.OrderPlanResultDto data_models.PlanType : An enumeration. data_models.ServiceTokenResultDto data_models.Step : Represents a step in the execution of a task. data_models.Task : Represents a task that an agent should execute, composed of multiple steps. environments.Environment : Enum class to define the different environments nvm_backend.BackendApiOptions nvm_backend.NVMBackendApi payments.Payments : A class representing a payment system. Functions utils.snake_to_camel : Convert snake_case to camelCase. This file was automatically generated via lazydocs .","title":"Overview"},{"location":"#api-overview","text":"","title":"API Overview"},{"location":"#modules","text":"ai_query_api data_models environments nvm_backend payments utils","title":"Modules"},{"location":"#classes","text":"ai_query_api.AIQueryApi : Represents the AI Query API. data_models.AgentExecutionStatus : An enumeration. data_models.Artifact : Represents an artifact with a unique identifier and a URL reference. data_models.BalanceResultDto data_models.BurnResultDto data_models.CreateAssetResultDto data_models.DownloadFileResultDto data_models.ExecutionInput : Represents the input for a task, such as a query and additional parameters or artifacts. data_models.ExecutionOptions : Represents options for executing a task or step, such as input, status, and output. data_models.ExecutionOutput : Represents the output of a task or step execution. data_models.MintResultDto data_models.OrderPlanResultDto data_models.PlanType : An enumeration. data_models.ServiceTokenResultDto data_models.Step : Represents a step in the execution of a task. data_models.Task : Represents a task that an agent should execute, composed of multiple steps. environments.Environment : Enum class to define the different environments nvm_backend.BackendApiOptions nvm_backend.NVMBackendApi payments.Payments : A class representing a payment system.","title":"Classes"},{"location":"#functions","text":"utils.snake_to_camel : Convert snake_case to camelCase. This file was automatically generated via lazydocs .","title":"Functions"},{"location":"ai_query_api/","text":"module ai_query_api Global Variables SEARCH_TASKS_ENDPOINT SEARCH_STEPS_ENDPOINT CREATE_STEPS_ENDPOINT UPDATE_STEP_ENDPOINT GET_AGENTS_ENDPOINT GET_BUILDER_STEPS_ENDPOINT GET_TASK_STEPS_ENDPOINT TASK_ENDPOINT GET_TASK_ENDPOINT class AIQueryApi Represents the AI Query API. Args: opts (BackendApiOptions): The backend API options Methods: - create_task : Creates a task for an agent to execute - create_steps : Creates steps for a task - update_step : Updates a step - search_tasks : Searches for tasks - get_task_with_steps : Gets a task with its steps - get_steps_from_task : Gets the steps from a task - get_steps : Gets the steps - get_tasks_from_agents : Gets the tasks from the agents - search_step : Searches for steps method __init__ __init__(opts: BackendApiOptions) method create_steps create_steps(did: str, task_id: str, steps: Any) Creates steps for a task. Args: did (str): The DID of the service. task_id (str): The task ID. steps (Any): The steps to create. method create_task create_task(did: str, task: Any, jwt: Optional[str] = None) Creates a task for an agent to execute. Args: did (str): The DID of the service. task (Any): The task to create. jwt (Optional[str]): The JWT token. method get_steps get_steps( status: AgentExecutionStatus = , dids: List[str] = [] ) Gets the steps. Args: status (AgentExecutionStatus): The status of the steps. dids (List[str]): The list of DIDs. method get_steps_from_task get_steps_from_task(did: str, task_id: str, status: Optional[str] = None) Gets the steps from a task. Args: did (str): The DID of the service. task_id (str): The task ID. status (Optional[str]): The status of the steps. method get_task_with_steps get_task_with_steps(did: str, task_id: str, jwt: Optional[str] = None) Gets a task with its steps. Args: did (str): The DID of the service. task_id (str): The task ID. jwt (Optional[str]): The JWT token. method get_tasks_from_agents get_tasks_from_agents() Gets the tasks from the agents. method search_step search_step(search_params: Any) Searches for steps. Args: search_params (Any): The search parameters. method search_tasks search_tasks(search_params: Any) Searches for tasks. Args: search_params (Any): The search parameters. method subscribe subscribe( callback: Any, join_account_room: bool = True, join_agent_rooms: Optional[str, List[str]] = None, subscribe_event_types: Optional[List[str]] = None, get_pending_events_on_subscribe: bool = True ) method update_step update_step( did: str, task_id: str, step_id: str, step: Any, jwt: Optional[str] = None ) Updates a step. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID. step (Any): The step to update. jwt (Optional[str]): The JWT token. This file was automatically generated via lazydocs .","title":"Ai query api"},{"location":"ai_query_api/#module-ai_query_api","text":"","title":"module ai_query_api"},{"location":"ai_query_api/#global-variables","text":"SEARCH_TASKS_ENDPOINT SEARCH_STEPS_ENDPOINT CREATE_STEPS_ENDPOINT UPDATE_STEP_ENDPOINT GET_AGENTS_ENDPOINT GET_BUILDER_STEPS_ENDPOINT GET_TASK_STEPS_ENDPOINT TASK_ENDPOINT GET_TASK_ENDPOINT","title":"Global Variables"},{"location":"ai_query_api/#class-aiqueryapi","text":"Represents the AI Query API. Args: opts (BackendApiOptions): The backend API options Methods: - create_task : Creates a task for an agent to execute - create_steps : Creates steps for a task - update_step : Updates a step - search_tasks : Searches for tasks - get_task_with_steps : Gets a task with its steps - get_steps_from_task : Gets the steps from a task - get_steps : Gets the steps - get_tasks_from_agents : Gets the tasks from the agents - search_step : Searches for steps","title":"class AIQueryApi"},{"location":"ai_query_api/#method-__init__","text":"__init__(opts: BackendApiOptions)","title":"method __init__"},{"location":"ai_query_api/#method-create_steps","text":"create_steps(did: str, task_id: str, steps: Any) Creates steps for a task. Args: did (str): The DID of the service. task_id (str): The task ID. steps (Any): The steps to create.","title":"method create_steps"},{"location":"ai_query_api/#method-create_task","text":"create_task(did: str, task: Any, jwt: Optional[str] = None) Creates a task for an agent to execute. Args: did (str): The DID of the service. task (Any): The task to create. jwt (Optional[str]): The JWT token.","title":"method create_task"},{"location":"ai_query_api/#method-get_steps","text":"get_steps( status: AgentExecutionStatus = , dids: List[str] = [] ) Gets the steps. Args: status (AgentExecutionStatus): The status of the steps. dids (List[str]): The list of DIDs.","title":"method get_steps"},{"location":"ai_query_api/#method-get_steps_from_task","text":"get_steps_from_task(did: str, task_id: str, status: Optional[str] = None) Gets the steps from a task. Args: did (str): The DID of the service. task_id (str): The task ID. status (Optional[str]): The status of the steps.","title":"method get_steps_from_task"},{"location":"ai_query_api/#method-get_task_with_steps","text":"get_task_with_steps(did: str, task_id: str, jwt: Optional[str] = None) Gets a task with its steps. Args: did (str): The DID of the service. task_id (str): The task ID. jwt (Optional[str]): The JWT token.","title":"method get_task_with_steps"},{"location":"ai_query_api/#method-get_tasks_from_agents","text":"get_tasks_from_agents() Gets the tasks from the agents.","title":"method get_tasks_from_agents"},{"location":"ai_query_api/#method-search_step","text":"search_step(search_params: Any) Searches for steps. Args: search_params (Any): The search parameters.","title":"method search_step"},{"location":"ai_query_api/#method-search_tasks","text":"search_tasks(search_params: Any) Searches for tasks. Args: search_params (Any): The search parameters.","title":"method search_tasks"},{"location":"ai_query_api/#method-subscribe","text":"subscribe( callback: Any, join_account_room: bool = True, join_agent_rooms: Optional[str, List[str]] = None, subscribe_event_types: Optional[List[str]] = None, get_pending_events_on_subscribe: bool = True )","title":"method subscribe"},{"location":"ai_query_api/#method-update_step","text":"update_step( did: str, task_id: str, step_id: str, step: Any, jwt: Optional[str] = None ) Updates a step. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID. step (Any): The step to update. jwt (Optional[str]): The JWT token. This file was automatically generated via lazydocs .","title":"method update_step"},{"location":"data_models/","text":"module data_models Global Variables FIRST_STEP_NAME LAST_STEP_NAME class PlanType An enumeration. class BalanceResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class MintResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class BurnResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class CreateAssetResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class DownloadFileResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class OrderPlanResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class ServiceTokenResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class AgentExecutionStatus An enumeration. class Artifact Represents an artifact with a unique identifier and a URL reference. class ExecutionInput Represents the input for a task, such as a query and additional parameters or artifacts. class ExecutionOutput Represents the output of a task or step execution. class ExecutionOptions Represents options for executing a task or step, such as input, status, and output. class Step Represents a step in the execution of a task. class Task Represents a task that an agent should execute, composed of multiple steps. This file was automatically generated via lazydocs .","title":"Data models"},{"location":"data_models/#module-data_models","text":"","title":"module data_models"},{"location":"data_models/#global-variables","text":"FIRST_STEP_NAME LAST_STEP_NAME","title":"Global Variables"},{"location":"data_models/#class-plantype","text":"An enumeration.","title":"class PlanType"},{"location":"data_models/#class-balanceresultdto","text":"","title":"class BalanceResultDto"},{"location":"data_models/#property-model_extra","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-mintresultdto","text":"","title":"class MintResultDto"},{"location":"data_models/#property-model_extra_1","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_1","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-burnresultdto","text":"","title":"class BurnResultDto"},{"location":"data_models/#property-model_extra_2","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_2","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-createassetresultdto","text":"","title":"class CreateAssetResultDto"},{"location":"data_models/#property-model_extra_3","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_3","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-downloadfileresultdto","text":"","title":"class DownloadFileResultDto"},{"location":"data_models/#property-model_extra_4","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_4","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-orderplanresultdto","text":"","title":"class OrderPlanResultDto"},{"location":"data_models/#property-model_extra_5","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_5","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-servicetokenresultdto","text":"","title":"class ServiceTokenResultDto"},{"location":"data_models/#property-model_extra_6","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_6","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-agentexecutionstatus","text":"An enumeration.","title":"class AgentExecutionStatus"},{"location":"data_models/#class-artifact","text":"Represents an artifact with a unique identifier and a URL reference.","title":"class Artifact"},{"location":"data_models/#class-executioninput","text":"Represents the input for a task, such as a query and additional parameters or artifacts.","title":"class ExecutionInput"},{"location":"data_models/#class-executionoutput","text":"Represents the output of a task or step execution.","title":"class ExecutionOutput"},{"location":"data_models/#class-executionoptions","text":"Represents options for executing a task or step, such as input, status, and output.","title":"class ExecutionOptions"},{"location":"data_models/#class-step","text":"Represents a step in the execution of a task.","title":"class Step"},{"location":"data_models/#class-task","text":"Represents a task that an agent should execute, composed of multiple steps. This file was automatically generated via lazydocs .","title":"class Task"},{"location":"environments/","text":"module environments class Environment Enum class to define the different environments Attributes: local : Local environment appStaging : Staging environment appTesting : Testing environment appArbitrum : Arbitrum environment appPeaq : Peaq network This file was automatically generated via lazydocs .","title":"Environments"},{"location":"environments/#module-environments","text":"","title":"module environments"},{"location":"environments/#class-environment","text":"Enum class to define the different environments Attributes: local : Local environment appStaging : Staging environment appTesting : Testing environment appArbitrum : Arbitrum environment appPeaq : Peaq network This file was automatically generated via lazydocs .","title":"class Environment"},{"location":"nvm_backend/","text":"module nvm_backend class BackendApiOptions method __init__ __init__( environment: Environment, api_key: Optional[str] = None, headers: Optional[Dict[str, str]] = None, web_socket_options: Optional[Dict[str, Any]] = None ) class NVMBackendApi method __init__ __init__(opts: BackendApiOptions) method connect_socket connect_socket() method delete delete(url: str, data: Any) method disconnect disconnect() method disconnect_socket disconnect_socket() method get get(url: str) method get_service_token get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response) method join_room join_room(join_account_room: bool, room_ids: Optional[str, List[str]] = None) method parse_url_to_backend parse_url_to_backend(uri: str) \u2192 str method parse_url_to_proxy parse_url_to_proxy(uri: str) \u2192 str method post post(url: str, data: Any) method put put(url: str, data: Any) method set_bearer_token set_bearer_token(token: str) This file was automatically generated via lazydocs .","title":"Nvm backend"},{"location":"nvm_backend/#module-nvm_backend","text":"","title":"module nvm_backend"},{"location":"nvm_backend/#class-backendapioptions","text":"","title":"class BackendApiOptions"},{"location":"nvm_backend/#method-__init__","text":"__init__( environment: Environment, api_key: Optional[str] = None, headers: Optional[Dict[str, str]] = None, web_socket_options: Optional[Dict[str, Any]] = None )","title":"method __init__"},{"location":"nvm_backend/#class-nvmbackendapi","text":"","title":"class NVMBackendApi"},{"location":"nvm_backend/#method-__init___1","text":"__init__(opts: BackendApiOptions)","title":"method __init__"},{"location":"nvm_backend/#method-connect_socket","text":"connect_socket()","title":"method connect_socket"},{"location":"nvm_backend/#method-delete","text":"delete(url: str, data: Any)","title":"method delete"},{"location":"nvm_backend/#method-disconnect","text":"disconnect()","title":"method disconnect"},{"location":"nvm_backend/#method-disconnect_socket","text":"disconnect_socket()","title":"method disconnect_socket"},{"location":"nvm_backend/#method-get","text":"get(url: str)","title":"method get"},{"location":"nvm_backend/#method-get_service_token","text":"get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response)","title":"method get_service_token"},{"location":"nvm_backend/#method-join_room","text":"join_room(join_account_room: bool, room_ids: Optional[str, List[str]] = None)","title":"method join_room"},{"location":"nvm_backend/#method-parse_url_to_backend","text":"parse_url_to_backend(uri: str) \u2192 str","title":"method parse_url_to_backend"},{"location":"nvm_backend/#method-parse_url_to_proxy","text":"parse_url_to_proxy(uri: str) \u2192 str","title":"method parse_url_to_proxy"},{"location":"nvm_backend/#method-post","text":"post(url: str, data: Any)","title":"method post"},{"location":"nvm_backend/#method-put","text":"put(url: str, data: Any)","title":"method put"},{"location":"nvm_backend/#method-set_bearer_token","text":"set_bearer_token(token: str) This file was automatically generated via lazydocs .","title":"method set_bearer_token"},{"location":"payments/","text":"module payments class Payments A class representing a payment system. Attributes: nvm_api_key (str): The nvm api key for authentication. environment (Environment): The environment for the payment system. app_id (str, optional): The application ID. version (str, optional): The version of the payment system. ai_protocol (bool): Indicates if the AI protocol is enabled. headers (dict, optional): The headers for the payment system. web_socket_options (dict, optional): The web socket options for the payment system. Methods: - create_credits_plan : Creates a new credits plan. - create_time_plan : Creates a new time plan. - create_service : Creates a new service. - create_file : Creates a new file. - order_plan : Orders the plan. - get_asset_ddo : Gets the asset DDO. - get_plan_balance : Gets the plan balance. - get_service_token : Gets the service token. - get_plan_associated_services : Gets the plan associated services. - get_plan_associated_files : Gets the plan associated files. - get_plan_details : Gets the plan details. - get_service_details : Gets the service details. - get_file_details : Gets the file details. - get_checkout_plan : Gets the checkout plan. - download_file : Downloads the file. - mint_credits : Mints the credits associated to a plan and send to the receiver. - burn_credits : Burns credits associated to a plan that you own. - ai_protocol : The AI Query API. method __init__ __init__( nvm_api_key: str, environment: Environment, app_id: Optional[str] = None, version: Optional[str] = None, ai_protocol: bool = False, headers: Optional[dict] = None, web_socket_options: Optional[dict] = None ) method burn_credits burn_credits(plan_did: str, amount: str) \u2192 BurnResultDto Burns credits associated with a plan that you own. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to burn. Returns: BurnResultDto : The result of the burning operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.burn_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\") print(response) method create_credits_plan create_credits_plan( name: str, description: str, price: int, token_address: str, amount_of_credits: int, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new credits plan. Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. amount_of_credits (int): The amount of credits for the plan. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_credits_plan(name=\"Basic Plan\", description=\"100 credits plan\", price=1, token_address=\"0x1234\", amount_of_credits=100, tags=[\"basic\"]) print(response) method create_file create_file( plan_did: str, asset_type: str, name: str, description: str, files: List[dict], data_schema: Optional[str] = None, sample_code: Optional[str] = None, files_format: Optional[str] = None, usage_example: Optional[str] = None, programming_language: Optional[str] = None, framework: Optional[str] = None, task: Optional[str] = None, training_details: Optional[str] = None, variations: Optional[str] = None, fine_tunable: Optional[bool] = None, amount_of_credits: Optional[int] = None, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new file. Args: plan_did (str): The DID of the plan. asset_type (str): The type of the asset. -> 'algorithm' | 'model' | 'dataset' | 'file' name (str): The name of the file. description (str): The description of the file. files (List[dict]): The files of the file. data_schema (str, optional): The data schema of the file. sample_code (str, optional): The sample code of the file. files_format (str, optional): The files format of the file. usage_example (str, optional): The usage example of the file. programming_language (str, optional): The programming language of the file. framework (str, optional): The framework of the file. task (str, optional): The task of the file. training_details (str, optional): The training details of the file. variations (str, optional): The variations of the file. fine_tunable (bool, optional): The fine tunable of the file. amount_of_credits (int, optional): The amount of credits for the file. tags (List[str], optional): The tags associated with the file. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_file(plan_did=\"did:nv:xyz789\", asset_type=\"dataset\", name=\"Sample Dataset\", description=\"A sample dataset\", files=[{\"name\": \"file1.csv\", \"url\": \"https://example.com/file1.csv\"}]) print(response) method create_service create_service( plan_did: str, service_type: str, name: str, description: str, service_charge_type: str, auth_type: str, amount_of_credits: int = 1, min_credits_to_charge: Optional[int] = 1, max_credits_to_charge: Optional[int] = 1, username: Optional[str] = None, password: Optional[str] = None, token: Optional[str] = None, endpoints: Optional[List[dict]] = None, open_endpoints: Optional[List[str]] = [], open_api_url: Optional[str] = None, integration: Optional[str] = None, sample_link: Optional[str] = None, api_description: Optional[str] = None, tags: Optional[List[str]] = None, is_nevermined_hosted: Optional[bool] = None, implements_query_protocol: Optional[bool] = None, query_protocol_version: Optional[str] = None, service_host: Optional[str] = None ) \u2192 CreateAssetResultDto Creates a new service. Args: plan_did (str): The DID of the plan. service_type (str): The type of the service. Options: 'service', 'agent', 'assistant' name (str): The name of the service. description (str): The description of the service. service_charge_type (str): The charge type of the service. Options: 'fixed', 'dynamic' auth_type (str): The authentication type of the service. Options: 'none', 'basic', 'oauth' amount_of_credits (int): The amount of credits for the service. min_credits_to_charge (int, optional): The minimum credits to charge for the service. Only required for dynamic services. max_credits_to_charge (int, optional): The maximum credits to charge for the service. Only required for dynamic services. username (str, optional): The username for authentication. password (str, optional): The password for authentication. token (str, optional): The token for authentication. endpoints (List[Dict[str, str]], optional): The endpoints of the service. open_endpoints (List[str], optional): The open endpoints of the service. open_api_url (str, optional): The OpenAPI URL of the service. integration (str, optional): The integration type of the service. sample_link (str, optional): The sample link of the service. api_description (str, optional): The API description of the service. tags (List[str], optional): The tags associated with the service. is_nevermined_hosted (bool, optional): Indicates if the service is hosted by Nevermined. implements_query_protocol (bool, optional): Indicates if the service implements the query protocol. query_protocol_version (str, optional): The version of the query protocol implemented by the service. service_host (str, optional): The host of the service. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_service(plan_did=\"did:nv:abc123\", service_type=\"service\", name=\"My Service\", description=\"A sample service\", service_charge_type=\"fixed\", auth_type=\"none\") print(response) method create_time_plan create_time_plan( name: str, description: str, price: int, token_address: str, duration: Optional[int] = 0, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new time plan. Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. duration (int, optional): The duration of the plan in days. If not provided, the plan will be valid forever. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_time_plan(name=\"Yearly Plan\", description=\"Annual plan\", price=1200, token_address=\"0x5678\", duration=365, tags=[\"yearly\", \"premium\"]) print(response) method download_file download_file( file_did: str, destination: str, agreement_id: Optional[str] = None ) \u2192 DownloadFileResultDto Downloads the file. Args: file_did (str): The DID of the file. agreement_id (str, optional): The agreement ID. destination str : The destination of the file. Returns: Response : The url of the file. Returns: DownloadFileResultDto : The result of the download operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.download_file(file_did=\"did:nv:7e38d39405445ab3e5435d8c1c6653a00ddc425ba629789f58fbefccaa5e5a5d\", destination=\"/tmp\") print(response) method get_asset_ddo get_asset_ddo(did: str) Gets the asset DDO. Args: did (str): The DID of the asset. Returns: Response : The response from the API call. method get_checkout_plan get_checkout_plan(plan_did: str) Gets the checkout plan. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the checkout plan. method get_file_details_url get_file_details_url(file_did: str) Gets the file details. Args: file_did (str): The DID of the file. Returns: Response : The url of the file details. method get_plan_associated_files get_plan_associated_files(plan_did: str) Gets the plan associated files. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated files. method get_plan_associated_services get_plan_associated_services(plan_did: str) Gets the plan associated services. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated services. method get_plan_balance get_plan_balance(plan_did: str, account_address: str) \u2192 BalanceResultDto Gets the plan balance. Args: plan_did (str): The DID of the plan. account_address (str): The account address. Returns: BalanceResultDto : The response from the API call formatted as a BalanceResultDto. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_plan_balance(plan_did=\"did:example:123456\", account_address=\"0xABC123\") response.raise_for_status() balance = BalanceResultDto.model_validate(response.json()) print(balance) Expected Response: { \"planType\": \"credits\", \"isOwner\": True, \"isSubscriptor\": True, \"balance\": 10000000 } method get_plan_details_url get_plan_details_url(plan_did: str) Gets the plan details. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the plan details. method get_service_details_url get_service_details_url(service_did: str) Gets the service details. Args: service_did (str): The DID of the service. Returns: Response : The url of the service details. method get_service_token get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response) method mint_credits mint_credits(plan_did: str, amount: str, receiver: str) \u2192 MintResultDto Mints the credits associated with a plan and sends them to the receiver. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to mint. receiver (str): The receiver address of the credits. Returns: MintResultDto : The result of the minting operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.mint_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\", receiver=\"0x4fe3e7d42fA83be4E8cF03451Ac3F25980a73fF6\") print(response) method order_plan order_plan( plan_did: str, agreementId: Optional[str] = None ) \u2192 OrderPlanResultDto Orders the plan. Args: plan_did (str): The DID of the plan. agreementId (str, optional): The agreement ID. Returns: OrderPlanResultDto : The result of the order operation, containing the agreement ID and success status. Raises: HTTPError : If the API call fails. Example: response = your_instance.order_plan(plan_did=\"did:nv:a0079b517e580d430916924f1940b764e17c31e368c509483426f8c2ac2e7116\") print(response) This file was automatically generated via lazydocs .","title":"Payments"},{"location":"payments/#module-payments","text":"","title":"module payments"},{"location":"payments/#class-payments","text":"A class representing a payment system. Attributes: nvm_api_key (str): The nvm api key for authentication. environment (Environment): The environment for the payment system. app_id (str, optional): The application ID. version (str, optional): The version of the payment system. ai_protocol (bool): Indicates if the AI protocol is enabled. headers (dict, optional): The headers for the payment system. web_socket_options (dict, optional): The web socket options for the payment system. Methods: - create_credits_plan : Creates a new credits plan. - create_time_plan : Creates a new time plan. - create_service : Creates a new service. - create_file : Creates a new file. - order_plan : Orders the plan. - get_asset_ddo : Gets the asset DDO. - get_plan_balance : Gets the plan balance. - get_service_token : Gets the service token. - get_plan_associated_services : Gets the plan associated services. - get_plan_associated_files : Gets the plan associated files. - get_plan_details : Gets the plan details. - get_service_details : Gets the service details. - get_file_details : Gets the file details. - get_checkout_plan : Gets the checkout plan. - download_file : Downloads the file. - mint_credits : Mints the credits associated to a plan and send to the receiver. - burn_credits : Burns credits associated to a plan that you own. - ai_protocol : The AI Query API.","title":"class Payments"},{"location":"payments/#method-__init__","text":"__init__( nvm_api_key: str, environment: Environment, app_id: Optional[str] = None, version: Optional[str] = None, ai_protocol: bool = False, headers: Optional[dict] = None, web_socket_options: Optional[dict] = None )","title":"method __init__"},{"location":"payments/#method-burn_credits","text":"burn_credits(plan_did: str, amount: str) \u2192 BurnResultDto Burns credits associated with a plan that you own. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to burn. Returns: BurnResultDto : The result of the burning operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.burn_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\") print(response)","title":"method burn_credits"},{"location":"payments/#method-create_credits_plan","text":"create_credits_plan( name: str, description: str, price: int, token_address: str, amount_of_credits: int, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new credits plan. Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. amount_of_credits (int): The amount of credits for the plan. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_credits_plan(name=\"Basic Plan\", description=\"100 credits plan\", price=1, token_address=\"0x1234\", amount_of_credits=100, tags=[\"basic\"]) print(response)","title":"method create_credits_plan"},{"location":"payments/#method-create_file","text":"create_file( plan_did: str, asset_type: str, name: str, description: str, files: List[dict], data_schema: Optional[str] = None, sample_code: Optional[str] = None, files_format: Optional[str] = None, usage_example: Optional[str] = None, programming_language: Optional[str] = None, framework: Optional[str] = None, task: Optional[str] = None, training_details: Optional[str] = None, variations: Optional[str] = None, fine_tunable: Optional[bool] = None, amount_of_credits: Optional[int] = None, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new file. Args: plan_did (str): The DID of the plan. asset_type (str): The type of the asset. -> 'algorithm' | 'model' | 'dataset' | 'file' name (str): The name of the file. description (str): The description of the file. files (List[dict]): The files of the file. data_schema (str, optional): The data schema of the file. sample_code (str, optional): The sample code of the file. files_format (str, optional): The files format of the file. usage_example (str, optional): The usage example of the file. programming_language (str, optional): The programming language of the file. framework (str, optional): The framework of the file. task (str, optional): The task of the file. training_details (str, optional): The training details of the file. variations (str, optional): The variations of the file. fine_tunable (bool, optional): The fine tunable of the file. amount_of_credits (int, optional): The amount of credits for the file. tags (List[str], optional): The tags associated with the file. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_file(plan_did=\"did:nv:xyz789\", asset_type=\"dataset\", name=\"Sample Dataset\", description=\"A sample dataset\", files=[{\"name\": \"file1.csv\", \"url\": \"https://example.com/file1.csv\"}]) print(response)","title":"method create_file"},{"location":"payments/#method-create_service","text":"create_service( plan_did: str, service_type: str, name: str, description: str, service_charge_type: str, auth_type: str, amount_of_credits: int = 1, min_credits_to_charge: Optional[int] = 1, max_credits_to_charge: Optional[int] = 1, username: Optional[str] = None, password: Optional[str] = None, token: Optional[str] = None, endpoints: Optional[List[dict]] = None, open_endpoints: Optional[List[str]] = [], open_api_url: Optional[str] = None, integration: Optional[str] = None, sample_link: Optional[str] = None, api_description: Optional[str] = None, tags: Optional[List[str]] = None, is_nevermined_hosted: Optional[bool] = None, implements_query_protocol: Optional[bool] = None, query_protocol_version: Optional[str] = None, service_host: Optional[str] = None ) \u2192 CreateAssetResultDto Creates a new service. Args: plan_did (str): The DID of the plan. service_type (str): The type of the service. Options: 'service', 'agent', 'assistant' name (str): The name of the service. description (str): The description of the service. service_charge_type (str): The charge type of the service. Options: 'fixed', 'dynamic' auth_type (str): The authentication type of the service. Options: 'none', 'basic', 'oauth' amount_of_credits (int): The amount of credits for the service. min_credits_to_charge (int, optional): The minimum credits to charge for the service. Only required for dynamic services. max_credits_to_charge (int, optional): The maximum credits to charge for the service. Only required for dynamic services. username (str, optional): The username for authentication. password (str, optional): The password for authentication. token (str, optional): The token for authentication. endpoints (List[Dict[str, str]], optional): The endpoints of the service. open_endpoints (List[str], optional): The open endpoints of the service. open_api_url (str, optional): The OpenAPI URL of the service. integration (str, optional): The integration type of the service. sample_link (str, optional): The sample link of the service. api_description (str, optional): The API description of the service. tags (List[str], optional): The tags associated with the service. is_nevermined_hosted (bool, optional): Indicates if the service is hosted by Nevermined. implements_query_protocol (bool, optional): Indicates if the service implements the query protocol. query_protocol_version (str, optional): The version of the query protocol implemented by the service. service_host (str, optional): The host of the service. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_service(plan_did=\"did:nv:abc123\", service_type=\"service\", name=\"My Service\", description=\"A sample service\", service_charge_type=\"fixed\", auth_type=\"none\") print(response)","title":"method create_service"},{"location":"payments/#method-create_time_plan","text":"create_time_plan( name: str, description: str, price: int, token_address: str, duration: Optional[int] = 0, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto Creates a new time plan. Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. duration (int, optional): The duration of the plan in days. If not provided, the plan will be valid forever. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_time_plan(name=\"Yearly Plan\", description=\"Annual plan\", price=1200, token_address=\"0x5678\", duration=365, tags=[\"yearly\", \"premium\"]) print(response)","title":"method create_time_plan"},{"location":"payments/#method-download_file","text":"download_file( file_did: str, destination: str, agreement_id: Optional[str] = None ) \u2192 DownloadFileResultDto Downloads the file. Args: file_did (str): The DID of the file. agreement_id (str, optional): The agreement ID. destination str : The destination of the file. Returns: Response : The url of the file. Returns: DownloadFileResultDto : The result of the download operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.download_file(file_did=\"did:nv:7e38d39405445ab3e5435d8c1c6653a00ddc425ba629789f58fbefccaa5e5a5d\", destination=\"/tmp\") print(response)","title":"method download_file"},{"location":"payments/#method-get_asset_ddo","text":"get_asset_ddo(did: str) Gets the asset DDO. Args: did (str): The DID of the asset. Returns: Response : The response from the API call.","title":"method get_asset_ddo"},{"location":"payments/#method-get_checkout_plan","text":"get_checkout_plan(plan_did: str) Gets the checkout plan. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the checkout plan.","title":"method get_checkout_plan"},{"location":"payments/#method-get_file_details_url","text":"get_file_details_url(file_did: str) Gets the file details. Args: file_did (str): The DID of the file. Returns: Response : The url of the file details.","title":"method get_file_details_url"},{"location":"payments/#method-get_plan_associated_files","text":"get_plan_associated_files(plan_did: str) Gets the plan associated files. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated files.","title":"method get_plan_associated_files"},{"location":"payments/#method-get_plan_associated_services","text":"get_plan_associated_services(plan_did: str) Gets the plan associated services. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated services.","title":"method get_plan_associated_services"},{"location":"payments/#method-get_plan_balance","text":"get_plan_balance(plan_did: str, account_address: str) \u2192 BalanceResultDto Gets the plan balance. Args: plan_did (str): The DID of the plan. account_address (str): The account address. Returns: BalanceResultDto : The response from the API call formatted as a BalanceResultDto. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_plan_balance(plan_did=\"did:example:123456\", account_address=\"0xABC123\") response.raise_for_status() balance = BalanceResultDto.model_validate(response.json()) print(balance) Expected Response: { \"planType\": \"credits\", \"isOwner\": True, \"isSubscriptor\": True, \"balance\": 10000000 }","title":"method get_plan_balance"},{"location":"payments/#method-get_plan_details_url","text":"get_plan_details_url(plan_did: str) Gets the plan details. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the plan details.","title":"method get_plan_details_url"},{"location":"payments/#method-get_service_details_url","text":"get_service_details_url(service_did: str) Gets the service details. Args: service_did (str): The DID of the service. Returns: Response : The url of the service details.","title":"method get_service_details_url"},{"location":"payments/#method-get_service_token","text":"get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response)","title":"method get_service_token"},{"location":"payments/#method-mint_credits","text":"mint_credits(plan_did: str, amount: str, receiver: str) \u2192 MintResultDto Mints the credits associated with a plan and sends them to the receiver. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to mint. receiver (str): The receiver address of the credits. Returns: MintResultDto : The result of the minting operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.mint_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\", receiver=\"0x4fe3e7d42fA83be4E8cF03451Ac3F25980a73fF6\") print(response)","title":"method mint_credits"},{"location":"payments/#method-order_plan","text":"order_plan( plan_did: str, agreementId: Optional[str] = None ) \u2192 OrderPlanResultDto Orders the plan. Args: plan_did (str): The DID of the plan. agreementId (str, optional): The agreement ID. Returns: OrderPlanResultDto : The result of the order operation, containing the agreement ID and success status. Raises: HTTPError : If the API call fails. Example: response = your_instance.order_plan(plan_did=\"did:nv:a0079b517e580d430916924f1940b764e17c31e368c509483426f8c2ac2e7116\") print(response) This file was automatically generated via lazydocs .","title":"method order_plan"},{"location":"utils/","text":"module utils function snake_to_camel snake_to_camel(name) Convert snake_case to camelCase. :param name: str :return: str This file was automatically generated via lazydocs .","title":"Utils"},{"location":"utils/#module-utils","text":"","title":"module utils"},{"location":"utils/#function-snake_to_camel","text":"snake_to_camel(name) Convert snake_case to camelCase. :param name: str :return: str This file was automatically generated via lazydocs .","title":"function snake_to_camel"}]}
\ No newline at end of file
+{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"API Overview Modules ai_query_api data_models environments nvm_backend payments utils Classes ai_query_api.AIQueryApi : Represents the AI Query API. data_models.AgentExecutionStatus : An enumeration. data_models.Artifact : Represents an artifact with a unique identifier and a URL reference. data_models.BalanceResultDto data_models.BurnResultDto data_models.CreateAssetResultDto data_models.DownloadFileResultDto data_models.ExecutionInput : Represents the input for a task, such as a query and additional parameters or artifacts. data_models.ExecutionOptions : Represents options for executing a task or step, such as input, status, and output. data_models.ExecutionOutput : Represents the output of a task or step execution. data_models.MintResultDto data_models.OrderPlanResultDto data_models.PlanType : An enumeration. data_models.ServiceTokenResultDto data_models.Step : Represents a step in the execution of a task. data_models.Task : Represents a task that an agent should execute, composed of multiple steps. environments.Environment : Enum class to define the different environments nvm_backend.BackendApiOptions : Represents the backend API options. nvm_backend.NVMBackendApi payments.Payments : A class representing a payment system. Functions utils.snake_to_camel : Convert snake_case to camelCase. This file was automatically generated via lazydocs .","title":"Overview"},{"location":"#api-overview","text":"","title":"API Overview"},{"location":"#modules","text":"ai_query_api data_models environments nvm_backend payments utils","title":"Modules"},{"location":"#classes","text":"ai_query_api.AIQueryApi : Represents the AI Query API. data_models.AgentExecutionStatus : An enumeration. data_models.Artifact : Represents an artifact with a unique identifier and a URL reference. data_models.BalanceResultDto data_models.BurnResultDto data_models.CreateAssetResultDto data_models.DownloadFileResultDto data_models.ExecutionInput : Represents the input for a task, such as a query and additional parameters or artifacts. data_models.ExecutionOptions : Represents options for executing a task or step, such as input, status, and output. data_models.ExecutionOutput : Represents the output of a task or step execution. data_models.MintResultDto data_models.OrderPlanResultDto data_models.PlanType : An enumeration. data_models.ServiceTokenResultDto data_models.Step : Represents a step in the execution of a task. data_models.Task : Represents a task that an agent should execute, composed of multiple steps. environments.Environment : Enum class to define the different environments nvm_backend.BackendApiOptions : Represents the backend API options. nvm_backend.NVMBackendApi payments.Payments : A class representing a payment system.","title":"Classes"},{"location":"#functions","text":"utils.snake_to_camel : Convert snake_case to camelCase. This file was automatically generated via lazydocs .","title":"Functions"},{"location":"ai_query_api/","text":"module ai_query_api Global Variables SEARCH_TASKS_ENDPOINT SEARCH_STEPS_ENDPOINT CREATE_STEPS_ENDPOINT UPDATE_STEP_ENDPOINT GET_AGENTS_ENDPOINT GET_BUILDER_STEPS_ENDPOINT GET_TASK_STEPS_ENDPOINT TASK_ENDPOINT GET_TASK_ENDPOINT class AIQueryApi Represents the AI Query API. Args: opts (BackendApiOptions): The backend API options Methods: - create_task : Creates a task for an agent to execute - create_steps : Creates steps for a task - update_step : Updates a step - search_tasks : Searches for tasks - get_task_with_steps : Gets a task with its steps - get_steps_from_task : Gets the steps from a task - get_steps : Gets the steps - get_tasks_from_agents : Gets the tasks from the agents - search_step : Searches for steps method __init__ __init__(opts: BackendApiOptions) method create_steps create_steps(did: str, task_id: str, steps: Any) It creates the step/s required to complete an AI Task. This method is used by the AI Agent to create the steps required to complete the AI Task. Args: did (str): The DID of the service. task_id (str): The task ID. steps (Any): The steps to create. method create_task create_task(did: str, task: Any, jwt: Optional[str] = None) Subscribers can create an AI Task for an Agent. The task must contain the input query that will be used by the AI Agent. This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent. Because only subscribers can create AI Tasks, the method requires the access token to interact with the AI Agent/Service. This is given using the queryOpts object (accessToken attribute). Args: did (str): The DID of the service. task (Any): The task to create. jwt (Optional[str]): The JWT token. Example: task = { \"query\": \"https://www.youtube.com/watch?v=0tZFQs7qBfQ\", \"name\": \"transcribe\", \"additional_params\": [], \"artifacts\": [] } task = subscriber.ai_protocol.create_task(agent.did, task) print('Task created:', task.json()) method get_step get_step(step_id: str) It retrieves all the steps that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID. method get_steps get_steps( status: AgentExecutionStatus = , dids: List[str] = [] ) Gets the steps. Args: status (AgentExecutionStatus): The status of the steps. dids (List[str]): The list of DIDs. method get_steps_from_task get_steps_from_task(did: str, task_id: str, status: Optional[str] = None) It retrieves all the steps that the agent needs to execute to complete a specific task associated to the user. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user. Args: did (str): The DID of the service. task_id (str): The task ID. status (Optional[str]): The status of the steps. method get_task_with_steps get_task_with_steps(did: str, task_id: str, jwt: Optional[str] = None) It returns the full task and the steps resulted of the execution of the task. This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent. Args: did (str): The DID of the service. task_id (str): The task ID. jwt (Optional[str]): The JWT token. method get_tasks_from_agents get_tasks_from_agents() It retrieves all the tasks that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user method search_step search_step(search_params: Any) It search steps based on the search parameters. The steps belongs to the tasks part of the AI Agents owned by the user. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user. Args: search_params (Any): The search parameters. method search_tasks search_tasks(search_params: Any) It searches tasks based on the search parameters associated to the user. Args: search_params (Any): The search parameters. method subscribe subscribe( callback: Any, join_account_room: bool = True, join_agent_rooms: Optional[str, List[str]] = None, subscribe_event_types: Optional[List[str]] = None, get_pending_events_on_subscribe: bool = True ) It subscribes to the Nevermined network to retrieve new AI Tasks requested by other users. This method is used by AI agents to subscribe and receive new AI Tasks sent by other subscribers. Args: callback (Any): The callback function to be called when a new event is received. join_account_room (bool): If True, it will join the account room. join_agent_rooms (Optional[Union[str, List[str]]]): The agent rooms to join. subscribe_event_types (Optional[List[str]]): The event types to subscribe to. get_pending_events_on_subscribe (bool): If True, it will get the pending events on subscribe. method update_step update_step( did: str, task_id: str, step_id: str, step: Any, jwt: Optional[str] = None ) It updates the step with the new information. This method is used by the AI Agent to update the status and output of an step. This method can not be called by a subscriber. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID. step (Any): The step object to update. https://docs.nevermined.io/docs/protocol/query-protocol#steps-attributes jwt (Optional[str]): The JWT token. This file was automatically generated via lazydocs .","title":"Ai query api"},{"location":"ai_query_api/#module-ai_query_api","text":"","title":"module ai_query_api"},{"location":"ai_query_api/#global-variables","text":"SEARCH_TASKS_ENDPOINT SEARCH_STEPS_ENDPOINT CREATE_STEPS_ENDPOINT UPDATE_STEP_ENDPOINT GET_AGENTS_ENDPOINT GET_BUILDER_STEPS_ENDPOINT GET_TASK_STEPS_ENDPOINT TASK_ENDPOINT GET_TASK_ENDPOINT","title":"Global Variables"},{"location":"ai_query_api/#class-aiqueryapi","text":"Represents the AI Query API. Args: opts (BackendApiOptions): The backend API options Methods: - create_task : Creates a task for an agent to execute - create_steps : Creates steps for a task - update_step : Updates a step - search_tasks : Searches for tasks - get_task_with_steps : Gets a task with its steps - get_steps_from_task : Gets the steps from a task - get_steps : Gets the steps - get_tasks_from_agents : Gets the tasks from the agents - search_step : Searches for steps","title":"class AIQueryApi"},{"location":"ai_query_api/#method-__init__","text":"__init__(opts: BackendApiOptions)","title":"method __init__"},{"location":"ai_query_api/#method-create_steps","text":"create_steps(did: str, task_id: str, steps: Any) It creates the step/s required to complete an AI Task. This method is used by the AI Agent to create the steps required to complete the AI Task. Args: did (str): The DID of the service. task_id (str): The task ID. steps (Any): The steps to create.","title":"method create_steps"},{"location":"ai_query_api/#method-create_task","text":"create_task(did: str, task: Any, jwt: Optional[str] = None) Subscribers can create an AI Task for an Agent. The task must contain the input query that will be used by the AI Agent. This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent. Because only subscribers can create AI Tasks, the method requires the access token to interact with the AI Agent/Service. This is given using the queryOpts object (accessToken attribute). Args: did (str): The DID of the service. task (Any): The task to create. jwt (Optional[str]): The JWT token. Example: task = { \"query\": \"https://www.youtube.com/watch?v=0tZFQs7qBfQ\", \"name\": \"transcribe\", \"additional_params\": [], \"artifacts\": [] } task = subscriber.ai_protocol.create_task(agent.did, task) print('Task created:', task.json())","title":"method create_task"},{"location":"ai_query_api/#method-get_step","text":"get_step(step_id: str) It retrieves all the steps that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID.","title":"method get_step"},{"location":"ai_query_api/#method-get_steps","text":"get_steps( status: AgentExecutionStatus = , dids: List[str] = [] ) Gets the steps. Args: status (AgentExecutionStatus): The status of the steps. dids (List[str]): The list of DIDs.","title":"method get_steps"},{"location":"ai_query_api/#method-get_steps_from_task","text":"get_steps_from_task(did: str, task_id: str, status: Optional[str] = None) It retrieves all the steps that the agent needs to execute to complete a specific task associated to the user. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user. Args: did (str): The DID of the service. task_id (str): The task ID. status (Optional[str]): The status of the steps.","title":"method get_steps_from_task"},{"location":"ai_query_api/#method-get_task_with_steps","text":"get_task_with_steps(did: str, task_id: str, jwt: Optional[str] = None) It returns the full task and the steps resulted of the execution of the task. This method is used by subscribers of a Payment Plan required to access a specific AI Agent or Service. Users who are not subscribers won't be able to create AI Tasks for that Agent. Args: did (str): The DID of the service. task_id (str): The task ID. jwt (Optional[str]): The JWT token.","title":"method get_task_with_steps"},{"location":"ai_query_api/#method-get_tasks_from_agents","text":"get_tasks_from_agents() It retrieves all the tasks that the agent needs to execute to complete the different tasks assigned. This method is used by the AI Agent to retrieve information about the tasks created by users to the agents owned by the user","title":"method get_tasks_from_agents"},{"location":"ai_query_api/#method-search_step","text":"search_step(search_params: Any) It search steps based on the search parameters. The steps belongs to the tasks part of the AI Agents owned by the user. This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user. Args: search_params (Any): The search parameters.","title":"method search_step"},{"location":"ai_query_api/#method-search_tasks","text":"search_tasks(search_params: Any) It searches tasks based on the search parameters associated to the user. Args: search_params (Any): The search parameters.","title":"method search_tasks"},{"location":"ai_query_api/#method-subscribe","text":"subscribe( callback: Any, join_account_room: bool = True, join_agent_rooms: Optional[str, List[str]] = None, subscribe_event_types: Optional[List[str]] = None, get_pending_events_on_subscribe: bool = True ) It subscribes to the Nevermined network to retrieve new AI Tasks requested by other users. This method is used by AI agents to subscribe and receive new AI Tasks sent by other subscribers. Args: callback (Any): The callback function to be called when a new event is received. join_account_room (bool): If True, it will join the account room. join_agent_rooms (Optional[Union[str, List[str]]]): The agent rooms to join. subscribe_event_types (Optional[List[str]]): The event types to subscribe to. get_pending_events_on_subscribe (bool): If True, it will get the pending events on subscribe.","title":"method subscribe"},{"location":"ai_query_api/#method-update_step","text":"update_step( did: str, task_id: str, step_id: str, step: Any, jwt: Optional[str] = None ) It updates the step with the new information. This method is used by the AI Agent to update the status and output of an step. This method can not be called by a subscriber. Args: did (str): The DID of the service. task_id (str): The task ID. step_id (str): The step ID. step (Any): The step object to update. https://docs.nevermined.io/docs/protocol/query-protocol#steps-attributes jwt (Optional[str]): The JWT token. This file was automatically generated via lazydocs .","title":"method update_step"},{"location":"data_models/","text":"module data_models Global Variables FIRST_STEP_NAME LAST_STEP_NAME class PlanType An enumeration. class BalanceResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class MintResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class BurnResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class CreateAssetResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class DownloadFileResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class OrderPlanResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class ServiceTokenResultDto property model_extra Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" . property model_fields_set Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults. class AgentExecutionStatus An enumeration. class Artifact Represents an artifact with a unique identifier and a URL reference. class ExecutionInput Represents the input for a task, such as a query and additional parameters or artifacts. class ExecutionOutput Represents the output of a task or step execution. class ExecutionOptions Represents options for executing a task or step, such as input, status, and output. class Step Represents a step in the execution of a task. class Task Represents a task that an agent should execute, composed of multiple steps. This file was automatically generated via lazydocs .","title":"Data models"},{"location":"data_models/#module-data_models","text":"","title":"module data_models"},{"location":"data_models/#global-variables","text":"FIRST_STEP_NAME LAST_STEP_NAME","title":"Global Variables"},{"location":"data_models/#class-plantype","text":"An enumeration.","title":"class PlanType"},{"location":"data_models/#class-balanceresultdto","text":"","title":"class BalanceResultDto"},{"location":"data_models/#property-model_extra","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-mintresultdto","text":"","title":"class MintResultDto"},{"location":"data_models/#property-model_extra_1","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_1","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-burnresultdto","text":"","title":"class BurnResultDto"},{"location":"data_models/#property-model_extra_2","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_2","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-createassetresultdto","text":"","title":"class CreateAssetResultDto"},{"location":"data_models/#property-model_extra_3","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_3","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-downloadfileresultdto","text":"","title":"class DownloadFileResultDto"},{"location":"data_models/#property-model_extra_4","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_4","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-orderplanresultdto","text":"","title":"class OrderPlanResultDto"},{"location":"data_models/#property-model_extra_5","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_5","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-servicetokenresultdto","text":"","title":"class ServiceTokenResultDto"},{"location":"data_models/#property-model_extra_6","text":"Get extra fields set during validation. Returns: A dictionary of extra fields, or None if config.extra is not set to \"allow\" .","title":"property model_extra"},{"location":"data_models/#property-model_fields_set_6","text":"Returns the set of fields that have been explicitly set on this model instance. Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.","title":"property model_fields_set"},{"location":"data_models/#class-agentexecutionstatus","text":"An enumeration.","title":"class AgentExecutionStatus"},{"location":"data_models/#class-artifact","text":"Represents an artifact with a unique identifier and a URL reference.","title":"class Artifact"},{"location":"data_models/#class-executioninput","text":"Represents the input for a task, such as a query and additional parameters or artifacts.","title":"class ExecutionInput"},{"location":"data_models/#class-executionoutput","text":"Represents the output of a task or step execution.","title":"class ExecutionOutput"},{"location":"data_models/#class-executionoptions","text":"Represents options for executing a task or step, such as input, status, and output.","title":"class ExecutionOptions"},{"location":"data_models/#class-step","text":"Represents a step in the execution of a task.","title":"class Step"},{"location":"data_models/#class-task","text":"Represents a task that an agent should execute, composed of multiple steps. This file was automatically generated via lazydocs .","title":"class Task"},{"location":"environments/","text":"module environments class Environment Enum class to define the different environments Attributes: local : Local environment appStaging : Staging environment appTesting : Testing environment appArbitrum : Arbitrum environment appPeaq : Peaq network This file was automatically generated via lazydocs .","title":"Environments"},{"location":"environments/#module-environments","text":"","title":"module environments"},{"location":"environments/#class-environment","text":"Enum class to define the different environments Attributes: local : Local environment appStaging : Staging environment appTesting : Testing environment appArbitrum : Arbitrum environment appPeaq : Peaq network This file was automatically generated via lazydocs .","title":"class Environment"},{"location":"nvm_backend/","text":"module nvm_backend class BackendApiOptions Represents the backend API options. Args: environment (Environment): The environment. api_key (Optional[str]): The Nevermined API Key. This key identify your user and is required to interact with the Nevermined API. You can get your API key by logging in to the Nevermined App. See https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys headers (Optional[Dict[str, str]]): Additional headers to send with the requests web_socket_options (Optional[Dict[str, Any]]): Configuration of the websocket connection method __init__ __init__( environment: Environment, api_key: Optional[str] = None, headers: Optional[Dict[str, str]] = None, web_socket_options: Optional[Dict[str, Any]] = None ) class NVMBackendApi method __init__ __init__(opts: BackendApiOptions) method connect_socket connect_socket() method delete delete(url: str, data: Any) method disconnect disconnect() method disconnect_socket disconnect_socket() method get get(url: str) method get_service_token get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response) method join_room join_room(join_account_room: bool, room_ids: Optional[str, List[str]] = None) method parse_url_to_backend parse_url_to_backend(uri: str) \u2192 str method parse_url_to_proxy parse_url_to_proxy(uri: str) \u2192 str method post post(url: str, data: Any) method put put(url: str, data: Any) method set_bearer_token set_bearer_token(token: str) This file was automatically generated via lazydocs .","title":"Nvm backend"},{"location":"nvm_backend/#module-nvm_backend","text":"","title":"module nvm_backend"},{"location":"nvm_backend/#class-backendapioptions","text":"Represents the backend API options. Args: environment (Environment): The environment. api_key (Optional[str]): The Nevermined API Key. This key identify your user and is required to interact with the Nevermined API. You can get your API key by logging in to the Nevermined App. See https://docs.nevermined.app/docs/tutorials/integration/nvm-api-keys headers (Optional[Dict[str, str]]): Additional headers to send with the requests web_socket_options (Optional[Dict[str, Any]]): Configuration of the websocket connection","title":"class BackendApiOptions"},{"location":"nvm_backend/#method-__init__","text":"__init__( environment: Environment, api_key: Optional[str] = None, headers: Optional[Dict[str, str]] = None, web_socket_options: Optional[Dict[str, Any]] = None )","title":"method __init__"},{"location":"nvm_backend/#class-nvmbackendapi","text":"","title":"class NVMBackendApi"},{"location":"nvm_backend/#method-__init___1","text":"__init__(opts: BackendApiOptions)","title":"method __init__"},{"location":"nvm_backend/#method-connect_socket","text":"connect_socket()","title":"method connect_socket"},{"location":"nvm_backend/#method-delete","text":"delete(url: str, data: Any)","title":"method delete"},{"location":"nvm_backend/#method-disconnect","text":"disconnect()","title":"method disconnect"},{"location":"nvm_backend/#method-disconnect_socket","text":"disconnect_socket()","title":"method disconnect_socket"},{"location":"nvm_backend/#method-get","text":"get(url: str)","title":"method get"},{"location":"nvm_backend/#method-get_service_token","text":"get_service_token(service_did: str) \u2192 ServiceTokenResultDto Gets the service token. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response)","title":"method get_service_token"},{"location":"nvm_backend/#method-join_room","text":"join_room(join_account_room: bool, room_ids: Optional[str, List[str]] = None)","title":"method join_room"},{"location":"nvm_backend/#method-parse_url_to_backend","text":"parse_url_to_backend(uri: str) \u2192 str","title":"method parse_url_to_backend"},{"location":"nvm_backend/#method-parse_url_to_proxy","text":"parse_url_to_proxy(uri: str) \u2192 str","title":"method parse_url_to_proxy"},{"location":"nvm_backend/#method-post","text":"post(url: str, data: Any)","title":"method post"},{"location":"nvm_backend/#method-put","text":"put(url: str, data: Any)","title":"method put"},{"location":"nvm_backend/#method-set_bearer_token","text":"set_bearer_token(token: str) This file was automatically generated via lazydocs .","title":"method set_bearer_token"},{"location":"payments/","text":"module payments class Payments A class representing a payment system. Attributes: nvm_api_key (str): The nvm api key for authentication. environment (Environment): The environment for the payment system. app_id (str, optional): The application ID. version (str, optional): The version of the payment system. ai_protocol (bool): Indicates if the AI protocol is enabled. headers (dict, optional): The headers for the payment system. web_socket_options (dict, optional): The web socket options for the payment system. Methods: - create_credits_plan : Creates a new credits plan. - create_time_plan : Creates a new time plan. - create_service : Creates a new service. - create_file : Creates a new file. - order_plan : Orders the plan. - get_asset_ddo : Gets the asset DDO. - get_plan_balance : Gets the plan balance. - get_service_token : Gets the service token. - get_plan_associated_services : Gets the plan associated services. - get_plan_associated_files : Gets the plan associated files. - get_plan_details : Gets the plan details. - get_service_details : Gets the service details. - get_file_details : Gets the file details. - get_checkout_plan : Gets the checkout plan. - download_file : Downloads the file. - mint_credits : Mints the credits associated to a plan and send to the receiver. - burn_credits : Burns credits associated to a plan that you own. - ai_protocol : The AI Query API. method __init__ __init__( nvm_api_key: str, environment: Environment, app_id: Optional[str] = None, version: Optional[str] = None, ai_protocol: bool = False, headers: Optional[dict] = None, web_socket_options: Optional[dict] = None ) method burn_credits burn_credits(plan_did: str, amount: str) \u2192 BurnResultDto Burn credits for a given Payment Plan DID. This method is only can be called by the owner of the Payment Plan. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to burn. Returns: BurnResultDto : The result of the burning operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.burn_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\") print(response) method create_credits_plan create_credits_plan( name: str, description: str, price: int, token_address: str, amount_of_credits: int, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It allows to an AI Builder to create a Payment Plan on Nevermined based on Credits. A Nevermined Credits Plan limits the access by the access/usage of the Plan. With them, AI Builders control the number of requests that can be made to an agent or service. Every time a user accesses any resouce associated to the Payment Plan, the usage consumes from a capped amount of credits. When the user consumes all the credits, the plan automatically expires and the user needs to top up to continue using the service. This method is oriented to AI Builders. https://docs.nevermined.app/docs/tutorials/builders/create-plan Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. amount_of_credits (int): The amount of credits for the plan. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_credits_plan(name=\"Basic Plan\", description=\"100 credits plan\", price=1, token_address=\"0x1234\", amount_of_credits=100, tags=[\"basic\"]) print(response) method create_file create_file( plan_did: str, asset_type: str, name: str, description: str, files: List[dict], data_schema: Optional[str] = None, sample_code: Optional[str] = None, files_format: Optional[str] = None, usage_example: Optional[str] = None, programming_language: Optional[str] = None, framework: Optional[str] = None, task: Optional[str] = None, training_details: Optional[str] = None, variations: Optional[str] = None, fine_tunable: Optional[bool] = None, amount_of_credits: Optional[int] = None, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It creates a new asset with file associated to it. The file asset must be associated to a Payment Plan. Users that are subscribers of a payment plan can download the files attached to it. Depending on the Payment Plan and the configuration of the file asset, the download will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue downloading the files. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/register-file-asset Args: plan_did (str): The DID of the plan. asset_type (str): The type of the asset. -> 'algorithm' | 'model' | 'dataset' | 'file' name (str): The name of the file. description (str): The description of the file. files (List[dict]): The files of the file. data_schema (str, optional): The data schema of the file. sample_code (str, optional): The sample code of the file. files_format (str, optional): The files format of the file. usage_example (str, optional): The usage example of the file. programming_language (str, optional): The programming language of the file. framework (str, optional): The framework of the file. task (str, optional): The task of the file. training_details (str, optional): The training details of the file. variations (str, optional): The variations of the file. fine_tunable (bool, optional): The fine tunable of the file. amount_of_credits (int, optional): The amount of credits for the file. tags (List[str], optional): The tags associated with the file. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_file(plan_did=\"did:nv:xyz789\", asset_type=\"dataset\", name=\"Sample Dataset\", description=\"A sample dataset\", files=[{\"name\": \"file1.csv\", \"url\": \"https://example.com/file1.csv\"}]) print(response) method create_service create_service( plan_did: str, service_type: str, name: str, description: str, service_charge_type: str, auth_type: str, amount_of_credits: int = 1, min_credits_to_charge: Optional[int] = 1, max_credits_to_charge: Optional[int] = 1, username: Optional[str] = None, password: Optional[str] = None, token: Optional[str] = None, endpoints: Optional[List[dict]] = None, open_endpoints: Optional[List[str]] = [], open_api_url: Optional[str] = None, integration: Optional[str] = None, sample_link: Optional[str] = None, api_description: Optional[str] = None, tags: Optional[List[str]] = None, is_nevermined_hosted: Optional[bool] = None, implements_query_protocol: Optional[bool] = None, query_protocol_version: Optional[str] = None, service_host: Optional[str] = None ) \u2192 CreateAssetResultDto It creates a new AI Agent or Service on Nevermined. The agent/service must be associated to a Payment Plan. Users that are subscribers of a payment plan can access the agent/service. Depending on the Payment Plan and the configuration of the agent/service, the usage of the agent/service will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue using the agent/service. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/register-agent Args: plan_did (str): The DID of the plan. service_type (str): The type of the service. Options: 'service', 'agent', 'assistant' name (str): The name of the service. description (str): The description of the service. service_charge_type (str): The charge type of the service. Options: 'fixed', 'dynamic' auth_type (str): The authentication type of the service. Options: 'none', 'basic', 'oauth' amount_of_credits (int): The amount of credits for the service. min_credits_to_charge (int, optional): The minimum credits to charge for the service. Only required for dynamic services. max_credits_to_charge (int, optional): The maximum credits to charge for the service. Only required for dynamic services. username (str, optional): The username for authentication. password (str, optional): The password for authentication. token (str, optional): The token for authentication. endpoints (List[Dict[str, str]], optional): The endpoints of the service. open_endpoints (List[str], optional): The open endpoints of the service. open_api_url (str, optional): The OpenAPI URL of the service. integration (str, optional): The integration type of the service. sample_link (str, optional): The sample link of the service. api_description (str, optional): The API description of the service. tags (List[str], optional): The tags associated with the service. is_nevermined_hosted (bool, optional): Indicates if the service is hosted by Nevermined. implements_query_protocol (bool, optional): Indicates if the service implements the query protocol. query_protocol_version (str, optional): The version of the query protocol implemented by the service. service_host (str, optional): The host of the service. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_service(plan_did=\"did:nv:abc123\", service_type=\"service\", name=\"My Service\", description=\"A sample service\", service_charge_type=\"fixed\", auth_type=\"none\") print(response) method create_time_plan create_time_plan( name: str, description: str, price: int, token_address: str, duration: Optional[int] = 0, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It allows to an AI Builder to create a Payment Plan on Nevermined based on Time. A Nevermined Time Plan limits the access by the a specific amount of time. With them, AI Builders can specify the duration of the Payment Plan (1 month, 1 year, etc.). When the time period is over, the plan automatically expires and the user needs to renew it. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/create-plan Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. duration (int, optional): The duration of the plan in days. If not provided, the plan will be valid forever. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_time_plan(name=\"Yearly Plan\", description=\"Annual plan\", price=1200, token_address=\"0x5678\", duration=365, tags=[\"yearly\", \"premium\"]) print(response) method download_file download_file( file_did: str, destination: str, agreement_id: Optional[str] = None ) \u2192 DownloadFileResultDto Downloads the file. Args: file_did (str): The DID of the file. agreement_id (str, optional): The agreement ID. destination str : The destination of the file. Returns: Response : The url of the file. Returns: DownloadFileResultDto : The result of the download operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.download_file(file_did=\"did:nv:7e38d39405445ab3e5435d8c1c6653a00ddc425ba629789f58fbefccaa5e5a5d\", destination=\"/tmp\") print(response) method get_asset_ddo get_asset_ddo(did: str) Get the Metadata (aka Decentralized Document or DDO) for a given asset identifier (DID). https://docs.nevermined.io/docs/architecture/specs/Spec-DID https://docs.nevermined.io/docs/architecture/specs/Spec-METADATA Args: did (str): The unique identifier (aka DID) of the asset (payment plan, agent, file, etc). Returns: Response : The response from the API call. method get_checkout_plan get_checkout_plan(plan_did: str) Gets the checkout plan. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the checkout plan. method get_file_details_url get_file_details_url(file_did: str) Gets the file details. Args: file_did (str): The DID of the file. Returns: Response : The url of the file details. method get_plan_associated_files get_plan_associated_files(plan_did: str) Get array of files DIDs associated with a payment plan. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated files. method get_plan_associated_services get_plan_associated_services(plan_did: str) Get array of services/agent DIDs associated with a payment plan. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated services. method get_plan_balance get_plan_balance(plan_did: str, account_address: str) \u2192 BalanceResultDto Get the balance of an account for a Payment Plan. Args: plan_did (str): The DID of the plan. account_address (str): The account address. Returns: BalanceResultDto : The response from the API call formatted as a BalanceResultDto. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_plan_balance(plan_did=\"did:example:123456\", account_address=\"0xABC123\") response.raise_for_status() balance = BalanceResultDto.model_validate(response.json()) print(balance) Expected Response: { \"planType\": \"credits\", \"isOwner\": True, \"isSubscriptor\": True, \"balance\": 10000000 } method get_plan_details_url get_plan_details_url(plan_did: str) Gets the plan details. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the plan details. method get_service_details_url get_service_details_url(service_did: str) Gets the service details. Args: service_did (str): The DID of the service. Returns: Response : The url of the service details. method get_service_token get_service_token(service_did: str) \u2192 ServiceTokenResultDto Get the required configuration for accessing a remote service agent. This configuration includes: - The JWT access token - The Proxy url that can be used to query the agent/service. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response) method mint_credits mint_credits(plan_did: str, amount: str, receiver: str) \u2192 MintResultDto Mints the credits associated with a plan and sends them to the receiver. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to mint. receiver (str): The receiver address of the credits. Returns: MintResultDto : The result of the minting operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.mint_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\", receiver=\"0x4fe3e7d42fA83be4E8cF03451Ac3F25980a73fF6\") print(response) method order_plan order_plan( plan_did: str, agreementId: Optional[str] = None ) \u2192 OrderPlanResultDto Orders a Payment Plan. The user needs to have enough balance in the token selected by the owner of the Payment Plan. The payment is done using Crypto. Payments using Fiat can be done via the Nevermined App. Args: plan_did (str): The DID of the plan. agreementId (str, optional): The agreement ID. Returns: OrderPlanResultDto : The result of the order operation, containing the agreement ID and success status. Raises: HTTPError : If the API call fails. Example: response = your_instance.order_plan(plan_did=\"did:nv:a0079b517e580d430916924f1940b764e17c31e368c509483426f8c2ac2e7116\") print(response) This file was automatically generated via lazydocs .","title":"Payments"},{"location":"payments/#module-payments","text":"","title":"module payments"},{"location":"payments/#class-payments","text":"A class representing a payment system. Attributes: nvm_api_key (str): The nvm api key for authentication. environment (Environment): The environment for the payment system. app_id (str, optional): The application ID. version (str, optional): The version of the payment system. ai_protocol (bool): Indicates if the AI protocol is enabled. headers (dict, optional): The headers for the payment system. web_socket_options (dict, optional): The web socket options for the payment system. Methods: - create_credits_plan : Creates a new credits plan. - create_time_plan : Creates a new time plan. - create_service : Creates a new service. - create_file : Creates a new file. - order_plan : Orders the plan. - get_asset_ddo : Gets the asset DDO. - get_plan_balance : Gets the plan balance. - get_service_token : Gets the service token. - get_plan_associated_services : Gets the plan associated services. - get_plan_associated_files : Gets the plan associated files. - get_plan_details : Gets the plan details. - get_service_details : Gets the service details. - get_file_details : Gets the file details. - get_checkout_plan : Gets the checkout plan. - download_file : Downloads the file. - mint_credits : Mints the credits associated to a plan and send to the receiver. - burn_credits : Burns credits associated to a plan that you own. - ai_protocol : The AI Query API.","title":"class Payments"},{"location":"payments/#method-__init__","text":"__init__( nvm_api_key: str, environment: Environment, app_id: Optional[str] = None, version: Optional[str] = None, ai_protocol: bool = False, headers: Optional[dict] = None, web_socket_options: Optional[dict] = None )","title":"method __init__"},{"location":"payments/#method-burn_credits","text":"burn_credits(plan_did: str, amount: str) \u2192 BurnResultDto Burn credits for a given Payment Plan DID. This method is only can be called by the owner of the Payment Plan. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to burn. Returns: BurnResultDto : The result of the burning operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.burn_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\") print(response)","title":"method burn_credits"},{"location":"payments/#method-create_credits_plan","text":"create_credits_plan( name: str, description: str, price: int, token_address: str, amount_of_credits: int, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It allows to an AI Builder to create a Payment Plan on Nevermined based on Credits. A Nevermined Credits Plan limits the access by the access/usage of the Plan. With them, AI Builders control the number of requests that can be made to an agent or service. Every time a user accesses any resouce associated to the Payment Plan, the usage consumes from a capped amount of credits. When the user consumes all the credits, the plan automatically expires and the user needs to top up to continue using the service. This method is oriented to AI Builders. https://docs.nevermined.app/docs/tutorials/builders/create-plan Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. amount_of_credits (int): The amount of credits for the plan. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_credits_plan(name=\"Basic Plan\", description=\"100 credits plan\", price=1, token_address=\"0x1234\", amount_of_credits=100, tags=[\"basic\"]) print(response)","title":"method create_credits_plan"},{"location":"payments/#method-create_file","text":"create_file( plan_did: str, asset_type: str, name: str, description: str, files: List[dict], data_schema: Optional[str] = None, sample_code: Optional[str] = None, files_format: Optional[str] = None, usage_example: Optional[str] = None, programming_language: Optional[str] = None, framework: Optional[str] = None, task: Optional[str] = None, training_details: Optional[str] = None, variations: Optional[str] = None, fine_tunable: Optional[bool] = None, amount_of_credits: Optional[int] = None, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It creates a new asset with file associated to it. The file asset must be associated to a Payment Plan. Users that are subscribers of a payment plan can download the files attached to it. Depending on the Payment Plan and the configuration of the file asset, the download will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue downloading the files. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/register-file-asset Args: plan_did (str): The DID of the plan. asset_type (str): The type of the asset. -> 'algorithm' | 'model' | 'dataset' | 'file' name (str): The name of the file. description (str): The description of the file. files (List[dict]): The files of the file. data_schema (str, optional): The data schema of the file. sample_code (str, optional): The sample code of the file. files_format (str, optional): The files format of the file. usage_example (str, optional): The usage example of the file. programming_language (str, optional): The programming language of the file. framework (str, optional): The framework of the file. task (str, optional): The task of the file. training_details (str, optional): The training details of the file. variations (str, optional): The variations of the file. fine_tunable (bool, optional): The fine tunable of the file. amount_of_credits (int, optional): The amount of credits for the file. tags (List[str], optional): The tags associated with the file. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_file(plan_did=\"did:nv:xyz789\", asset_type=\"dataset\", name=\"Sample Dataset\", description=\"A sample dataset\", files=[{\"name\": \"file1.csv\", \"url\": \"https://example.com/file1.csv\"}]) print(response)","title":"method create_file"},{"location":"payments/#method-create_service","text":"create_service( plan_did: str, service_type: str, name: str, description: str, service_charge_type: str, auth_type: str, amount_of_credits: int = 1, min_credits_to_charge: Optional[int] = 1, max_credits_to_charge: Optional[int] = 1, username: Optional[str] = None, password: Optional[str] = None, token: Optional[str] = None, endpoints: Optional[List[dict]] = None, open_endpoints: Optional[List[str]] = [], open_api_url: Optional[str] = None, integration: Optional[str] = None, sample_link: Optional[str] = None, api_description: Optional[str] = None, tags: Optional[List[str]] = None, is_nevermined_hosted: Optional[bool] = None, implements_query_protocol: Optional[bool] = None, query_protocol_version: Optional[str] = None, service_host: Optional[str] = None ) \u2192 CreateAssetResultDto It creates a new AI Agent or Service on Nevermined. The agent/service must be associated to a Payment Plan. Users that are subscribers of a payment plan can access the agent/service. Depending on the Payment Plan and the configuration of the agent/service, the usage of the agent/service will consume credits. When the plan expires (because the time is over or the credits are consumed), the user needs to renew the plan to continue using the agent/service. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/register-agent Args: plan_did (str): The DID of the plan. service_type (str): The type of the service. Options: 'service', 'agent', 'assistant' name (str): The name of the service. description (str): The description of the service. service_charge_type (str): The charge type of the service. Options: 'fixed', 'dynamic' auth_type (str): The authentication type of the service. Options: 'none', 'basic', 'oauth' amount_of_credits (int): The amount of credits for the service. min_credits_to_charge (int, optional): The minimum credits to charge for the service. Only required for dynamic services. max_credits_to_charge (int, optional): The maximum credits to charge for the service. Only required for dynamic services. username (str, optional): The username for authentication. password (str, optional): The password for authentication. token (str, optional): The token for authentication. endpoints (List[Dict[str, str]], optional): The endpoints of the service. open_endpoints (List[str], optional): The open endpoints of the service. open_api_url (str, optional): The OpenAPI URL of the service. integration (str, optional): The integration type of the service. sample_link (str, optional): The sample link of the service. api_description (str, optional): The API description of the service. tags (List[str], optional): The tags associated with the service. is_nevermined_hosted (bool, optional): Indicates if the service is hosted by Nevermined. implements_query_protocol (bool, optional): Indicates if the service implements the query protocol. query_protocol_version (str, optional): The version of the query protocol implemented by the service. service_host (str, optional): The host of the service. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_service(plan_did=\"did:nv:abc123\", service_type=\"service\", name=\"My Service\", description=\"A sample service\", service_charge_type=\"fixed\", auth_type=\"none\") print(response)","title":"method create_service"},{"location":"payments/#method-create_time_plan","text":"create_time_plan( name: str, description: str, price: int, token_address: str, duration: Optional[int] = 0, tags: Optional[List[str]] = None ) \u2192 CreateAssetResultDto It allows to an AI Builder to create a Payment Plan on Nevermined based on Time. A Nevermined Time Plan limits the access by the a specific amount of time. With them, AI Builders can specify the duration of the Payment Plan (1 month, 1 year, etc.). When the time period is over, the plan automatically expires and the user needs to renew it. This method is oriented to AI Builders https://docs.nevermined.app/docs/tutorials/builders/create-plan Args: name (str): The name of the plan. description (str): The description of the plan. price (int): The price of the plan. token_address (str): The token address. duration (int, optional): The duration of the plan in days. If not provided, the plan will be valid forever. tags (List[str], optional): The tags associated with the plan. Returns: CreateAssetResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.create_time_plan(name=\"Yearly Plan\", description=\"Annual plan\", price=1200, token_address=\"0x5678\", duration=365, tags=[\"yearly\", \"premium\"]) print(response)","title":"method create_time_plan"},{"location":"payments/#method-download_file","text":"download_file( file_did: str, destination: str, agreement_id: Optional[str] = None ) \u2192 DownloadFileResultDto Downloads the file. Args: file_did (str): The DID of the file. agreement_id (str, optional): The agreement ID. destination str : The destination of the file. Returns: Response : The url of the file. Returns: DownloadFileResultDto : The result of the download operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.download_file(file_did=\"did:nv:7e38d39405445ab3e5435d8c1c6653a00ddc425ba629789f58fbefccaa5e5a5d\", destination=\"/tmp\") print(response)","title":"method download_file"},{"location":"payments/#method-get_asset_ddo","text":"get_asset_ddo(did: str) Get the Metadata (aka Decentralized Document or DDO) for a given asset identifier (DID). https://docs.nevermined.io/docs/architecture/specs/Spec-DID https://docs.nevermined.io/docs/architecture/specs/Spec-METADATA Args: did (str): The unique identifier (aka DID) of the asset (payment plan, agent, file, etc). Returns: Response : The response from the API call.","title":"method get_asset_ddo"},{"location":"payments/#method-get_checkout_plan","text":"get_checkout_plan(plan_did: str) Gets the checkout plan. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the checkout plan.","title":"method get_checkout_plan"},{"location":"payments/#method-get_file_details_url","text":"get_file_details_url(file_did: str) Gets the file details. Args: file_did (str): The DID of the file. Returns: Response : The url of the file details.","title":"method get_file_details_url"},{"location":"payments/#method-get_plan_associated_files","text":"get_plan_associated_files(plan_did: str) Get array of files DIDs associated with a payment plan. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated files.","title":"method get_plan_associated_files"},{"location":"payments/#method-get_plan_associated_services","text":"get_plan_associated_services(plan_did: str) Get array of services/agent DIDs associated with a payment plan. Args: plan_did (str): The DID of the plan. Returns: Response : List of DIDs of the associated services.","title":"method get_plan_associated_services"},{"location":"payments/#method-get_plan_balance","text":"get_plan_balance(plan_did: str, account_address: str) \u2192 BalanceResultDto Get the balance of an account for a Payment Plan. Args: plan_did (str): The DID of the plan. account_address (str): The account address. Returns: BalanceResultDto : The response from the API call formatted as a BalanceResultDto. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_plan_balance(plan_did=\"did:example:123456\", account_address=\"0xABC123\") response.raise_for_status() balance = BalanceResultDto.model_validate(response.json()) print(balance) Expected Response: { \"planType\": \"credits\", \"isOwner\": True, \"isSubscriptor\": True, \"balance\": 10000000 }","title":"method get_plan_balance"},{"location":"payments/#method-get_plan_details_url","text":"get_plan_details_url(plan_did: str) Gets the plan details. Args: plan_did (str): The DID of the plan. Returns: Response : The url of the plan details.","title":"method get_plan_details_url"},{"location":"payments/#method-get_service_details_url","text":"get_service_details_url(service_did: str) Gets the service details. Args: service_did (str): The DID of the service. Returns: Response : The url of the service details.","title":"method get_service_details_url"},{"location":"payments/#method-get_service_token","text":"get_service_token(service_did: str) \u2192 ServiceTokenResultDto Get the required configuration for accessing a remote service agent. This configuration includes: - The JWT access token - The Proxy url that can be used to query the agent/service. Args: service_did (str): The DID of the service. Returns: ServiceTokenResultDto : The result of the creation operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.get_service_token(service_did=\"did:nv:xyz789\") print(response)","title":"method get_service_token"},{"location":"payments/#method-mint_credits","text":"mint_credits(plan_did: str, amount: str, receiver: str) \u2192 MintResultDto Mints the credits associated with a plan and sends them to the receiver. Args: plan_did (str): The DID of the plan. amount (str): The amount of credits to mint. receiver (str): The receiver address of the credits. Returns: MintResultDto : The result of the minting operation. Raises: HTTPError : If the API call fails. Example: response = your_instance.mint_credits(plan_did=\"did:nv:e405a91e3152be1430c5d0607ebdf9236c19f34bfba0320798d81ba5f5e3e3a5\", amount=\"12\", receiver=\"0x4fe3e7d42fA83be4E8cF03451Ac3F25980a73fF6\") print(response)","title":"method mint_credits"},{"location":"payments/#method-order_plan","text":"order_plan( plan_did: str, agreementId: Optional[str] = None ) \u2192 OrderPlanResultDto Orders a Payment Plan. The user needs to have enough balance in the token selected by the owner of the Payment Plan. The payment is done using Crypto. Payments using Fiat can be done via the Nevermined App. Args: plan_did (str): The DID of the plan. agreementId (str, optional): The agreement ID. Returns: OrderPlanResultDto : The result of the order operation, containing the agreement ID and success status. Raises: HTTPError : If the API call fails. Example: response = your_instance.order_plan(plan_did=\"did:nv:a0079b517e580d430916924f1940b764e17c31e368c509483426f8c2ac2e7116\") print(response) This file was automatically generated via lazydocs .","title":"method order_plan"},{"location":"utils/","text":"module utils function snake_to_camel snake_to_camel(name) Convert snake_case to camelCase. :param name: str :return: str This file was automatically generated via lazydocs .","title":"Utils"},{"location":"utils/#module-utils","text":"","title":"module utils"},{"location":"utils/#function-snake_to_camel","text":"snake_to_camel(name) Convert snake_case to camelCase. :param name: str :return: str This file was automatically generated via lazydocs .","title":"function snake_to_camel"}]}
\ No newline at end of file
diff --git a/site/sitemap.xml b/site/sitemap.xml
index e3cd941..c4226a3 100644
--- a/site/sitemap.xml
+++ b/site/sitemap.xml
@@ -2,30 +2,30 @@
https://github.com/nevermined-io/payments-py/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/ai_query_api/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/data_models/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/environments/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/nvm_backend/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/payments/
- 2024-10-17
+ 2024-10-18
https://github.com/nevermined-io/payments-py/utils/
- 2024-10-17
+ 2024-10-18
\ No newline at end of file
diff --git a/site/sitemap.xml.gz b/site/sitemap.xml.gz
index de2eab806f76cb5add69765301a12194a890b630..f8c7e6ef798c718a8f02381e5dab269dc517d1ba 100644
GIT binary patch
literal 257
zcmV+c0sj6UiwFn+r4eTW|8r?{Wo=<_E_iKh0L7EBa)U4ohW9)L=N%hz9nu~+Tc4nr
zIR|v0E0!H(AiRAINqgNhpv96-`u}gRiu2v}$pizVqf+ED6A4i58l<)qm#@$CB+mL!
zj6=^5k~mCUiY^5Iq0~Ijk}-fao~0XF#dQ}8R?nu&ZxMf?Ey)$Z6;V9E$
z=*CNCoRtI-#UeqIqLW@P7ASD)7g@@6a2k$dlEDgQm6cGp;6
zM;Mk`d)yhN(LvWy8G7EC1Zcv+(N^z_LX)j8+I#~wJCpq7J7bIipZOo#6Axbf0vb;Z
I4j=>o0DVJuY5)KL
From 8d0f606b1cc7e21e8ec8d39e8db6c1289cd57c3e Mon Sep 17 00:00:00 2001
From: enrique
Date: Fri, 18 Oct 2024 10:08:56 +0200
Subject: [PATCH 2/3] feat: bumpversion
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 4795f3d..a6935e4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "payments-py"
-version = "0.4.3"
+version = "0.4.4"
description = ""
authors = ["enrique "]
readme = "README.md"
From c968ee14b8c29f17935c3507c15339e2e7fc7529 Mon Sep 17 00:00:00 2001
From: enrique
Date: Fri, 18 Oct 2024 10:16:46 +0200
Subject: [PATCH 3/3] fix: doc
---
payments_py/ai_query_api.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/payments_py/ai_query_api.py b/payments_py/ai_query_api.py
index 20588f3..a40c90c 100644
--- a/payments_py/ai_query_api.py
+++ b/payments_py/ai_query_api.py
@@ -179,8 +179,7 @@ def search_step(self, search_params: Any):
def get_step(self, step_id: str):
"""
- It retrieves all the steps that the agent needs to execute to complete the different tasks assigned.
- This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user.
+ Get the details of a step.
Args:
did (str): The DID of the service.
@@ -194,7 +193,8 @@ def get_steps(self,
status: AgentExecutionStatus = AgentExecutionStatus.Pending,
dids: List[str] = []):
"""
- Gets the steps.
+ It retrieves all the steps that the agent needs to execute to complete the different tasks assigned.
+ This method is used by the AI Agent to retrieve information about the steps part of tasks created by users to the agents owned by the user.
Args:
status (AgentExecutionStatus): The status of the steps.