From b5104299a61d2592a3e0f38e70e1b50f1c7b7e0d Mon Sep 17 00:00:00 2001 From: "felix.bucsa" <72919584+FelixNicolaeBucsa@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:36:28 +0100 Subject: [PATCH] feat(docs): add Local tags and other fixes to code outputs (#1020) Co-authored-by: Joshua Croft <32483134+devjsc@users.noreply.github.com> Co-authored-by: gautamgambhir97 <140384949+gautamgambhir97@users.noreply.github.com> --- pages/examples/advanced/_meta.json | 10 +-- pages/guides/agent-courses/_meta.json | 2 +- .../agent-courses/introductory-course.mdx | 5 +- pages/guides/agents/_meta.json | 2 +- pages/guides/agents/advanced/_meta.json | 12 +-- .../agents/advanced/agents-async-loops.mdx | 1 + .../agents/advanced/message-verification.mdx | 2 + pages/guides/agents/advanced/name-service.mdx | 1 + .../agents/advanced/register-in-almanac.mdx | 14 +++- .../guides/agents/getting-started/_meta.json | 8 +- .../agents/getting-started/seedphrase.mdx | 2 +- pages/guides/agents/intermediate/_meta.json | 39 ++++++---- .../agents/intermediate/agent-functions.mdx | 4 +- .../communicating-with-other-agents.mdx | 68 ++++++++-------- .../agents/intermediate/hosted-agent.mdx | 17 ++-- .../intermediate/local-agent-inspector.mdx | 16 ++-- pages/guides/agents/intermediate/mailbox.mdx | 42 ++++++++-- .../options-for-running-local-agents.mdx | 15 +++- .../agents/intermediate/send-tokens.mdx | 2 + .../agentverse-functions/_meta.json | 4 +- .../agentverse/agentverse-mailbox/_meta.json | 2 +- .../creating-agentverse-agents/_meta.json | 9 ++- .../allowed-imports.mdx | 78 +++++++++---------- .../guides/quickstart-with/CrewAI/_meta.json | 3 +- .../guides/quickstart-with/OpenAI/_meta.json | 3 +- .../quickstart-with/langchain/_meta.json | 18 ++++- 26 files changed, 228 insertions(+), 151 deletions(-) diff --git a/pages/examples/advanced/_meta.json b/pages/examples/advanced/_meta.json index 4e460f2e1..5e29abab6 100644 --- a/pages/examples/advanced/_meta.json +++ b/pages/examples/advanced/_meta.json @@ -1,27 +1,27 @@ { "open-dialogue-chitchat": { "title": "Open Dialogue Chit-Chat", - "tags": ["Advanced", "Python", "Dialogues", "Use cases"], + "tags": ["Advanced", "Python", "Dialogues", "Use cases", "Local"], "timestamp": true }, "predefined-dialogue-chitchat": { "title": "Predefined Dialogue Chit-Chat", - "tags": ["Advanced", "Python", "Dialogues", "Use cases"], + "tags": ["Advanced", "Python", "Dialogues", "Use cases", "Local"], "timestamp": true }, "async-loops": { "title": "Asynchronous Loops", - "tags": ["Advanced", "Python", "Communication", "Use Cases"], + "tags": ["Advanced", "Python", "Communication", "Use Cases", "Local"], "timestamp": true }, "chat_api_example": { "title": "Chat API example", - "tags": ["Advanced", "Python", "Dialogues", "Use cases"], + "tags": ["Advanced", "Python", "Dialogues", "Use cases", "Hosted"], "timestamp": true }, "deltaV-dialogues": { "title": "DeltaV Dialogue Chit-Chat", - "tags": ["Advanced", "Python", "Dialogues", "DeltaV"], + "tags": ["Advanced", "Python", "Dialogues", "DeltaV", "Hosted"], "timestamp": true } } diff --git a/pages/guides/agent-courses/_meta.json b/pages/guides/agent-courses/_meta.json index c0dd4551a..d9879080e 100644 --- a/pages/guides/agent-courses/_meta.json +++ b/pages/guides/agent-courses/_meta.json @@ -1,7 +1,7 @@ { "introductory-course": { "title": "Agents 101", - "tags": ["Beginner", "Python"] + "tags": ["Beginner", "Python", "Agents"] }, "agents-for-ai": { "title": "Agents 101 for AI Engine", diff --git a/pages/guides/agent-courses/introductory-course.mdx b/pages/guides/agent-courses/introductory-course.mdx index 430a05f39..9faba4637 100644 --- a/pages/guides/agent-courses/introductory-course.mdx +++ b/pages/guides/agent-courses/introductory-course.mdx @@ -760,9 +760,9 @@ Checkout the following documentation and resources for a better understanding of ### Registering your Agents to the Open Marketplace -Agent registration in the [Almanac ↗️](/references/contracts/uagents-almanac/almanac-overview) contract is a key feature enabling Agents discoverability as well as remote Agents communication. When Agents regiterin the Almanac, they become part of the Open Marketplace and become avaiable for interactions with other users and Agents registered in the contract. To register, Agents must pay a small fee. Therefore your agents need to have funds available in their Fetch wallet address. +Agent registration in the [Almanac ↗️](/references/contracts/uagents-almanac/almanac-overview) contract is a key feature enabling Agents discoverability as well as remote Agents communication. When Agents regitering the Almanac, they become part of the Open Marketplace and become available for interactions with other users and Agents registered in the contract. To register, Agents must pay a small fee. Therefore your agents need to have funds available in their Fetch wallet address. - Agents can communicate by querying the Almanac and retrieving an HTTP [endpoint ↗️](/references/contracts/uagents-almanac/endpoints) from the recipient agent. Therefore, we need to specify the service endpoints when defining an Agent at registration. +Agents can communicate by querying the Almanac and retrieving an HTTP [endpoint ↗️](/references/contracts/uagents-almanac/endpoints) from the recipient agent. Therefore, we need to specify the service endpoints when defining an Agent at registration. HTTP (Hypertext Transfer Protocol) service endpoints are specific locations or URLs (Uniform Resource Locators) on a web server where clients can send HTTP requests to interact with resources or services provided by the server. These endpoints define the entry points for various operations or functions offered by a web service or application. @@ -827,7 +827,6 @@ We will have what follows: - Here, we defined a local http address, but you could also define a remote address to allow agent communication over different machines through the internet. Importantly, make sure to add a seed phrase to your Agent, so you don't have to fund different addresses each time you run your agent. The `fund_agent_if_low` is used on the Testnet to make sure your Agent has enough funds in its wallet to register and operate correctly. diff --git a/pages/guides/agents/_meta.json b/pages/guides/agents/_meta.json index a09bccbfe..f7293e4a4 100644 --- a/pages/guides/agents/_meta.json +++ b/pages/guides/agents/_meta.json @@ -1,7 +1,7 @@ { "quickstart": { "title": "Quickstart", - "tags": ["Beginner", "Python", "local"] + "tags": ["Beginner", "Python", "Local"] }, "getting-started": { "title": "Getting Started" diff --git a/pages/guides/agents/advanced/_meta.json b/pages/guides/agents/advanced/_meta.json index 71e2086ee..0b1e8177e 100644 --- a/pages/guides/agents/advanced/_meta.json +++ b/pages/guides/agents/advanced/_meta.json @@ -6,12 +6,12 @@ }, "register-in-almanac": { "title": "Almanac Contract", - "tags": ["Advanced", "Python", "Almanac"], + "tags": ["Advanced", "Python", "Almanac", "Local"], "timestamp": true }, "agents-async-loops": { "title": "Agents Asynchronous Loops", - "tags": ["Advanced", "Python", "Communication", "Use Cases"], + "tags": ["Advanced", "Python", "Communication", "Use Cases", "Local"], "timestamp": true }, "agent-envelopes": { @@ -21,22 +21,22 @@ }, "message-verification": { "title": "Verify messages with Agents", - "tags": ["Advanced", "Python", "Communication", "Use Cases"], + "tags": ["Advanced", "Python", "Communication", "Use Cases", "Local"], "timestamp": true }, "utilizing-api-to-build-network-of-task-and-subtask": { "title": "Multi-file agent pipeline for AI Engine: Network of Primary and Secondary functions in Agentverse", - "tags": ["Advanced", "Python", "Functions", "AI Engine"], + "tags": ["Advanced", "Python", "Functions", "AI Engine", "Local"], "timestamp": true }, "localwallet": { "title": "Local Wallet", - "tags": ["Advanced", "Python", "Wallet"], + "tags": ["Advanced", "Python", "Wallet", "Local"], "timestamp": true }, "name-service": { "title": "Agents Name Service", - "tags": ["Advanced", "Python", "Name Service"], + "tags": ["Advanced", "Python", "Name Service", "Local"], "timestamp": true } } diff --git a/pages/guides/agents/advanced/agents-async-loops.mdx b/pages/guides/agents/advanced/agents-async-loops.mdx index b12e2f6cd..63b09f5d7 100644 --- a/pages/guides/agents/advanced/agents-async-loops.mdx +++ b/pages/guides/agents/advanced/agents-async-loops.mdx @@ -240,6 +240,7 @@ The output should be similar to the following: ``` Attaching the agent or bureau to the external loop... + ``` - Script 2: diff --git a/pages/guides/agents/advanced/message-verification.mdx b/pages/guides/agents/advanced/message-verification.mdx index fa65e0e32..be894d780 100644 --- a/pages/guides/agents/advanced/message-verification.mdx +++ b/pages/guides/agents/advanced/message-verification.mdx @@ -379,6 +379,8 @@ Run the script: `python message_verification.py`. The output should be as follows: ``` + WARNING: [alice]: No endpoints provided. Skipping registration: Agent won't be reachable. + WARNING: [ bob]: No endpoints provided. Skipping registration: Agent won't be reachable. [ bob]: Alice's message verified! [ bob]: Received message from agent1qf5gfqm48k9acegez3sg82ney2aa6l5fvpwh3n3z0ajh0nam3ssgwnn5me7: hello there bob [alice]: Bob's message verified! diff --git a/pages/guides/agents/advanced/name-service.mdx b/pages/guides/agents/advanced/name-service.mdx index 75bcee6a2..9bcb172a1 100644 --- a/pages/guides/agents/advanced/name-service.mdx +++ b/pages/guides/agents/advanced/name-service.mdx @@ -529,6 +529,7 @@ Within your terminal windows you should see something similar to the following: INFO: [bob-0]: Registering on almanac contract...complete INFO: [network]: Registering name... INFO: [network]: Registering name...complete + INFO: [bob-0]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8001&address=agent1qwep424538eh7fcruqcnx8la3q3tgl4tgksrcdtahqs7dqgs4rewsx4jefu INFO: [bob-0]: Starting server on http://0.0.0.0:8001 (Press CTRL+C to quit) INFO: [bob-0]: Received message from agent1qwquu2d237gntfugrnwch38g8jkl76vdr05qjm4wyps6ap04fvt8vtzhpqw: Hello there bob. INFO: [bob-0]: Received message from agent1qwquu2d237gntfugrnwch38g8jkl76vdr05qjm4wyps6ap04fvt8vtzhpqw: Hello there bob. diff --git a/pages/guides/agents/advanced/register-in-almanac.mdx b/pages/guides/agents/advanced/register-in-almanac.mdx index 57df5c7ac..f1f4a3c91 100644 --- a/pages/guides/agents/advanced/register-in-almanac.mdx +++ b/pages/guides/agents/advanced/register-in-almanac.mdx @@ -86,7 +86,19 @@ There's a few things happening in this script; we initialize Alice with an endpo We also have to define `agent.run()`. This `.run()` function runs the agent, but more importantly this registers the agent to the Almanac when code is initialized. -Once you run your script, your agent will start the registration process automatically, the balance of the agent's wallet will be checked and funded if needed. Finally, it will try to register on the Almanac contract. Then, we will be ready to start to a remote communication with other agents registered within the Almanac contract. +Once you run your script, your agent will start the registration process automatically. Finally, it will try to register on the Almanac contract. Then, we will be ready to start to a remote communication with other agents registered within the Almanac contract. The output should be similar to: + + ``` + INFO: [Alice]: Registration on Almanac API successful + INFO: [Alice]: Registering on almanac contract... + INFO: [Alice]: Registering on almanac contract...complete + INFO: [Alice]: Hello + INFO: [Alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qfccl7xc2hrwzntx9rxgf56lh80kuf5av6h4nyk3ywvxyu846zqwyl3g0jf + INFO: [Alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) + INFO: [Alice]: Hello + INFO: [Alice]: Hello + INFO: [Alice]: Hello + ``` The output for the above code would be similar to the following: diff --git a/pages/guides/agents/getting-started/_meta.json b/pages/guides/agents/getting-started/_meta.json index 9a7fa70de..bb6f3b957 100644 --- a/pages/guides/agents/getting-started/_meta.json +++ b/pages/guides/agents/getting-started/_meta.json @@ -1,23 +1,23 @@ { "whats-an-agent": { "title": "What's an Agent?", - "tags": ["Beginner", "Python", "local"], + "tags": ["Beginner", "Python"], "timestamp": true }, "installing-uagent": { "title": "uAgents Framework installation", - "tags": ["Beginner", "Python", "local"], + "tags": ["Beginner", "Python"], "timestamp": true }, "create-a-uagent": { "title": "Create your first agent", - "tags": ["Beginner", "Python", "local"], + "tags": ["Beginner", "Python", "Local"], "timestamp": true }, "seedphrase": "Seed phrase", "getting-uagent-address": { "title": "Agents address", - "tags": ["Beginner", "Python", "Address", "local"], + "tags": ["Beginner", "Python", "Address", "Local"], "timestamp": true } } diff --git a/pages/guides/agents/getting-started/seedphrase.mdx b/pages/guides/agents/getting-started/seedphrase.mdx index d6e95d2c5..0baa99ab7 100644 --- a/pages/guides/agents/getting-started/seedphrase.mdx +++ b/pages/guides/agents/getting-started/seedphrase.mdx @@ -4,4 +4,4 @@ Imagine you have a treasure chest full of your code, but instead of a key, it ha If you remember your seed phrase, you can open your treasure chest anytime, anywhere, even if you lose the chest. In our case, our chest is our agent identity. However, if someone else learns your seed phrase, they can impersonate your agent! Not just impersonate, but they would also have access to the wallet of the agent. So, it's super important to keep the seed phrase safe, like hiding it in a secret place or writing it down where no one can find it. Never tell anyone your seed phrase unless you really, really trust them! -uAgents creates an address for your agent cryptographically with your defined seed phrase, this all happens out of view in the uAgents library [view the src](https://github.com/fetchai/uAgents/blob/3a76aa0f364fcd6464562f495d722fe80568a24b/python/src/uagents/agent.py#L425). \ No newline at end of file +uAgents creates an address for your agent cryptographically with your defined seed phrase, this all happens out of view in the uAgents library [view the src](https://github.com/fetchai/uAgents/blob/3a76aa0f364fcd6464562f495d722fe80568a24b/python/src/uagents/agent.py#L425). diff --git a/pages/guides/agents/intermediate/_meta.json b/pages/guides/agents/intermediate/_meta.json index ff62760f6..b67b64015 100644 --- a/pages/guides/agents/intermediate/_meta.json +++ b/pages/guides/agents/intermediate/_meta.json @@ -1,7 +1,7 @@ { "communicating-with-other-agents": { "title": "Communicating with other agents", - "tags": ["Intermediate", "Python", "Communication"], + "tags": ["Intermediate", "Python", "Communication", "Local"], "timestamp": true }, "protocols": { @@ -11,43 +11,42 @@ }, "handlers": { "title": "Agent Handlers (on_...)", - "tags": ["Intermediate", "Python", "Handlers"], + "tags": ["Intermediate", "Python", "Handlers", "Local"], "timestamp": true }, "storage-function": { "title": "Agents storage functions", - "tags": ["Intermediate", "Python", "Storage"], + "tags": ["Intermediate", "Python", "Storage", "Local"], "timestamp": true }, - "agent-types": { "title": "Hosted, Local, and Mailbox Agents", - "tags": ["Intermediate", "Python", "Agents"], + "tags": ["Intermediate", "Python", "Agents", "Hosted", "Local", "Mailbox"], "timestamp": true }, "bureau": { "title": "Bureau", - "tags": ["Intermediate", "Python", "Bureau"], + "tags": ["Intermediate", "Python", "Bureau", "Local"], "timestamp": true }, "broadcast": { "title": "Broadcast", - "tags": ["Intermediate", "Python", "Broadcast"], + "tags": ["Intermediate", "Python", "Broadcast", "Local"], "timestamp": true }, "mailbox": { "title": "Agents Mailboxes", - "tags": ["Intermediate", "Python", "Communication", "Mailbox"], + "tags": ["Intermediate", "Python", "Communication", "Mailbox", "Local"], "timestamp": true }, "local-agent-inspector": { "title": "Local Agent Inspector", - "tags": ["Intermediate", "Python", "Agents"], + "tags": ["Intermediate", "Python", "Agents", "Local"], "timestamp": true }, "agent-functions": { "title": "Agent Functions", - "tags": ["Intermediate", "Python", "Functions", "AI Engine"], + "tags": ["Intermediate", "Python", "Functions", "AI Engine", "Local"], "timestamp": true }, "ai-engine-compatible-agent": { @@ -57,25 +56,31 @@ }, "options-for-running-local-agents": { "title": "Options for running local agents", - "tags": ["Intermediate", "Python", "Agentverse"], + "tags": ["Intermediate", "Python", "Agentverse", "Local"], "timestamp": true }, "hosted-agent": { "title": "Hosted agent", - "tags": ["Intermediate", "Python", "Agentverse"], + "tags": ["Intermediate", "Python", "Agentverse", "Hosted"], "timestamp": true }, "langchain-rag-agent": { "title": "Building a RAG Agent", - "tags": ["Intermediate", "Python", "Functions", "LangChain", "AI Engine"], + "tags": [ + "Intermediate", + "Python", + "Functions", + "LangChain", + "AI Engine", + "Local" + ], "timestamp": true }, "rest-endpoints": { "title": "REST endpoints", - "tags": ["Intermediate", "Python", "REST API", "HTTP Protocols"], + "tags": ["Intermediate", "Python", "REST API", "HTTP Protocols", "Local"], "timestamp": true }, - "public-private-agents": { "title": "Public and private Agents", "tags": ["Intermediate", "Python"], @@ -83,12 +88,12 @@ }, "send-tokens": { "title": "Send tokens with Agents", - "tags": ["Intermediate", "Python", "Use Cases"], + "tags": ["Intermediate", "Python", "Use Cases", "Local"], "timestamp": true }, "primary-secondary-functions": { "title": "Multi-file agent pipeline for AI Engine: Hugging face API to create a multi agent pipeline", - "tags": ["Intermediate", "Python", "Functions", "AI Engine"], + "tags": ["Intermediate", "Python", "Functions", "AI Engine", "Local"], "timestamp": true } } diff --git a/pages/guides/agents/intermediate/agent-functions.mdx b/pages/guides/agents/intermediate/agent-functions.mdx index 8a2bf4912..24fdcb6c0 100644 --- a/pages/guides/agents/intermediate/agent-functions.mdx +++ b/pages/guides/agents/intermediate/agent-functions.mdx @@ -106,7 +106,7 @@ It is important that you provide the `name`, `port`, `seed` and `endpoint` for y A few things to note; you'll need to be running this agent on infrastructure that allows you to open a port, in our example we run on port `6145`. -The agent is initialized with an endpoint, and a port - this is so that we can receive messages, and other agents know where to send them. We call `fund_agent_if_low` to get some funds, if we need them. And we define our protocol, which is just an int as seen in the `Request` object. +The agent is initialized with an endpoint, and a port - this is so that we can receive messages, and other agents know where to send them. We call `fund_agent_if_low` to get some funds, if we need them. And we define our protocol, which is just an `int` as seen in the `Request` object. Our `on_message` doesn't do much other than return a number between 1 and the defined `dice_sides` from the message inclusive. However, the response type is of `UAgentResponse` which is essential to communicate with DeltaV. @@ -118,8 +118,10 @@ Finally, we run our agent as follows: `python simple_function.py` ``` INFO: [dungeonsanddragonsdiceroll]: Manifest published successfully: DungeonsAndDragonsDiceRoll + INFO: [dungeonsanddragonsdiceroll]: Registration on Almanac API successful INFO: [dungeonsanddragonsdiceroll]: Registering on almanac contract... INFO: [dungeonsanddragonsdiceroll]: Registering on almanac contract...complete + INFO: [dungeonsanddragonsdiceroll]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A6145&address=agent1qvwk0ntr38yyghccrg530hnnm88r5uske4hdcalsa7gqp7sjgx42k4mp62r INFO: [dungeonsanddragonsdiceroll]: agent1qvh76795enwgnzkrjpedlnqxwv83d8wxnkkcszs9z46zc3qpfs3yvzc5kuw INFO: [dungeonsanddragonsdiceroll]: Starting server on http://0.0.0.0:6145 (Press CTRL+C to quit) ``` diff --git a/pages/guides/agents/intermediate/communicating-with-other-agents.mdx b/pages/guides/agents/intermediate/communicating-with-other-agents.mdx index 5b434e558..0dc58eb16 100644 --- a/pages/guides/agents/intermediate/communicating-with-other-agents.mdx +++ b/pages/guides/agents/intermediate/communicating-with-other-agents.mdx @@ -310,6 +310,8 @@ We are now ready to run the script: `python agents_communication.py` The output would be: ``` + WARNING: [sigmar]: No endpoints provided. Skipping registration: Agent won't be reachable. + WARNING: [slaanesh]: No endpoints provided. Skipping registration: Agent won't be reachable. INFO: [bureau]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: [sigmar]: Received message from agent1q0mau8vkmg78xx0sh8cyl4tpl4ktx94pqp2e94cylu6haugt2hd7j9vequ7: hello there sigmar INFO: [slaanesh]: Received message from agent1qww3ju3h6kfcuqf54gkghvt2pqe8qp97a7nzm2vp8plfxflc0epzcjsv79t: hello there slaanesh @@ -318,7 +320,7 @@ The output would be: INFO: [sigmar]: Received message from agent1q0mau8vkmg78xx0sh8cyl4tpl4ktx94pqp2e94cylu6haugt2hd7j9vequ7: hello there sigmar ``` -However these agents can only communicate with eachother on their local network, let's next see how we can register these agents to be able to commmunicate with many other agents in the open network. +However, these agents can only communicate with each other on their local network, let's next see how we can register these agents to be able to communicate with many other agents in the open network. ## Agents Remote Communication: the Almanac Contract @@ -345,13 +347,13 @@ The first step would be to create two different Python scripts for this task, ea ```py copy filename="windows" echo. > remote_agents_slaanesh.py ``` - + ```py copy filename="ubuntu" touch remote_agents_slaanesh.py ``` - + Sigmar: @@ -367,13 +369,13 @@ The first step would be to create two different Python scripts for this task, ea ```py copy filename="windows" echo. > remote_agents_sigmar.py ``` - + ```py copy filename="ubuntu" touch remote_agents_sigmar.py ``` - + Let's start by defining the script for **sigmar**. @@ -420,18 +422,18 @@ Let's start by defining the script for **sigmar**. hosted={true} /> + ```py copy filename="remote_agents_sigmar.py" - sigmar = Agent( name="sigmar", port=8000, seed="sigmar secret phrase", endpoint=["http://127.0.0.1:8000/submit"], ) - + ``` @@ -444,50 +446,49 @@ Let's start by defining the script for **sigmar**. + + ```py copy filename="remote_agents_sigmar.py" - - @sigmar.on_interval(period=2.0) async def send_message(ctx: Context): await ctx.send(RECIPIENT_ADDRESS, Message(message="hello there slaanesh")) - - @sigmar.on_message(model=Message) - async def message_handler(ctx: Context, sender: str, msg: Message): - ctx.logger.info(f"Received message from {sender}: {msg.message}") - ``` - - Here, the `.on_interval()` decorator schedules the `send_message()` function to be run every 2 seconds. Inside the function, there is an asynchronous call indicated by the `ctx.send()` method. This call sends a message with the content `"hello there slaanesh"` to the `RECIPIENT_ADDRESS`. 4. We then need to define a function for `sigmar` to handle incoming messages from other agents: + + ```py copy filename="remote_agents_sigmar.py" + @sigmar.on_message(model=Message) + async def message_handler(ctx: Context, sender: str, msg: Message): + ctx.logger.info(f"Received message from {sender}: {msg.message}") + if __name__ == "__main__": sigmar.run() @@ -497,7 +498,6 @@ Let's start by defining the script for **sigmar**. - Here, we have used the `.on_message()` decorator to register the `message_handler()` coroutine function as a handler for incoming messages of type `Message`. The `message_handler()` function takes three arguments: `ctx`, `sender`, and `msg`. Inside this function, we call the `ctx.logger.info()` method to log information about the received message, including the sender and message content. @@ -567,6 +567,7 @@ We can now proceed by writing the script for agent `slaanesh`. hosted={true} /> + @@ -583,18 +584,15 @@ We can now proceed by writing the script for agent `slaanesh`. seed="slaanesh secret phrase", endpoint=["http://127.0.0.1:8001/submit"], ) - ``` - - 2. Let's now define a function for `slaanesh` to handle incoming messages and answering back to the sender: - + - + ```py copy filename="remote_agents_slaanesh.py" - - @slaanesh.on_message(model=Message) - async def message_handler(ctx: Context, sender: str, msg: Message): - ctx.logger.info(f"Received message from {sender}: {msg.message}") - - await ctx.send(sender, Message(message="hello there sigmar")) - if __name__ == "__main__": - slaanesh.run() + @slaanesh.on_message(model=Message) + async def message_handler(ctx: Context, sender: str, msg: Message): + ctx.logger.info(f"Received message from {sender}: {msg.message}") + + await ctx.send(sender, Message(message="hello there sigmar")) + + if __name__ == "__main__": + slaanesh.run() ``` - - Here, we have defined an asynchronous `message_handler()` function for slaanesh to handle incoming messages from other uAgents. The function is decorated with `.on_message()`, and it is triggered whenever a message of type `Message` is received by `slaanesh`. When a message is received, the handler function logs the sender's address and the content of the message. It then sends a response back to the sender using the `ctx.send()` with a new message. The response message contains the `Message` data model with a `"hello there sigmar"` message. 3. Save the script. @@ -685,6 +681,7 @@ The output will depend on the terminal: - **Sigmar**: ``` + INFO: [sigmar]: Registration on Almanac API successful INFO: [sigmar]: Registering on almanac contract... INFO: [sigmar]: Registering on almanac contract...complete INFO: [sigmar]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qvwqu6a0km09mq4f6j6kmke9smswmgcergmml9a54av9449rqtmmxy4qwe6 @@ -697,6 +694,7 @@ The output will depend on the terminal: - **Slaanesh**: ``` + INFO: [slaanesh]: Registration on Almanac API successful INFO: [slaanesh]: Registering on almanac contract... INFO: [slaanesh]: Registering on almanac contract...complete INFO: [slaanesh]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8001&address=agent1qvm7v76zs6w2x90xvq99yc5xh7c2thjtm44zc09me556zxnra627gkf4zum diff --git a/pages/guides/agents/intermediate/hosted-agent.mdx b/pages/guides/agents/intermediate/hosted-agent.mdx index b818710e7..79436045f 100644 --- a/pages/guides/agents/intermediate/hosted-agent.mdx +++ b/pages/guides/agents/intermediate/hosted-agent.mdx @@ -60,12 +60,17 @@ Let's show this with an example: Output in Agentverse would be: ``` - 2024-06-27 09:05:14 Info Agent [INFO]: My count is: 1 - 2024-06-27 09:05:14 Info Agent [INFO]: My global is: 1 - 2024-06-27 09:05:15 Info Agent [INFO]: My count is: 2 - 2024-06-27 09:05:15 Info Agent [INFO]: My global is: 1 - 2024-06-27 09:05:17 Info Agent [INFO]: My count is: 3 - 2024-06-27 09:05:17 Info Agent [INFO]: My global is: 1 + WARNING: [Hosted]: No endpoints provided. Skipping registration: Agent won't be reachable. + INFO: [Hosted]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qv9h2wymp8l4vg2ezeszxkllz6lkmh9uhz7rvfyamy0wslhlaxh65fmemgt + INFO: [Hosted]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) + INFO: [Hosted]: My count is: 1 + INFO: [Hosted]: My global is: 1 + INFO: [Hosted]: My count is: 2 + INFO: [Hosted]: My global is: 2 + INFO: [Hosted]: My count is: 3 + INFO: [Hosted]: My global is: 3 + INFO: [Hosted]: My count is: 4 + INFO: [Hosted]: My global is: 4 ``` You can see from this output, **global is never updated**. diff --git a/pages/guides/agents/intermediate/local-agent-inspector.mdx b/pages/guides/agents/intermediate/local-agent-inspector.mdx index fbb65a92c..0e84d85c4 100644 --- a/pages/guides/agents/intermediate/local-agent-inspector.mdx +++ b/pages/guides/agents/intermediate/local-agent-inspector.mdx @@ -39,7 +39,6 @@ For instance, consider the following simple local agent: /> - ```py copy filename="agent_inspector_example.py" @@ -74,27 +73,22 @@ For instance, consider the following simple local agent: - - Once you successfully run your local agent and register it into the Almanac (**Make sure your Agent has enough funds to do so!**), you will be able to access the Inspector via the terminal log, which provides a dedicated link to the Inspector page. By running the above Agent, the output you get should be similar to the following: ``` Your agent's address is: agent1qvrapvpxltu54tt3qnud5mlkul9y9d9tfn7xfpq4ec74cq4mkym6yl3jkdw - INFO: [ Bob]: Registering on Almanac API successful + INFO: [ Bob]: Registration on Almanac API successful INFO: [ Bob]: Registering on almanac contract... INFO: [ Bob]: Registering on almanac contract...complete - INFO: [ Bob]: Agent inspector available at https://agentverse.ai/inspect/?uri=http://127.0.0.1:8001 + INFO: [ Bob]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8001&address=agent1q2kxet3vh0scsf0sm7y2erzz33cve6tv5uk63x64upw5g68kr0chkv7hw50 INFO: [ Bob]: Starting server on http://0.0.0.0:8001 (Press CTRL+C to quit) ``` -By clicking on the dedicated link depicted here, you will then be redirected to the **Inspector Dashboard**. +By clicking on the dedicated link depicted here, you will then be redirected to the **Inspector Dashboard**. A pop-up message will appear saying that your Agent was connected successfully. -![](src/images/guides/inspector/inspector_1.png) - -As you can see, here your local Agent will be listed and a pop-up message will appear saying that your Agent was added to the list. By clicking the dedicated **Connect Agent** button, you are able to connect Agents to the inspector by providing the Agent Address. +![](src/images/guides/inspector/inspector_2.png) -Instead, by clicking on the Agent box, you can enter the Inspector Dashboard and check out all details about your Local Agent and its messages: +Here you can view all the information about your local Agent, including details about all messaged sent and received by the Agent. -![](src/images/guides/inspector/inspector_2.png) diff --git a/pages/guides/agents/intermediate/mailbox.mdx b/pages/guides/agents/intermediate/mailbox.mdx index 5203bc813..de2a47a83 100644 --- a/pages/guides/agents/intermediate/mailbox.mdx +++ b/pages/guides/agents/intermediate/mailbox.mdx @@ -81,8 +81,11 @@ You should get something similar within your terminal output: ``` Your agent's address is: agent1qfa53drat8rzau90u4494gx5mhj3v87tm4t5cukd7gkegxcm5vx5pku7kf + INFO: [alice]: Registration on Almanac API successful INFO: [alice]: Registering on almanac contract... INFO: [alice]: Registering on almanac contract...complete + INFO: [alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qfa53drat8rzau90u4494gx5mhj3v87tm4t5cuzkd7gkegxcm5vx5pku7kf + INFO: [alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: [alice]: Connecting to mailbox server at agentverse.ai INFO: [alice]: Mailbox access token acquired ``` @@ -197,19 +200,42 @@ Let's create and run a second agent to message Alice every 3 seconds. You need t ## Testing -With both `alice` and `agent_2` running, stop `alice` and let `agent_2` run for a further 20 seconds, or so. After -that period of time, restart `alice` and she should print out a bunch of messages from the mailbox, like so: +With both `alice` and `agent_2` running, stop `alice` and let `agent_2` run for a further 20 seconds, or so. - ``` - INFO: [alice]: Registering on almanac contract...complete - INFO: [alice]: Connecting to mailbox server at agentverse.ai - INFO: [alice]: Mailbox access token acquired - ``` +The output should be similar to the following, depeding on the terminal window: + +- Alice: + + ``` + Your agent's address is: agent1qtpr2xgmml964v44sy78gxhsrvakcgj567tthxeyz5fj844hcft5ww2rwkn + INFO: [Alice]: Registration on Almanac API successful + INFO: [alice]: Registering on almanac contract... + INFO: [alice]: Registering on almanac contract...complete + INFO: [Alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qtpr2xgmml964v44sy78gxhsrvakcgj567tthxeyz5fj844hcft5ww2rwkn + INFO: [Alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) + INFO: [Alice]: Connecting to mailbox server at agentverse.ai + INFO: [Alice]: Mailbox access token acquired + INFO: [Alice]: Received message from agent1qvfnlashfjq67fsczqfs82mmnxu4ffu3xftsc75w62mfskhdnavtq0cknv9: hello 2024-11-06 + INFO: [Alice]: Received message from agent1qvfnlashfjq67fsczqfs82mmnxu4ffu3xftsc75w62mfskhdnavtq0cknv9: hello 2024-11-06 + INFO: [Alice]: Received message from agent1qvfnlashfjq67fsczqfs82mmnxu4ffu3xftsc75w62mfskhdnavtq0cknv9: hello 2024-11-06 + ``` + +- Agent 2: + + ``` + INFO: [agent_2]: Registration on Almanac API successful + INFO: [agent_2]: Registering on almanac contract... + INFO: [agent_2]: Registering on almanac contract...complete + INFO: [agent_2]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8001&address=agent1qvfnlashfjq67fsczqfs82mmnxu4ffu3xftsc75w62mfskhdnavtq0cknv9 + INFO: [agent_2]: Starting server on http://0.0.0.0:8001 (Press CTRL+C to quit) + ``` **You can now restart your agent!** +You will see a bunch of messages being displayed by `alice` which are sent by `agent_2`. + - Remember, each agent needs a different dedicated Mailbox! + Whenever working with mulitple local Agents, you need a different dedicated Mailbox for each one of them! Now your agent doesn't need to be running all the time as messages will be waiting when it comes back online. diff --git a/pages/guides/agents/intermediate/options-for-running-local-agents.mdx b/pages/guides/agents/intermediate/options-for-running-local-agents.mdx index a46b3375e..be607f806 100644 --- a/pages/guides/agents/intermediate/options-for-running-local-agents.mdx +++ b/pages/guides/agents/intermediate/options-for-running-local-agents.mdx @@ -109,9 +109,10 @@ Finally, we run our agent as follows: `python agent_endpoint.py` ``` INFO: [dungeonsanddragonsdiceroll]: Manifest published successfully: DungeonsAndDragonsDiceRoll + INFO: [dungeonsanddragonsdiceroll]: Registration on Almanac API successful INFO: [dungeonsanddragonsdiceroll]: Registering on almanac contract... INFO: [dungeonsanddragonsdiceroll]: Registering on almanac contract...complete - INFO: [dungeonsanddragonsdiceroll]: agent1qvh76795enwgnzkrjpedlnqxwv83d8wxnkkcszs9z46zc3qpfs3yvzc5kuw + INFO: [dungeonsanddragonsdiceroll]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A6145&address=agent1qvwk0ntr38yyghccrg530hnnm88r5uske4hdcalsa7gqp7sjgx42k4mp62r INFO: [dungeonsanddragonsdiceroll]: Starting server on http://0.0.0.0:6145 (Press CTRL+C to quit) ``` @@ -181,7 +182,17 @@ Let's start by creating a local agent named `alice` with a `handle_message()` fu -To correctly run this code, you need to provide the `AGENT_MAILBOX_KEY`, `SEED_PHRASE`, `name`, `seed` and `mailbox` parameters. +To correctly run this code, you need to provide the `AGENT_MAILBOX_KEY`, `SEED_PHRASE`, `name`, `seed` and `mailbox` parameters. The output should look similarly to the following: + + ``` + INFO: [alice]: Registration on Almanac API successful + INFO: [alice]: Registering on almanac contract... + INFO: [alice]: Registering on almanac contract...complete + INFO: [alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qfa53drat8rzau90u4494gx5mhj3v87tm4t5cuzkd7gkegxcm5vx5pku7kf + INFO: [alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) + INFO: [alice]: Connecting to mailbox server at agentverse.ai + INFO: [alice]: Mailbox access token acquired + ``` You can easily create a Mailbox by first retrieving your local agent address and head over to the **Agentverse: My Agents** tab. Here, click on **Local Agents** and click on **Connect Local Agent**. diff --git a/pages/guides/agents/intermediate/send-tokens.mdx b/pages/guides/agents/intermediate/send-tokens.mdx index 2d608e626..e26bce498 100644 --- a/pages/guides/agents/intermediate/send-tokens.mdx +++ b/pages/guides/agents/intermediate/send-tokens.mdx @@ -348,6 +348,8 @@ Run the script: `python sending_tokens.py` The output should be as follows: ``` + WARNING: [Alice]: No endpoints provided. Skipping registration: Agent won't be reachable. + WARNING: [ Bob]: No endpoints provided. Skipping registration: Agent won't be reachable. INFO: [bureau]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: [ bob]: Received payment request from agent1qdp9j2ev86k3h5acaayjm8tpx36zv4mjxn05pa2kwesspstzj697xy5vk2a: wallet_address='fetch1967p3vkp0yngdfturv4ypq2p4g760ml705wcxy' amount=100 denom='atestfet' INFO: [alice]: Received transaction info from agent1q2kxet3vh0scsf0sm7y2erzz33cve6tv5uk63x64upw5g68kr0chkv7hw50: tx_hash='DB662CCF415C7B0C9A02928967BE1817506D02A041AA05CA48DCE5CF87D5A638' diff --git a/pages/guides/agentverse/agentverse-functions/_meta.json b/pages/guides/agentverse/agentverse-functions/_meta.json index dda136921..1c38360d9 100644 --- a/pages/guides/agentverse/agentverse-functions/_meta.json +++ b/pages/guides/agentverse/agentverse-functions/_meta.json @@ -1,12 +1,12 @@ { "registering-agent-services": { "title": "Register Agentverse Functions", - "tags": ["Intermediate", "Python", "Functions", "Agentverse"], + "tags": ["Intermediate", "Python", "Functions", "Agentverse", "Hosted"], "timestamp": true }, "registering-agent-coin-toss": { "title": "Agentverse Functions: coin toss agent", - "tags": ["Intermediate", "Python", "Functions", "Agentverse"], + "tags": ["Intermediate", "Python", "Functions", "Agentverse", "Hosted"], "timestamp": true }, "field-descriptions-for-deltav": { diff --git a/pages/guides/agentverse/agentverse-mailbox/_meta.json b/pages/guides/agentverse/agentverse-mailbox/_meta.json index 17162f579..1bc0312c4 100644 --- a/pages/guides/agentverse/agentverse-mailbox/_meta.json +++ b/pages/guides/agentverse/agentverse-mailbox/_meta.json @@ -1,7 +1,7 @@ { "utilising-the-mailbox": { "title": "Agentverse: Mailbox", - "tags": ["Intermediate", "Python", "Communication", "Mailbox"], + "tags": ["Intermediate", "Python", "Communication", "Mailbox", "Local"], "timestamp": true } } diff --git a/pages/guides/agentverse/creating-agentverse-agents/_meta.json b/pages/guides/agentverse/creating-agentverse-agents/_meta.json index 3958553c5..9581d5884 100644 --- a/pages/guides/agentverse/creating-agentverse-agents/_meta.json +++ b/pages/guides/agentverse/creating-agentverse-agents/_meta.json @@ -1,17 +1,22 @@ { "creating-a-hosted-agent": { "title": "Agentverse: Hosted Agents", - "tags": ["Beginner", "Python", "Agentverse"], + "tags": ["Beginner", "Python", "Agentverse", "Hosted"], "timestamp": true }, "simple-dice-roll-agent": { "title": "Agentverse: Dice Roll agent", - "tags": ["Beginner", "Python", "Functions", "Agentverse"], + "tags": ["Beginner", "Python", "Functions", "Agentverse", "Hosted"], "timestamp": true }, "allowed-imports": { "title": "Agentverse: Allowed Imports", "tags": ["Beginner", "Python", "Agentverse"], "timestamp": true + }, + "agentverse-teams": { + "title": "Agentverse Teams", + "tags": ["Beginner", "Python", "Agentverse", "Teams"], + "timestamp": true } } diff --git a/pages/guides/agentverse/creating-agentverse-agents/allowed-imports.mdx b/pages/guides/agentverse/creating-agentverse-agents/allowed-imports.mdx index a3f45e6c7..b40440a81 100644 --- a/pages/guides/agentverse/creating-agentverse-agents/allowed-imports.mdx +++ b/pages/guides/agentverse/creating-agentverse-agents/allowed-imports.mdx @@ -247,13 +247,13 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from bs4 import BeautifulSoup import requests - + # Fetch the content of a webpage response = requests.get("https://example.com") - + # Parse the HTML content soup = BeautifulSoup(response.content, "html.parser") - + # Extract and print the page title print(soup.title.string) @@ -268,16 +268,16 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import faiss import numpy as np - + # Create a dataset of 128-dimensional vectors data = np.random.random((100, 128)).astype('float32') - + # Create an index using L2 (Euclidean) distance index = faiss.IndexFlatL2(128) - + # Add vectors to the index index.add(data) - + # Perform a search to find the 5 nearest neighbors query = np.random.random((1, 128)).astype('float32') distances, indices = index.search(query, k=5) @@ -293,14 +293,14 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from babble import Client, Identity - + # create a set of agents with random identities client1 = Client('agent1.....', Identity.generate()) client2 = Client('agent1.....', Identity.generate()) - + # send a message from one client to another client1.send(client2.delegate_address, "why hello there") - + # receive the messages from the other client for msg in client2.receive(): print(msg.text) @@ -315,7 +315,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import google.generativeai as genai import os - + genai.configure(api_key=os.environ["GEMINI_API_KEY"]) model = genai.GenerativeModel('gemini-1.5-flash') @@ -332,11 +332,11 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_anthropic import ChatAnthropic from langchain_core.messages import AIMessage, HumanMessage - + model = ChatAnthropic(model="claude-3-opus-20240229", temperature=0, max_tokens=1024) - + message = HumanMessage(content="What is the capital of France?") - + response = model.invoke([message]) ``` @@ -350,7 +350,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import bs4 from langchain_community.document_loaders import WebBaseLoader - + # Only keep post title, headers, and content from the full HTML. bs4_strainer = bs4.SoupStrainer(class_=("post-title", "post-header", "post-content")) loader = WebBaseLoader( @@ -358,7 +358,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i bs_kwargs={"parse_only": bs4_strainer}, ) docs = loader.load() - + len(docs[0].page_content) ``` #### langchain-core @@ -370,7 +370,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_core.messages import HumanMessage from langchain_google_genai import ChatGoogleGenerativeAI - + llm = ChatGoogleGenerativeAI(model="gemini-pro-vision") # example message = HumanMessage( @@ -395,7 +395,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_core.messages import HumanMessage from langchain_google_genai import ChatGoogleGenerativeAI - + llm = ChatGoogleGenerativeAI(model="gemini-pro-vision") # example message = HumanMessage( @@ -420,7 +420,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_core.messages import HumanMessage from langchain_google_vertexai import ChatVertexAI - + llm = ChatVertexAI(model_name="gemini-pro-vision") # example message = HumanMessage( @@ -444,7 +444,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_openai import ChatOpenAI - + llm = ChatOpenAI( model="gpt-4o", temperature=0, @@ -466,12 +466,12 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from langchain_text_splitters import RecursiveCharacterTextSplitter - + text_splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200, add_start_index=True ) all_splits = text_splitter.split_documents(docs) - + len(all_splits) ``` @@ -490,7 +490,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i from langchain_core.runnables import RunnablePassthrough from langchain_openai import OpenAIEmbeddings from langchain_text_splitters import RecursiveCharacterTextSplitter - + # Load, chunk and index the contents of the blog. loader = WebBaseLoader( web_paths=("https://lilianweng.github.io/posts/2023-06-23-agent/",), @@ -501,27 +501,25 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ), ) docs = loader.load() - + text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200) splits = text_splitter.split_documents(docs) vectorstore = Chroma.from_documents(documents=splits, embedding=OpenAIEmbeddings()) - + # Retrieve and generate using the relevant snippets of the blog. retriever = vectorstore.as_retriever() prompt = hub.pull("rlm/rag-prompt") - - + def format_docs(docs): return "\n\n".join(doc.page_content for doc in docs) - - + rag_chain = ( {"context": retriever | format_docs, "question": RunnablePassthrough()} | prompt | llm | StrOutputParser() ) - + rag_chain.invoke("What is Task Decomposition?") ``` @@ -534,15 +532,15 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import nltk nltk.download('punkt') - + from nltk.tokenize import word_tokenize - + text = "This is an example sentence, showing off the tokenization process." - + tokens = word_tokenize(text) - + print(tokens) - + # ['This', 'is', 'an', 'example', 'sentence', ',', 'showing', 'off', 'the', 'tokenization', 'process', '.'] ``` @@ -555,12 +553,12 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import os from openai import OpenAI - + client = OpenAI( # This is the default and can be omitted api_key=os.environ.get("OPENAI_API_KEY"), ) - + chat_completion = client.chat.completions.create( messages=[ { @@ -581,14 +579,14 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy import random from tenacity import retry - + @retry def do_something_unreliable(): if random.randint(0, 10) > 1: raise IOError("Broken sauce, everything is hosed!!!111one") else: return "Awesome sauce!" - + print(do_something_unreliable()) ``` @@ -600,7 +598,7 @@ Integrate Agents with the AI Engine to perform a wide variety tasks, including i ```py copy from unstructured.partition.auto import partition - + elements = partition(filename="example-docs/fake-email.eml") print("\n\n".join([str(el) for el in elements])) ``` diff --git a/pages/guides/quickstart-with/CrewAI/_meta.json b/pages/guides/quickstart-with/CrewAI/_meta.json index 21d8093bc..90c37df4a 100644 --- a/pages/guides/quickstart-with/CrewAI/_meta.json +++ b/pages/guides/quickstart-with/CrewAI/_meta.json @@ -7,7 +7,8 @@ "CrewAI", "Functions", "Mailbox", - "Use Cases" + "Use Cases", + "Local" ], "timestamp": true } diff --git a/pages/guides/quickstart-with/OpenAI/_meta.json b/pages/guides/quickstart-with/OpenAI/_meta.json index d52604e3d..2878e8555 100644 --- a/pages/guides/quickstart-with/OpenAI/_meta.json +++ b/pages/guides/quickstart-with/OpenAI/_meta.json @@ -7,7 +7,8 @@ "OpenAI", "Swarm", "Functions", - "Use Cases" + "Use Cases", + "Local" ], "timestamp": true } diff --git a/pages/guides/quickstart-with/langchain/_meta.json b/pages/guides/quickstart-with/langchain/_meta.json index ef307f076..59498bed1 100644 --- a/pages/guides/quickstart-with/langchain/_meta.json +++ b/pages/guides/quickstart-with/langchain/_meta.json @@ -1,12 +1,26 @@ { "creating-an-agent-with-langchain": { "title": "Getting started with Fetch.ai x Langchain", - "tags": ["Intermediate", "Python", "Functions", "LangChain", "Use Cases"], + "tags": [ + "Intermediate", + "Python", + "Functions", + "LangChain", + "Use Cases", + "Local" + ], "timestamp": true }, "multiple-agent-workflows": { "title": "Multi-agent workflows with Fetch.ai x Langchain", - "tags": ["Intermediate", "Python", "LangChain", "Functions", "Use Cases"], + "tags": [ + "Intermediate", + "Python", + "LangChain", + "Functions", + "Use Cases", + "Local" + ], "timestamp": true } }