Skip to content

Commit f67a47b

Browse files
committed
test
1 parent a405be2 commit f67a47b

2 files changed

Lines changed: 118 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Your First Agent
3+
description: Create and run your first MoFA agent in just a few minutes
4+
---
5+
6+
7+
Let's create your first MoFA agent! This tutorial will guide you through building a simple question-answering agent.
8+
9+
## Step 1: Import Required Modules
10+
11+
```python
12+
from mofa import Agent, Pipeline
13+
from mofa.messages import HumanMessage
14+
```
15+
16+
## Step 2: Create an Agent
17+
18+
```python
19+
# Create a simple Q&A agent
20+
agent = Agent(
21+
name="qna-agent",
22+
model="gpt-3.5-turbo",
23+
system_prompt="You are a helpful AI assistant. Answer questions clearly and concisely."
24+
)
25+
```
26+
27+
## Step 3: Set Up a Pipeline
28+
29+
```python
30+
# Create a pipeline to run the agent
31+
pipeline = Pipeline()
32+
pipeline.add(agent)
33+
```
34+
35+
## Step 4: Interact with Your Agent
36+
37+
```python
38+
# Send a message to the agent
39+
message = HumanMessage(content="What is MoFA?")
40+
response = pipeline.run(message)
41+
42+
print(response.content)
43+
```
44+
45+
## Complete Example
46+
47+
Here's the complete code:
48+
49+
```python
50+
from mofa import Agent, Pipeline
51+
from mofa.messages import HumanMessage
52+
53+
# Create agent
54+
agent = Agent(
55+
name="qna-agent",
56+
model="gpt-3.5-turbo",
57+
system_prompt="You are a helpful AI assistant."
58+
)
59+
60+
# Create pipeline
61+
pipeline = Pipeline()
62+
pipeline.add(agent)
63+
64+
# Run conversation
65+
message = HumanMessage(content="What is MoFA?")
66+
response = pipeline.run(message)
67+
68+
print(response.content)
69+
```
70+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Installation
3+
description: How to install MoFA and set up your development environment
4+
---
5+
6+
7+
This guide will help you install MoFA and set up your development environment.
8+
9+
## Prerequisites
10+
11+
Before installing MoFA, make sure you have:
12+
13+
- **Python 3.8 or higher**
14+
- **pip package manager**
15+
- **Git** (for cloning repositories)
16+
- At least **4GB of RAM**
17+
18+
## Installation Methods
19+
20+
### Method 1: Install via pip (Recommended)
21+
22+
The easiest way to install MoFA is using pip:
23+
24+
```bash
25+
pip install mofa
26+
```
27+
28+
### Method 2: Install from Source
29+
30+
For development or the latest features:
31+
32+
```bash
33+
# Clone the repository
34+
git clone https://github.com/moxin-org/mofa.git
35+
cd mofa
36+
37+
# Install in development mode
38+
pip install -e .
39+
```
40+
41+
## Verify Installation
42+
43+
To verify that MoFA is installed correctly:
44+
45+
```python
46+
import mofa
47+
print(mofa.__version__)
48+
```

0 commit comments

Comments
 (0)