Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a701419
doing goat version with only evm
ef95023 Jan 24, 2025
f8a3ea4
well that was quick
ef95023 Jan 24, 2025
b8cd50f
comment cleanup
ef95023 Jan 24, 2025
251ff92
refactored prompts and gonna add a hardcoded validation llm call. don…
ef95023 Jan 25, 2025
4b5fffc
applying schemas too strictly now
ef95023 Jan 25, 2025
fa4f774
changes to prompts and aciton mapping
ef95023 Jan 26, 2025
bbab66e
made a lot of progress. going to add helper actions for some of these…
ef95023 Jan 26, 2025
d99ff43
calling it a night but 70% of it works 70% of the time and the other …
ef95023 Jan 26, 2025
feb34f5
working stable version without uniswap
ef95023 Jan 29, 2025
7e4c8a8
progress fixed coingecko
ef95023 Jan 29, 2025
0782ab3
prepping for uniswap when we get api key and url
ef95023 Jan 29, 2025
0963242
will no longer do anything that is not a direct onchain action
ef95023 Jan 29, 2025
4932d68
checks other wallet balances
ef95023 Jan 29, 2025
c5355be
test command tweaks
ef95023 Jan 30, 2025
47eb568
integrated uniswap
ef95023 Jan 30, 2025
a95ea47
merging main
ef95023 Feb 2, 2025
3df997a
repairing server endpoint
ef95023 Feb 2, 2025
3354d03
switched to claude
ef95023 Feb 2, 2025
cea2215
massaging swaps prompts and adding readme
ef95023 Feb 2, 2025
59e6171
cleaned up config handling
ef95023 Feb 2, 2025
289ae86
went back to hardcoded
ef95023 Feb 2, 2025
e0cf229
updated dependencies and script
ef95023 Feb 4, 2025
a678fbc
updated latest uniswap plugin that works
ef95023 Feb 4, 2025
2d5c0d0
tx hash now gets posted:
ef95023 Feb 5, 2025
2b5eb59
sys prompt adjustments
ef95023 Feb 5, 2025
7dc04eb
added dexscreener and updated server readme
ef95023 Feb 6, 2025
d22d374
addded endpoint but dont have dockerization working yet
ef95023 Feb 12, 2025
53c1716
dockerization works and derivekey endpoint added
ef95023 Feb 12, 2025
71138f3
working evm keys invalid solana keys
ef95023 Feb 18, 2025
a8bc556
add tweet detail retrieval
Peteredwardj Feb 20, 2025
c2a635d
add tweet details in stream
Peteredwardj Feb 20, 2025
4aa62b8
add author id, tweet_id
Peteredwardj Feb 20, 2025
8dc658d
key validation endpoint works
ef95023 Feb 20, 2025
e8785f2
added setting env vars. somehow skipped
ef95023 Feb 20, 2025
77def1c
add config to stream tweets
Peteredwardj Feb 20, 2025
6782f81
add get user details, stream by accounts mentioned and tweet authors
Peteredwardj Feb 21, 2025
1d6013e
default to false
Peteredwardj Feb 21, 2025
31bfccb
uncomment
Peteredwardj Feb 21, 2025
e94b18f
fix minor bug
Peteredwardj Feb 21, 2025
39efc8a
changes
rux-eth Feb 21, 2025
5604850
Merge branch 'staging' into goatBrain
rux-eth Feb 21, 2025
2308980
Merge pull request #125 from blorm-network/goatBrain
rux-eth Feb 21, 2025
05b8c8f
changes
rux-eth Feb 22, 2025
08e576a
change accounts mentioned
rux-eth Feb 22, 2025
b0ef4a8
Merge pull request #123 from blorm-network/fetch_tweet_details
rux-eth Feb 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
**/agents
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ GOAT_WALLET_PRIVATE_KEY=
SOLANA_PRIVATE_KEY=
DISCORD_TOKEN=
XAI_API_KEY=
TOGETHER_API_KEY=

