Skip to content

The official Python library for the AO Labs API, compatible with ao_core

Notifications You must be signed in to change notification settings

aolabsai/ao_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The python package wrapper of the ao_core API.

This python repo wraps our api in a easy to use fast pip installable package. It is almost one to one with ao_core so most of the documentation will carry over here, we will add documentation below for futher instructions on how to use the library!

Installation

Install with pip from command line with:

pip install git+https://github.com/aolabsai/ao_python

Documentation

To create a new Arch use:

ao.Arch(api_key=api_key, kennel_name="KennelCreateDemo", arch_i="[1, 1, 1]", arch_z="[1]", connector_function="full_conn")

To initalise our agents use

agent = ao.Agent(unique_id, kennel_id, api_key)

To use next_state():

agent.next_state(self, INPUT, LABEL=None, Instincts=False, Cneg=False, Cpos=False, Unsequenced=False, DD=True, Hamming=True, Default=True):

To delete and agent use:

agent.agent_delete()

Demo script

import ao_core as ao
from config import api_key  #Get an api key


agent = ao.Agent("Api_wrapperTest", "recommender3", api_key)  # Init agent

response = agent.next_state(INPUT=[1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], LABEL=[0,0,0,0,0,0,0,0,0,0])  # Next_state method

agent_response = response["story"]  
state= response["state"]

print("response:", agent_response, "at state:",state)

About

The official Python library for the AO Labs API, compatible with ao_core

Topics

Resources

Stars

Watchers

Forks

Languages