Skip to content

Commit

Permalink
content(docs): adding contribution guide, and getting tokens referenc…
Browse files Browse the repository at this point in the history
…e, and minors (#144)

Co-authored-by: josh <[email protected]>
  • Loading branch information
devjsc and josh authored Sep 19, 2023
1 parent 4b45ec9 commit 1dda59b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 12 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contribution Guidelines

This Documentation cannot be built without your skills and knowledge.

- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)

## <a name="question"></a> Question or Problem?

Ideally reach out to us on the dev-advocacy-slack channel.

## <a name="issue"></a> Found a Bug? Or something missing?

If there is something not right, whether it be the code, grammar or worse a broken link open up an issue and we'll allocate time to fix in upcomming sprints. You of course can also [submit a Pull Request](#submit-pr) with a fix.

## <a name="feature"></a> Missing a Feature?

You can _request_ a new feature by creating a feature request issue.

## <a name="submit-issue"></a> Updating Docs:

Please create a branch from master, update or add files into the directory you think they're best placed. Open a PR, and someone from the docs team will review.
52 changes: 52 additions & 0 deletions pages/guides/fetch-network/getting-tokens.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Token Faucet

For our test networks, we have a simple token faucet implemented to allow users of the network to get started quickly. You can send it an account address, and it will transfer some test token on it.

Token Faucets are network specific, depending on the network type they may or may not be deployed. Please check the [networks](../live-networks/) page for specific details.

The Token Faucet itself is available from the network block explorer (`GET FUNDS` button on the homepage).

Enter your `fetch...` address in the popup and click *Add funds* button. Wait a few blocks for the transaction to be processed, and you should see it appear along with some funds on your account.

## Add funds to Wallet using faucet APIs:

You can also request and get testnet tokens in your wallet using the APIs.

### Get some atestfet

```bash
curl -X POST -H 'Content-Type: application/json' -d '{"address":"<address>"}' https://faucet-dorado.fetch.ai/api/v3/claims
```

### Get some nanomobx

```bash
curl -X POST -H 'Content-Type: application/json' -d '{"address":"<address>"}' https://faucet-mobx-dorado.fetch.ai/api/v3/claims
```

### Get some ulrn

```bash
curl -X POST -H 'Content-Type: application/json' -d '{"address":"<address>"}' https://faucet-lrn-dorado.fetch.ai/api/v3/claims
```

### Sample response for fund request to faucet

```text
{"status":"ok","uuid":"<uuid>","target":"<address>"}
```

### Check the wallet balance

```bash
fetchd query bank balances <address>
```

```text
balances:
- amount: "<balance>"
denom: atestfet
pagination:
next_key: null
total: "0"
```
19 changes: 17 additions & 2 deletions pages/guides/integrations/fetch-holiday/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# μAgents Holiday Integrations ✈️

## Introduction

The μAgents Holiday Integrations example demonstrates how to integrate and coordinate multiple agents to provide information and support in the handling and booking of flights, travels, and activities so to assist you in organizing your perfect holiday in a matter of few minutes.

The example showcases how different agents can work together and how these interact with various APIs to gather and process data to help you in booking the perfect holiday according to your needs and wishes!


# Getting started 🎯

## Prerequisites
Expand All @@ -8,9 +17,11 @@ Before starting, you will need the following:
- [Poetry ↗️](https://python-poetry.org/).
- [μAgents framework ↗️](/guides/agents/installing-uagent).

steps for setting up python and installing poetry, and uagents framework can be found here

## Set up the project and virtual environment

First of all, create a `fetch-holiday` folder for your project files: `mkdir fetch-holiday`. Then, create another `src` sub-folder within it for your scripts: `mkdir src`.
Using a terminal navigate to a directory where you're happy to work within then create a `fetch-holiday` folder for your project files: `mkdir fetch-holiday`. Then, create another `src` sub-folder within it for your scripts: `mkdir src`.

To run the example, you will need **API keys** from:

Expand All @@ -32,7 +43,11 @@ To run the example, you will need **API keys** from:
- Visit [SerpAPI ↗️](https://serpapi.com/) and sign up or log in.
- Your API key will be available on the dashboard.

Once you have all three keys, create a `.env` file within the `src` folder in your project, including the following:
Once you have all three keys, create a `.env` file within the `src` folder in your project:

`touch src/.env`

Update to including the following:

```
export RAPIDAPI_API_KEY="{GET THE API KEY}"
Expand Down
7 changes: 0 additions & 7 deletions pages/guides/integrations/fetch-holiday/intro.mdx

This file was deleted.

9 changes: 6 additions & 3 deletions pages/guides/integrations/fetch-holiday/walk-through.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Let's start by defining the script for a top activities agent which provides tou

1. Enter the `activities` folder and create a script for this agent: `touch top_activities.py`

2. Within this script, import the necessary modules, create an agent `top_activities` using a secret `seed`, and make sure it has enough funds to register in the [Almanac contract ↗](/references/contracts/uagents-almanac/almanac-overview.mdx):
2. Paste in the following snippet:

```py copy
from langchain.chat_models import ChatOpenAI
Expand All @@ -57,7 +57,10 @@ Let's start by defining the script for a top activities agent which provides tou
fund_agent_if_low(agent.wallet.address())
```

3. Let's then define an **output parser** using `CommaSeparatedListOutputParser`, to help parse the results from the agent's response, and a **prompt template** defined using a `PromptTemplate` instance, which provides a structured message that explains the agent's role and expectations. It includes placeholders for variables like `city`, `date`, and `preferred_activities_str`:
We've just imported all the necessary modules, created an agent named `top_activities` using a secret [seed ↗](https://en.wikipedia.org/wiki/Random_seed) , and with ` fund_agent_if_low(agent.wallet.address())` made sure that this agent has enough funds to register in the [Almanac contract ↗](/references/contracts/uagents-almanac/almanac-overview.mdx):


3. Next let's then define an **output parser** using `CommaSeparatedListOutputParser` from the Langchain library we just imported. This helps parse the results from the agent's response. Then we define a **prompt template** by using a `PromptTemplate` instance, which provides a structured message that explains the agent's role and expectations. It includes placeholders for variables like `city`, `date`, and `preferred_activities_str`:

```py copy
output_parser = CommaSeparatedListOutputParser()
Expand All @@ -74,7 +77,7 @@ Let's start by defining the script for a top activities agent which provides tou
)
```

4. Let's create an instance of the `ChatOpenAI` class (referred to as `llm`) to interact with a large language model to understand and generate human-like text. The next steps would be loading tools for the agent and initialize it by also connecting the loaded tools and the large language model to it. Finally, define the communication protocol, called `TopActivities`:
4. Now let's create an instance of the `ChatOpenAI` class (referred to as `llm`) to interact with a large language model to understand and generate human-like text. The next steps would be loading tools for the agent and initialize it by also connecting the loaded tools and the large language model to it. Finally, define the communication protocol, called `TopActivities`:

```py copy
llm = ChatOpenAI(temperature=0.1)
Expand Down

0 comments on commit 1dda59b

Please sign in to comment.