Skip to content

Commit

Permalink
feat(docs): add set up your env in course
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixNicolaeBucsa committed Dec 10, 2024
1 parent b8b2d10 commit 6c6ff79
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 118 deletions.
4 changes: 4 additions & 0 deletions pages/guides/agent-courses/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"setup-your-env": {
"title": "Set up your development environment",
"tags": ["Beginner", "Python"]
},
"introductory-course": {
"title": "Agents 101",
"tags": ["Beginner", "Python", "Agents"]
Expand Down
2 changes: 1 addition & 1 deletion pages/guides/agent-courses/agents-for-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CodeGroup, CodeSegment, DocsCode, GithubCodeSegment } from "../../../co

## Overview

Welcome to **Agents 101 for AI Engine**! This course is designed to introduce you to the overall system of Fetch.ai, and shows how to build Agents to be accessible to the AI Engine and integrate with other projects. This course is a parallel track to [Agents 101 ↗️](/guides/agent-courses/introductory-course) which instead focuses only on Agents creation using the [uAgents ↗️](/guides/agents/getting-started/installing-uagent) library.
Welcome to **Agents 101 for AI Engine**! This course is designed to introduce you to the overall system of Fetch.ai, and shows how to build Agents to be accessible to the AI Engine and integrate with other projects. This course is a parallel track to [Agents 101 ↗️](/guides/agent-courses/introductory-course) which instead focuses only on Agents creation using the [uAgents ↗️](/guides/agents/getting-started/installing-uagent) library. Also, make sure you satisfied the requirements in [Set up your development environment ↗️](/guides/agent-courses/setup-your-env) before going on with this course.

