Coder Social home page Coder Social logo

andrewswait / uagents Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fetchai/uagents

0.0 0.0 0.0 24.13 MB

A fast and lightweight framework for creating decentralized agents with ease.

License: Apache License 2.0

JavaScript 3.80% Python 94.93% CSS 1.27%

uagents's Introduction

uAgents: AI Agent Framework

Official Website Unit Tests GitHub Repo stars Twitter Follow

uAgents is a library developed by Fetch.ai that allows for creating autonomous AI agents in Python. With simple and expressive decorators, you can have an agent that performs various tasks on a schedule or takes action on various events.

πŸš€ Features

  • πŸ€– Easy creation and management: Create any type of agent you can think of and put into code.
  • πŸ”— Connected: On startup, each agent automatically joins the fast growing network of uAgents by registering on the Almanac, a smart contract deployed on the Fetch.ai blockchain.
  • πŸ”’ Secure: uAgent messages and wallets are cryptographically secured, so their identities and assets are protected.

⚑ Quickstart

Installation

Get started with uAgents by installing it for Python 3.8 to 3.12:

pip install uagents

Running a Demo

Creating an Agent

Build your first uAgent using the following script:

from uagents import Agent, Context
alice = Agent(name="alice", seed="alice recovery phrase")

Include a seed parameter when creating an agent to set fixed addresses, or leave it out to generate random addresses each time.

Giving it a task

Give it a simple task, such as greeting:

@alice.on_interval(period=2.0)
async def say_hello(ctx: Context):
    ctx.logger.info(f'hello, my name is {ctx.name}')

if __name__ == "__main__":
    alice.run()

Running the Agent

So far, your code should look like this:

from uagents import Agent, Context

alice = Agent(name="alice", seed="alice recovery phrase")

@alice.on_interval(period=2.0)
async def say_hello(ctx: Context):
    ctx.logger.info(f'hello, my name is {ctx.name}')

if __name__ == "__main__":
    alice.run()

Run it using:

python agent.py

You should see the results in your terminal.

πŸ“– Documentation

Please see the official documentation for full setup instructions and advanced features.

🌱 Examples

The examples folder contains several examples of how to create and run various types of agents.

🌲 Integrations

The integrations folder contains examples that provide a more in depth use of the uAgents library.

Python Library

Go to the python folder for details on the Python uAgents library.

✨ Contributing

All contributions are welcome! Remember, contribution includes not only code, but any help with docs or issues raised by other developers. See our contribution guidelines for more details.

πŸ“„ Development Guidelines

Read our development guidelines to learn some useful tips related to development.

❓ Issues, Questions, and Discussions

We use GitHub Issues for tracking requests and bugs, and GitHub Discussions for general questions and discussion.

πŸ›‘ Disclaimer

This project, uAgents, is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to unexpected behavior, data loss, or any other issues that may arise. The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this

License

The uAgents project is licensed under Apache License 2.0.

uagents's People

Contributors

abhi141 avatar alejandro-morales avatar archento avatar bgoober avatar coderlktripathi avatar devjsc avatar dpdrabla avatar ejfitzgerald avatar felixnicolaebucsa avatar gaurav19908 avatar gautamgambhir97 avatar jrriehl avatar lrahmani avatar missingno57 avatar prajnasaikia avatar pratrivedi avatar qati avatar rishankjhavar avatar sangramsam avatar vijaysharma815 avatar zmezei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.