TOGETHER_API_KEY=
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ agents/*.json

# macOS
.DS_Store
.codegpt
.codegpt

venv
.mypy_cache
49 changes: 49 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM python:3.11-slim

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100

# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -

# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"

# Verify Poetry installation
RUN poetry --version


# Set working directory
WORKDIR /app

# Copy Poetry files
COPY pyproject.toml poetry.lock /app/


# Install dependencies, including the 'server' extra
RUN poetry install --no-root --with=server



# Copy application code
COPY . /app/

# Expose port
EXPOSE 8000

# Set dstack simulator endpoint
ENV DSTACK_SIMULATOR_ENDPOINT="http://tappd:8090"

# Command to run the application using app.py
CMD ["poetry","run","python", "main.py", "--server"]
25 changes: 19 additions & 6 deletions agents/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
"name": "twitter",
"timeline_read_count": 10,
"own_tweet_replies_count":2,
"tweet_interval": 5400
"tweet_interval": 5400,
"respond_to_mentions": {
"enabled": false,
"accounts_mentioned": ["blormmy"],
"accounts_to_listen_to": ["0xzerebro"]
}
},
{
"name": "farcaster",
Expand Down Expand Up @@ -67,14 +72,21 @@
{
"name": "coingecko",
"args": {
"api_key": "YOUR_API_KEY"
"api_key": "CG-12BeZ64iSajBLPPz8mfX4uao"
}
},
{
"name": "erc20",
"args": {
"tokens": ["goat_plugins.erc20.token.PEPE", "goat_plugins.erc20.token.USDC"]
}
},
{
"name": "uniswap",
"args": {
"api_key": "KUt2OUR7oT6zpUvoly6Cp4FUwLCtkiZP16fhKW3x",
"base_url": "https://trade-api.gateway.uniswap.org/v1"
}
}
]
},
Expand All @@ -83,10 +95,6 @@
"model": "llama-3.3-70b-versatile",
"temperature": 0.5
},
{
"name": "hyperbolic",
"model": "meta-llama/Meta-Llama-3-70B-Instruct"
},
{
"name": "galadriel",
"model": "gpt-3.5-turbo"
Expand All @@ -109,6 +117,11 @@
"message_read_count": 10,
"message_emoji_name": "❤️",
"server_id": "1234567890"
},
{
"name": "brain",
"model": "claude-3-5-sonnet-20241022",
"provider": "anthropic"
}
],
"tasks": [
Expand Down
61 changes: 61 additions & 0 deletions brain_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from src.connections.brain_connection import BrainConnection
from dotenv import load_dotenv
import json
import logging

load_dotenv()

def load_agent_config(agent_name: str = "example") -> dict:
"""Load agent configuration from JSON file"""
try:
with open(f"agents/{agent_name}.json", "r") as f:
config = json.load(f)

# Extract brain configuration
brain_config = next((c for c in config["config"] if c["name"] == "brain"), None)

if not brain_config:
raise ValueError("Missing required brain configuration")

return brain_config

except Exception as e:
raise Exception(f"Failed to load agent config: {e}")

def test_brain(agent_name: str = "example"):
"""Test brain functionality with configuration from agent file"""
try:
# Load brain configuration
brain_config = load_agent_config(agent_name)

# Initialize and configure Brain connection
brain_connection = BrainConnection(brain_config)
if not brain_connection.configure():
print("Failed to configure Brain connection")
return

# Test commands
test_commands = [
# "what's my wallet address",
# "get me info about bitcoin",
# "check my eth balance",
# "what actions can you do",
# "help me swap 2 usdc for MOG",
"swap 1 million mog for usdc"
# "what is proof of history"
# "can you automatically set chain parameters based on what network you see logged in via rpc when i make a uniswap call?",
# "help me swap eth for 1 usdc"
# "if minorities only make up 20% of the population yet they are 70% of the prison population, what does this infer about minorities and their criminal tendencies"
# "get me the token price of pepe using the uniswap plugin"
]

for cmd in test_commands:
print(f"\nTesting: {cmd}")
result = brain_connection.process_command(cmd)
print(f"Result: {result}")

except Exception as e:
print(f"Test failed: {e}")

if __name__ == "__main__":
test_brain()
51 changes: 51 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "3.8"
services:
zerepy:
image: ruxdoteth/zerepy:latest
container_name: zerepy
environment:
- ALLORA_API_KEY=${ALLORA_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- EternalAI_API_KEY=${EternalAI_API_KEY}
- EternalAI_API_URL=${EternalAI_API_URL}
- EVM_PRIVATE_KEY=${EVM_PRIVATE_KEY}
- FARCASTER_MNEMONIC=${FARCASTER_MNEMONIC}
- HYPERBOLIC_API_KEY=${HYPERBOLIC_API_KEY}
- GALADRIEL_API_KEY=${GALADRIEL_API_KEY}
- GALADRIEL_FINE_TUNE_API_KEY=${GALADRIEL_FINE_TUNE_API_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
- TWITTER_CONSUMER_KEY=${TWITTER_CONSUMER_KEY}
- TWITTER_CONSUMER_SECRET=${TWITTER_CONSUMER_SECRET}
- TWITTER_ACCESS_TOKEN=${TWITTER_ACCESS_TOKEN}
- TWITTER_ACCESS_TOKEN_SECRET=${TWITTER_ACCESS_TOKEN_SECRET}
- TWITTER_USER_ID=${TWITTER_USER_ID}
- TWITTER_BEARER_TOKEN=${TWITTER_BEARER_TOKEN}
- SOLANA_PRIVATE_KEY=${SOLANA_PRIVATE_KEY}
- SONIC_PRIVATE_KEY=${SONIC_PRIVATE_KEY}
- GOAT_RPC_PROVIDER_URL=${GOAT_RPC_PROVIDER_URL}
- GOAT_WALLET_PRIVATE_KEY=${GOAT_WALLET_PRIVATE_KEY}
- SOLANA_PRIVATE_KEY=${SOLANA_PRIVATE_KEY}
- DISCORD_TOKEN=${DISCORD_TOKEN}
- XAI_API_KEY=${XAI_API_KEY}
- TOGETHER_API_KEY=${TOGETHER_API_KEY}
- DSTACK_SIMULATOR_ENDPOINT=http://tappd:8090
ports:
- "8000:8000"
volumes:
- ./.env:/app/.env:ro
depends_on:
- tappd
networks:
- zerepy-network
tappd:
image: phalanetwork/tappd-simulator:latest
container_name: tappd
ports:
- "8090:8090"
networks:
- zerepy-network

networks:
zerepy-network:
driver: bridge
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import argparse
from src.cli import ZerePyCLI
from src.server import start_server
import logging

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='ZerePy - AI Agent Framework')
Expand All @@ -10,10 +12,10 @@

if args.server:
try:
from src.server import start_server
start_server(host=args.host, port=args.port)
except ImportError:
print("Server dependencies not installed. Run: poetry install --extras server")
except ImportError as e:
logging.info(f"Server mode failed: {e}")
logging.info("Make sure all dependencies are installed. Run: poetry install")
exit(1)
else:
cli = ZerePyCLI()
Expand Down
Loading