At any stage, if you encounter issues or have questions about specific terms or topics, our support team is available on [Discord ↗️](https://discord.gg/fetchai) to assist you.

Expand Down
119 changes: 2 additions & 117 deletions pages/guides/agent-courses/introductory-course.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,129 +8,14 @@ import { CodeGroup, CodeSegment, DocsCode, GithubCodeSegment } from "../../../co

Welcome to **Agents 101**! This course is designed to introduce you to the development of Agents, providing a comprehensive guide from foundational concepts to practical implementation. Whether you're a beginner in programming or an experienced developer, this course caters to various skill levels, offering a pathway to create increasingly sophisticated Agents and explore diverse use cases.

Make sure you satisfied the requirements in [Set up your development environment ↗️](/guides/agent-courses/setup-your-env) before going on with this course.

If you encounter uncertainties or have questions about specific terms or topics throughout the course, our support team is available on [Discord ↗️](https://discord.gg/fetchai) to assist you.

## Introduction to Agents

In this course, you'll delve into the world of Agents using the [uAgents Framework ↗️](/concepts/agents/agents). Agents are programs able to operate autonomously within decentralized landscapes, aligned with user-defined objectives. These agents have the ability to connect, search, transact, establish dynamic markets and so on. By leveraging artificial intelligence, API calls, blockchain technology, and business logic, Agents automate multiple workflows. The aim is to facilitate interactions with their environment and other networked agents without human intervention.

## Set up your development environment 🛠️
### Prerequisites

Before embarking on this course, ensure your machine meets the following requirements:

1. **Python 3.8+**: download and install Python from [Python's official website ↗️](https://www.python.org/downloads/)
2. **Preferred IDE**: Visual Studio Code or PyCharm (alternative options like Notepad are feasible).

### Set up development tools
#### Installing Homebrew

**Homebrew** streamlines software installations on MacOS via the command line. To install and update Homebrew, execute the following commands:

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

You can verify it [here ↗️](https://brew.sh/). Let's then ensure Homebrew is updated:

```
brew update
```

<Callout type="info" emoji="ℹ️">
For more information on Homebrew explore their [website ↗️](https://brew.sh/).
</Callout>

#### Installing PyEnv

Now, you need to install **PyEnv**. It is a simple tool to manage multiple versions of Python. Run:

```
brew install pyenv
```

Once you have installed PyEnv you can configure the shell environment:

```
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
```

<Callout type="info" emoji="ℹ️">
These commands configure your shell environment (specifically the **Zsh shell**) to work with PyEnv. These commands set up environment variables, modify the PATH, and initialize PyEnv so that you can easily manage and switch between different Python versions. You can verify all steps [here ↗️](https://github.com/pyenv/pyenv#installation).
</Callout>

You are now ready to **install Python** if you haven't done it yet. You need to install a version of Python 3.8 or above (for this example, we use version 3.10):

```
pyenv install 3.10
```

You can get help or check a command insights by running:

```
pyenv help
```

Let's now ensure the **global version of Python** you are working with is not the default one in the system. Run:

```
pyenv global 3.10 # this sets the global interpreter
pyenv versions # this verifies if it is set up correctly
```

#### Installing Poetry

You now need to install **Poetry**. Poetry is used for managing Python project dependencies, handling virtual environments, packaging, and publishing Python libraries or applications.

You can install Poetry by running the following command:

```
curl -sSL https://install.python-poetry.org | python3 -
```

<Callout type="info" emoji="ℹ️">
If you would like to learn more about Poetry, visit the [website ↗️](https://python-poetry.org/docs/#installation) for further information.
</Callout>

#### Initialize your project with Poetry

You now have all necessary tools installed. You are ready to initialize your project! Let's create a working directory and initialize Poetry 🎉.

First, you need to create a working directory for your project using `mkdir` command. Then, you will need to change directory to this one, using `cd` command:

```
mkdir development/agent-demo
cd development/agent-demo
```

You can ensure you are in the correct directory by checking your current path:

```
pwd
# Example output: /Users/Jessica/Documents
```

If you are happy with the install location for the project, go ahead and **initialize Poetry**:

```
poetry init
```

<Callout type="info" emoji="ℹ️">
Follow the setup wizard to provide details including project name, version, author, license, and select dependencies (e.g., `uagents`).
</Callout>

Once you complete the initialization, run:

```
poetry install
```

This command will install the dependencies specified in the **pyproject.toml** file.

**Congratulations! You've completed the installation process. You're now all set to embark on creating your first AI Agent!**

## Overview of the uAgents Framework

Expand Down
121 changes: 121 additions & 0 deletions pages/guides/agent-courses/setup-your-env.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import { Callout } from 'nextra/components'

# Set up your development environment
## Prerequisites

Ensure your machine meets the following requirements before heading over to the [Agents 101 ↗️](/guides/agent-courses/introductory-course) and [Agents 101 for AI Engine ↗️](/guides/agent-courses/agents-for-ai) courses:

1. **Python 3.8+**: download and install Python from [Python's official website ↗️](https://www.python.org/downloads/)
2. **Preferred IDE**: Visual Studio Code or PyCharm (alternative options like Notepad are feasible).

## Set up development tools
### Installing Homebrew

**Homebrew** streamlines software installations on MacOS via the command line. To install and update Homebrew, execute the following commands:

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

You can verify it [here ↗️](https://brew.sh/). Let's then ensure Homebrew is updated:

```
brew update
```

<Callout type="info" emoji="ℹ️">
For more information on Homebrew explore their [website ↗️](https://brew.sh/).
</Callout>

### Installing PyEnv

Now, you need to install **PyEnv**. It is a simple tool to manage multiple versions of Python. Run:

```
brew install pyenv
```

Once you have installed PyEnv you can configure the shell environment:

```
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
```

<Callout type="info" emoji="ℹ️">
These commands configure your shell environment (specifically the **Zsh shell**) to work with PyEnv. These commands set up environment variables, modify the PATH, and initialize PyEnv so that you can easily manage and switch between different Python versions. You can verify all steps [here ↗️](https://github.com/pyenv/pyenv#installation).
</Callout>

You are now ready to **install Python** if you haven't done it yet. You need to install a version of Python 3.8 or above (for this example, we use version 3.10):

```
pyenv install 3.10
```

You can get help or check a command insights by running:

```
pyenv help
```

Let's now ensure the **global version of Python** you are working with is not the default one in the system. Run:

```
pyenv global 3.10 # this sets the global interpreter
pyenv versions # this verifies if it is set up correctly
```

### Installing Poetry

You now need to install **Poetry**. Poetry is used for managing Python project dependencies, handling virtual environments, packaging, and publishing Python libraries or applications.

You can install Poetry by running the following command:

```
curl -sSL https://install.python-poetry.org | python3 -
```

<Callout type="info" emoji="ℹ️">
If you would like to learn more about Poetry, visit the [website ↗️](https://python-poetry.org/docs/#installation) for further information.
</Callout>

### Initialize your project with Poetry

You now have all necessary tools installed. You are ready to initialize your project! Let's create a working directory and initialize Poetry 🎉.

First, you need to create a working directory for your project using `mkdir` command. Then, you will need to change directory to this one, using `cd` command:

```
mkdir development/agent-demo
cd development/agent-demo
```

You can ensure you are in the correct directory by checking your current path:

```
pwd
# Example output: /Users/Jessica/Documents
```

If you are happy with the install location for the project, go ahead and **initialize Poetry**:

```
poetry init
```

<Callout type="info" emoji="ℹ️">
Follow the setup wizard to provide details including project name, version, author, license, and select dependencies (e.g., `uagents`).
</Callout>

Once you complete the initialization, run:

```
poetry install
```

This command will install the dependencies specified in the **pyproject.toml** file.

**Congratulations! You've completed the installation process. You're now all set to embark on creating your first Agent!**

Head over to the [Agents 101 ↗️](/guides/agent-courses/introductory-course) to get started!

0 comments on commit 6c6ff79

Please sign in to comment.