### Install Dependencies with pnpm Source: https://github.com/fetchai/deprecated-docs/blob/main/README.md Use this command to install project dependencies using pnpm. Ensure pnpm is installed globally. ```bash pnpm install test ``` -------------------------------- ### Install Dependencies Source: https://github.com/fetchai/deprecated-docs/blob/main/DEVELOPING.md Install all necessary project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Start Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Starts a specific agent, identified by address. ```APIDOC ## POST /v1/hosting/agents/{address}/start ### Description Starts a specific agent, identified by address. ### Method POST ### Endpoint /v1/hosting/agents/{address}/start ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Response #### Success Response (200) - **name** (string) - The name of the agent. - **address** (string) - The address of the agent. - **domain** (string) - The domain of the agent. - **running** (boolean) - Indicates if the agent is running. - **compiled** (boolean) - Indicates if the agent is compiled. - **revision** (string) - The revision number of the agent's code. - **code_digest** (string) - The digest of the agent's code. - **wallet_address** (string) - The wallet address associated with the agent. ### Response Example { "name": "InitialTest", "address": "agent1qvnppqyhk4hu0q64tnfkspux8hpd9zayyclhafvkz5340uqx3ax02txfll7", "domain": "None", "running": "True", "compiled": "False", "revision": "4", "code_digest": "66089877730d0501a4ff1efedf545279d5db120d0960f1ea6a1c00f834ff9530", "wallet_address": "None" } ``` -------------------------------- ### Run Development Server with pnpm Source: https://github.com/fetchai/deprecated-docs/blob/main/README.md Execute this command to start the local development server. The site will be accessible at http://127.0.0.1:3000/docs. ```bash pnpm dev ``` -------------------------------- ### Conventional Commit Message Examples Source: https://github.com/fetchai/deprecated-docs/blob/main/CONTRIBUTING.md Examples of commit messages following the Conventional Commits specification. Use these formats for 'feat', 'fix', 'docs', and 'test' commit types. ```bash git commit -m "feat: add new feature x" ``` ```bash git commit -m "fix: fix bug in feature x" ``` ```bash git commit -m "docs: add documentation for feature x" ``` ```bash git commit -m "test: add test suite for feature x" ``` -------------------------------- ### Agent Control Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Endpoints for starting and stopping hosted agents. ```APIDOC ## POST /v1/hosting/agents/:agentAddress/start ### Description Starts a specific agent. ### Method POST ### Endpoint /v1/hosting/agents/:agentAddress/start ``` ```APIDOC ## POST /v1/hosting/agents/:agentAddress/stop ### Description Stops a specific agent. ### Method POST ### Endpoint /v1/hosting/agents/:agentAddress/stop ``` -------------------------------- ### Start a Specific Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Initiates the execution of a specific agent, identified by its address. The response provides details about the agent's current state, including its running status and code digest. ```bash curl --request POST \ --url "https://agentverse.ai/v1/hosting/agents/agent1qvnppqyhk4hu0q64tnfkspux8hpd9zayyclhafvkz5340uqx3ax02txfll7/start" ``` -------------------------------- ### List Agents API Request Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx GET request to list all agents. The response is an array of Agent objects. ```http GET /v1/hosting/agents HTTP/1.1 Host: agentverse.ai Content-Type: application/json ``` -------------------------------- ### Get Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieves details for a specific agent using its address. ```APIDOC ## GET /v1/hosting/agents/{agentAddress} ### Description Looks up a specific agent by address on the hosting platform. ### Method GET ### Endpoint /v1/hosting/agents/{agentAddress} ### Parameters #### Path Parameters - **agentAddress** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Responses #### Success Response (200) - **name** (string) - Name of the agent. - **address** (string) - Address of the agent. - **domain** (string) - The domain of the agent. - **running** (boolean) - Indicates if the agent is currently running. - **compiled** (boolean | null) - Indicates if the agent's code is compiled. - **revision** (integer) - The revision number of the agent's code. - **code_digest** (string | null) - The digest of the agent's code. - **wallet_address** (string) - The wallet address associated with the agent. ### Response Example ```json [ { "name": "InitialTest", "address": "agent1qtw0hy4kj65fv6j7qyv5mgdecq7c4qyqfqnjgc25wz4vf5h47l9l6m7qqtg", "domain": "None", "running": false, "compiled": null, "revision": 0, "code_digest": null, "wallet_address": "fetch1mh0zmyddgcvspz7ye5zdrzjcfjtz54cgafak67" } ] ``` ``` -------------------------------- ### Get current Agent usage Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieves usage data for the currently selected agent. ```APIDOC ## GET /v1/hosting/usage/current ### Description Get data about the usage of the currently selected Agent. ### Method GET ### Endpoint /v1/hosting/usage/current ### Response #### Success Response (200) - **year** (string) - The year for which usage data is provided. - **month** (string) - The month for which usage data is provided. - **computation_time** (string) - The computation time used. - **num_messages** (string) - The number of messages processed. - **num_message_bytes** (string) - The number of message bytes processed. - **num_agents** (string) - The number of agents. - **quota_computation_time** (string) - The quota for computation time. - **quota_num_messages** (string) - The quota for the number of messages. - **quota_message_bytes** (string) - The quota for message bytes. - **quota_agents** (string) - The quota for the number of agents. #### Response Example ```json { "year": "2023", "month": "8", "computation_time": "2291", "num_messages": "12", "num_message_bytes": "0", "num_agents": "4", "quota_computation_time": "3100000000", "quota_num_messages": "31000000", "quota_message_bytes": "63488000000", "quota_agents": "1000" } ``` ``` -------------------------------- ### Get Agent Usage for a specific year and month Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieves usage data for the currently selected agent for a specific year and month. ```APIDOC ## GET /v1/hosting/usage/{year}/{month} ### Description Get data about the usage of the currently selected Agent for a selected year and month. ### Method GET ### Endpoint /v1/hosting/usage/{year}/{month} ### Parameters #### Path Parameters - **year** (string) - Required - The year for which to retrieve usage data. - **month** (string) - Required - The month for which to retrieve usage data. ### Response #### Success Response (200) - **year** (string) - The year for which usage data is provided. - **month** (string) - The month for which usage data is provided. - **computation_time** (string) - The computation time used. - **num_messages** (string) - The number of messages processed. - **num_message_bytes** (string) - The number of message bytes processed. - **num_agents** (string) - The number of agents. - **quota_computation_time** (string) - The quota for computation time. - **quota_num_messages** (string) - The quota for the number of messages. - **quota_message_bytes** (string) - The quota for message bytes. - **quota_agents** (string) - The quota for the number of agents. #### Response Example ```json { "year": "2023", "month": "8", "computation_time": "2291", "num_messages": "12", "num_message_bytes": "0", "num_agents": "4", "quota_computation_time": "3100000000", "quota_num_messages": "31000000", "quota_message_bytes": "63488000000", "quota_agents": "1000" } ``` ``` -------------------------------- ### Get Latest Logs For Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieves the latest logs for a specific agent, identified by its address. ```APIDOC ## GET /v1/hosting/agents/{address}/logs/latest ### Description Get the latest logs for an Agent, identified by address. ### Method GET ### Endpoint /v1/hosting/agents/{address}/logs/latest ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Response #### Success Response (200) - **log_timestamp** (string) - The timestamp of the log entry. - **log_entry** (string) - The content of the log entry. #### Response Example ```json { "log_timestamp": "2023-08-22T14:09:48.259000", "log_entry": "[INFO]: My count is: 0" } ``` ``` -------------------------------- ### Get Agent Usage for a specific year and month Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieve detailed usage data for a specific agent, identified by its address, for a given year and month. This includes computation time and message statistics. ```APIDOC ## GET /v1/hosting/usage/agents/{address}/{year}/{month} ### Description Get data about the usage for an Agent, identified by address for a specific year and month. ### Method GET ### Endpoint /v1/hosting/usage/agents/{address}/{year}/{month} ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. - **year** (string) - Required - The year for which to retrieve usage data. - **month** (string) - Required - The month for which to retrieve usage data. ### Response #### Success Response (200) - **year** (string) - The year of the usage data. - **month** (string) - The month of the usage data. - **computation_time** (string) - The total computation time in seconds for the specified period. - **num_messages** (string) - The total number of messages processed during the specified period. - **num_message_bytes** (string) - The total size in bytes of all messages processed during the specified period. ### Response Example ```json { "year": "2023", "month": "3", "computation_time": "1230", "num_messages": "4", "num_message_bytes": "0" } ``` ``` -------------------------------- ### Get current Agent usage selected by address Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieve the current usage data for a specific agent, identified by its address. This provides an overview of recent agent activity. ```APIDOC ## GET /v1/hosting/usage/agents/{address}/current ### Description Get data about the usage for an Agent, identified by address. ### Method GET ### Endpoint /v1/hosting/usage/agents/{address}/current ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Response #### Success Response (200) - **year** (string) - The year of the usage data. - **month** (string) - The month of the usage data. - **computation_time** (string) - The total computation time in seconds for the specified period. - **num_messages** (string) - The total number of messages processed during the specified period. - **num_message_bytes** (string) - The total size in bytes of all messages processed during the specified period. ### Response Example ```json { "year": "2023", "month": "8", "computation_time": "1230", "num_messages": "4", "num_message_bytes": "0" } ``` ``` -------------------------------- ### Lookup Specific Agent API Request Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx GET request to retrieve details of a specific agent using its address. The response contains the agent's properties. ```http GET /v1/hosting/agents/{agentAddress} HTTP/1.1 Host: agentverse.ai Content-Type: application/json ``` -------------------------------- ### Hosting API Endpoints Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Lists the available endpoints for managing agents, their code, and logs. Use these to interact with the hosting service. ```bash GET /v1/hosting/agents POST /v1/hosting/agents GET /v1/hosting/agents/:agentAddress DELETE /v1/hosting/agents/:agentAddress GET /v1/hosting/agents/:agentAddress/code PUT /v1/hosting/agents/:agentAddress/code POST /v1/hosting/agents/:agentAddress/start POST /v1/hosting/agents/:agentAddress/stop GET /v1/hosting/agents/:agentAddress/logs/latest DELETE /v1/hosting/agents/:agentAddress/logs GET /v1/hosting/usage/current GET /v1/hosting/usage/:year/:month GET /v1/hosting/usage/agents/:address/current GET /v1/hosting/usage/agents/:address/:year/:month ``` -------------------------------- ### Sample NewAgent Object Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Defines the structure for creating a new agent, primarily containing the agent's name. ```json { "name": "My first agent" } ``` -------------------------------- ### Clone Repository Source: https://github.com/fetchai/deprecated-docs/blob/main/DEVELOPING.md Use this command to clone the project repository from GitHub. ```shell git clone https://github.com/fetchai/docs.git ``` -------------------------------- ### Basic Agent with Message Handling Source: https://github.com/fetchai/deprecated-docs/blob/main/pages/concepts.mdx Defines a simple agent that listens for messages of a specific model and logs them. Ensure the agent is run with the correct endpoint and port. ```python from uagents import Agent, Context, Model agent = Agent(name="concept", seed="secret_seed_phrase_concept", endpoint="127.0.0.1", port="8001") class Message(Model): message : str @agent.on_message(model=Message) async def print_message(ctx: Context, msg : Message): ctx.logger.info(f"Message received: {msg.message}") if __name__ == "__main__": agent.run() ``` -------------------------------- ### Sample AgentLog Object Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Represents a single log entry for an agent, including a timestamp and the log message. ```json { "log_timestamp": "2023-08-22T14:09:48.259000", "log_entry": "[INFO]: My count is: 0" } ``` -------------------------------- ### Sample AgentCode Object Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Defines the structure for agent code, including its digest, the code itself, and the timestamp of the last update. ```json { "digest": "66089877730d0501a4ff1efedf545279d5db120d0960f1ea6a1c00f834ff9530", "code": "alice = Agent(name=\"alice\", seed=\"sample seed\")", "timestamp": "2023-08-22T14:09:48.259000" } ``` -------------------------------- ### Create Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Creates a new agent with a specified name. ```APIDOC ## POST /v1/hosting/agents ### Description Request for creating a new agent. ### Method POST ### Endpoint /v1/hosting/agents ### Parameters #### Request Body - **name** (string) - Required - The given name of the agent. This is only a label that is used internally so users can keep track of their agents. ### Request Example ```json { "name": "My newest agent" } ``` ### Responses #### Success Response (200) - **name** (string) - Name of the new agent. - **address** (string) - Address of the new agent. - **running** (boolean) - Indicates if the agent is currently running. - **compiled** (boolean) - Indicates if the agent's code is compiled. - **revision** (integer) - The revision number of the agent's code. - **code_digest** (string) - The digest of the agent's code. - **wallet_address** (string) - The wallet address associated with the agent. ### Response Example ```json { "name": "My newest agent", "address": "agent1q2dfhywtt8xazrdyzgap6gzdd7uhk4e0wmc3gjqt42esauaegcm8cuvclpj", "running": false, "compiled": true, "revision": 1, "code_digest": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "wallet_address": "fetch1dtwgzm6km4394erexa8ka05wva306wt9cc3mwk" } ``` ``` -------------------------------- ### Sample UpdateAgentCode Object Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Represents the code payload for updating an agent's code. It contains the agent's code as a string. ```json { "code": "alice = Agent(name=\"alice\", seed=\"sample seed\")" } ``` -------------------------------- ### Agent Sending FET Tokens Source: https://github.com/fetchai/deprecated-docs/blob/main/pages/concepts.mdx Demonstrates an agent's capability to send FET tokens in response to a payment request. This snippet requires pre-defined models like PaymentRequest and TransactionInfo, and assumes the existence of other agents (alice, bob) and ledger access. ```python from uagents import Agent, Bureau, Context, Model from uagents.network import wait_for_tx_to_complete from uagents.setup import fund_agent_if_low ... @agent.on_message(model=PaymentRequest, replies=TransactionInfo) async def send_payment(ctx: Context, sender: str, msg: PaymentRequest): ctx.logger.info(f"Received payment request from {sender}: {msg}") # send the payment transaction = ctx.ledger.send_tokens( msg.wallet_address, msg.amount, msg.denom, bob.wallet ) # send the tx hash so other agent can confirm await ctx.send(alice.address, TransactionInfo(tx_hash=transaction.tx_hash)) ... ``` -------------------------------- ### Agent Object Structure Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Represents a hosted agent, including its name, address, running status, compilation status, revision, code digest, and associated wallet address. ```json { "name": "My first agent", "address": "agent1q2dfhywtt8xazrdyzgap6gzdd7uhk4e0wmc3gjqt42esauaegcm8cuvclpj", "running": false, "compiled": true, "revision": 7, "code_digest": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "wallet_address": "fetch1dtwgzm6km4394erexa8ka05wva306wt9cc3mwk" } ``` -------------------------------- ### Create Agent API Request Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx POST request to create a new agent. Requires a 'name' property in the payload. The response includes the new agent's properties. ```http POST /v1/hosting/agents HTTP/1.1 Host: agentverse.ai Content-Type: application/json { "name": "My newest agent" } ``` -------------------------------- ### Sample AgentCodeDigest Object Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Represents the digest of an Agent's code. This is a string identifier for the code. ```json { "digest": "66089877730d0501a4ff1efedf545279d5db120d0960f1ea6a1c00f834ff9530" } ``` -------------------------------- ### Agent Usage Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Endpoints for retrieving agent usage statistics. ```APIDOC ## GET /v1/hosting/usage/current ### Description Retrieves current usage statistics for all agents. ### Method GET ### Endpoint /v1/hosting/usage/current ``` ```APIDOC ## GET /v1/hosting/usage/:year/:month ### Description Retrieves usage statistics for a specific month and year. ### Method GET ### Endpoint /v1/hosting/usage/:year/:month ``` ```APIDOC ## GET /v1/hosting/usage/agents/:address/current ### Description Retrieves current usage statistics for a specific agent. ### Method GET ### Endpoint /v1/hosting/usage/agents/:address/current ``` ```APIDOC ## GET /v1/hosting/usage/agents/:address/:year/:month ### Description Retrieves usage statistics for a specific agent for a given month and year. ### Method GET ### Endpoint /v1/hosting/usage/agents/:address/:year/:month ``` -------------------------------- ### Agent Management Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Endpoints for managing agents, including listing, creating, and retrieving individual agent details. ```APIDOC ## GET /v1/hosting/agents ### Description Retrieves a list of all hosted agents. ### Method GET ### Endpoint /v1/hosting/agents ``` ```APIDOC ## POST /v1/hosting/agents ### Description Creates a new hosted agent. ### Method POST ### Endpoint /v1/hosting/agents ``` ```APIDOC ## GET /v1/hosting/agents/:agentAddress ### Description Retrieves details for a specific agent. ### Method GET ### Endpoint /v1/hosting/agents/:agentAddress ``` ```APIDOC ## DELETE /v1/hosting/agents/:agentAddress ### Description Deletes a specific agent. ### Method DELETE ### Endpoint /v1/hosting/agents/:agentAddress ``` -------------------------------- ### Add Upstream Remote Source: https://github.com/fetchai/deprecated-docs/blob/main/DEVELOPING.md Define an upstream remote to point back to the main repository for future updates. ```shell git remote add upstream https://github.com/fetchai/docs.git ``` -------------------------------- ### Agent Logs Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Endpoints for retrieving and managing agent logs. ```APIDOC ## GET /v1/hosting/agents/:agentAddress/logs/latest ### Description Retrieves the latest logs for a specific agent. ### Method GET ### Endpoint /v1/hosting/agents/:agentAddress/logs/latest ``` ```APIDOC ## DELETE /v1/hosting/agents/:agentAddress/logs ### Description Deletes the logs for a specific agent. ### Method DELETE ### Endpoint /v1/hosting/agents/:agentAddress/logs ``` -------------------------------- ### List Agents Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Retrieves a list of all agents associated with the user's account. ```APIDOC ## GET /v1/hosting/agents ### Description Request for listing all of your agents at once. ### Method GET ### Endpoint /v1/hosting/agents ### Responses #### Success Response (200) - **name** (string) - Name of the agent. - **address** (string) - Address of the agent. - **running** (boolean) - Indicates if the agent is currently running. - **compiled** (boolean) - Indicates if the agent's code is compiled. - **revision** (integer) - The revision number of the agent's code. - **code_digest** (string) - The digest of the agent's code. - **wallet_address** (string) - The wallet address associated with the agent. ### Response Example ```json [ { "name": "My first agent", "address": "agent1q2dfhywtt8xazrdyzgap6gzdd7uhk4e0wmc3gjqt42esauaegcm8cuvclpj", "running": false, "compiled": true, "revision": 7, "code_digest": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "wallet_address": "fetch1dtwgzm6km4394erexa8ka05wva306wt9cc3mwk" } ] ``` ``` -------------------------------- ### Look up Agent Code Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Use this endpoint to retrieve the code associated with a specific agent, identified by its address. The response includes the code's digest, content, and timestamp. ```bash curl --request GET \ --url "https://agentverse.ai/v1/hosting/agents/agent1q2dfhywtt8xazrdyzgap6gzdd7uhk4e0wmc3gjqt42esauaegcm8cuvclpj/code" ``` -------------------------------- ### Update Agent Code Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx This endpoint allows you to update the code for a specific agent. Provide the agent's address and the new code, which is a collection of files, each with an id, name, value, and language. ```bash curl --request PUT \ --url "https://agentverse.ai/v1/hosting/agents/agent1q2dfhywtt8xazrdyzgap6gzdd7uhk4e0wmc3gjqt42esauaegcm8cuvclpj/code" \ --header "Content-Type: application/json" \ --data '{ "code": [ { "id": 0, "name": "agent.py", "value": "\n# Congratulations on creating your first agent!\n#\n# This agent simply writes a greeting in the logs on a scheduled time interval.\n#\n# In this example we will use:\n# - \'agent\': this is your instance of the \'Agent\' class that we will give an \'on_interval\' task\n# - \'ctx\': this is the agent\'s \'Context\', which gives you access to all the agent\'s important functions\n\n# A decorator (marked by the \'@\' symbol) just wraps the function defined under it in another function.\n# This decorator tells your agent to run the function on a time interval with the specified \'period\' in seconds.\n# These functions must be \'async\' because agents need to be able to perform many tasks concurrently.\n@agent.on_interval(period=3.0)\nasync def say_hello(ctx: Context):\n # ctx.logger is a standard Python logger that can log text with various levels of urgency\n # (exception, warning, info, debug). Here we will just use the \'info\' level to write a greeting\n ctx.logger.info(f\'Hello, I\'m an agent and my address is {agent.address}.\')\n", "language": "python" }, { "id": 1, "name": ".env", "value": "AGENT_SEED=YOUR_AGENT_SEED", "language": "python" } ] }' ``` -------------------------------- ### Agent Code Management Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Endpoints for managing the code of existing agents, including retrieval and updates. ```APIDOC ## GET /v1/hosting/agents/:agentAddress/code ### Description Retrieves the code of a specific agent. ### Method GET ### Endpoint /v1/hosting/agents/:agentAddress/code ``` ```APIDOC ## PUT /v1/hosting/agents/:agentAddress/code ### Description Updates the code of a specific agent. ### Method PUT ### Endpoint /v1/hosting/agents/:agentAddress/code ``` -------------------------------- ### Look up Agent code Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Looks up the code for an agent, specified by address. ```APIDOC ## GET /v1/hosting/agents/{agentAddress}/code ### Description Looks up the code for an agent, specified by address. ### Method GET ### Endpoint /v1/hosting/agents/{agentAddress}/code ### Parameters #### Path Parameters - **agentAddress** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Response #### Success Response (200) - **digest** (string) - The digest of the agent's code. - **code** (string) - The agent's code. - **timestamp** (string) - The timestamp when the code was last updated. ### Response Example { "digest": "4a8d510d546de8ff74aa27abaa7ebd95bf7876d8b31b265f6022c49d7b49cf45", "code": "Example code", "timestamp": "2023-08-22T12:49:45.856000+00:00" } ``` -------------------------------- ### Stop a specific agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Stops a specific agent, identified by its address. ```APIDOC ## POST /v1/hosting/agents/{address}/stop ### Description Stops a specific agent, identified by address. ### Method POST ### Endpoint /v1/hosting/agents/{address}/stop ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Request Example ```json { "address": "agent1qvnppqyhk4hu0q64tnfkspux8hpd9zayyclhafvkz5340uqx3ax02txfll7" } ``` ### Response #### Success Response (200) - **address** (string) - The address of the agent. - **domain** (string) - The domain of the agent. - **running** (boolean) - Indicates if the agent is running. - **compiled** (boolean) - Indicates if the agent is compiled. - **revision** (string) - The revision number of the agent. - **code_digest** (string) - The code digest of the agent. - **wallet_address** (string) - The wallet address associated with the agent. #### Response Example ```json { "address": "agent1qvnppqyhk4hu0q64tnfkspux8hpd9zayyclhafvkz5340uqx3ax02txfll7", "domain": "None", "running": "False", "compiled": "False", "revision": "4", "code_digest": "66089877730d0501a4ff1efedf545279d5db120d0960f1ea6a1c00f834ff9530", "wallet_address": "None" } ``` ``` -------------------------------- ### Delete Agent API Request Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx DELETE request to remove a specific agent from the platform using its address. This action is irreversible. ```http DELETE /v1/hosting/agents/{agentAddress} HTTP/1.1 Host: agentverse.ai Content-Type: application/json ``` -------------------------------- ### Delete the latest logs for an Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Deletes the latest logs for a specific agent, identified by its address. ```APIDOC ## DELETE /v1/hosting/agents/{address}/logs ### Description Delete the latest logs for an Agent, identified by address. ### Method DELETE ### Endpoint /v1/hosting/agents/{address}/logs ### Parameters #### Path Parameters - **address** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Response On success, the response will be the deletion of the specified agent logs. ``` -------------------------------- ### Update Agent Code Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Updates the code for a specific agent, identified by address. ```APIDOC ## PUT /v1/hosting/agents/{agentAddress}/code ### Description Updates the code for a specific agent, identified by address. ### Method PUT ### Endpoint /v1/hosting/agents/{agentAddress}/code ### Parameters #### Path Parameters - **agentAddress** (string) - Required - The address of the agent. This is also the current public key of the agent. #### Request Body - **code** (array) - Required - The code for a specific agent on the Agentverse, provided as a collection of files. Each file includes an id, name, value (the code content), and language. - **id** (integer) - Required - The unique identifier for the file. - **name** (string) - Required - The name of the file. - **value** (string) - Required - The content of the file. - **language** (string) - Required - The programming language of the file. ### Request Example { "code": [ { "id": 0, "name": "agent.py", "value": "\n# Congratulations on creating your first agent!\n#\n# This agent simply writes a greeting in the logs on a scheduled time interval.\n#\n# In this example we will use:\n# - 'agent': this is your instance of the 'Agent' class that we will give an 'on_interval' task\n# - 'ctx': this is the agent's 'Context', which gives you access to all the agent's important functions\n\n# A decorator (marked by the '@' symbol) just wraps the function defined under it in another function.\n# This decorator tells your agent to run the function on a time interval with the specified 'period' in seconds.\n# These functions must be 'async' because agents need to be able to perform many tasks concurrently.\n@agent.on_interval(period=3.0)\nasync def say_hello(ctx: Context):\n # ctx.logger is a standard Python logger that can log text with various levels of urgency\n # (exception, warning, info, debug). Here we will just use the 'info' level to write a greeting\n ctx.logger.info(f\"Hello, I'm an agent and my address is {agent.address}.\")\n", "language": "python" }, { "id": 1, "name": ".env", "value": "AGENT_SEED=YOUR_AGENT_SEED", "language": "python" } ] } ### Response #### Success Response (200) - **digest** (string) - The updated digest of the agent's code. ### Response Example { "digest": "66089877730d0501a4ff1efedf545279d5db120d0960f1ea6a1c00f834ff9530" } ``` -------------------------------- ### Delete Agent Source: https://github.com/fetchai/deprecated-docs/blob/main/test.mdx Deletes a specific agent identified by its address. ```APIDOC ## DELETE /v1/hosting/agents/{agentAddress} ### Description Delete a specific agent, identified by address. ### Method DELETE ### Endpoint /v1/hosting/agents/{agentAddress} ### Parameters #### Path Parameters - **agentAddress** (string) - Required - The address of the agent. This is also the current public key of the agent. ### Responses #### Success Response (200) - The response will be empty upon successful deletion. ### Response Example ```json {} ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.