Skip to main content

SDK for Intelligent Artifact's GAIuS agents.

Project description

GAIuS™ Python SDK

A Python SDK for Intelligent Artifacts' GAIuS™ agents.

What is GAIuS™?

GAIuS™ is an Artificial General Intelligence framework for rapidly building machine intelligence solutions for any problem domain.

What is IA's Python SDK?

This package, ia-sdk-python, is a software development kit for interacting with IA's GAIuS agents from Python. It provides useful tools and services.

Install

pip install ia-sdk

Provides:

- GenomeInfo
- AgentClient
- BackTesting

To use GenomeInfo:

You will need to download your gaius_agent's genome file from your Intelligent Artifacts account.

from ia.gaius.GenomeInfo import Genome
import json

genome_topology = json.loads(genome_json_string)
genome = Genome(genome_topology)

If you want to have the topology displayed, you need to install cyjupter:

pip3 install cyjupyter

The useful functions are:
genome.agent - returns the name of the agent.
    ex: 'focusgenie'

genome.get_nodes() - returns 2-tuple of primitives and manipulatives genomic data.

genome.get_actions() - returns dictionary of primitives with lists of action IDs.
    ex: {'P1': ['ma23b1323',
                'm390d053c']}

genome.get_action_manipulatives() - returns a list of action manipulative IDs.
    ex: ['m390d053c',
         'ma23b1323']

genome.get_primitive_map() - returns a dictionary of primitive names to primitive IDs.
    ex: {'P1': 'p464b64bc'}

genome.get_manipulative_map() - returns a dictionary of manipulative IDs to manipulative names.
    ex: {'m390d053c': 'ACTIONPath',
         'ma23b1323': 'ACTIONPath',
         'mcd6d4d68': 'negateContext',
         'm40aaf174': 'vectorFilter',
         'med2ed537': 'vectorPassthrough',
         'm89aa2c7e': 'reduceVectorsBySubtraction'}

genome.display() - graphically displays the topology.

To use AgentClient:

You will need to have an active bottle running on Intelligent Artifacts. The bottle's information such as 'name' and secrete 'api_key' can be found in your IA account.

If on IA cloud:

from ia.gaius.agent_client import AgentClient

bottle_info = {'api_key': 'ABCD-1234',
               'name': 'gaius-agent',
               'domain': 'intelligent-artifacts.com',
               'secure': True}

test_bottle = AgentClient(bottle_info)
test_bottle

If local: (Note: local, on-premises, on-board, at-the-edge, etc. usage requires licensing from Intelligent Artifacts. Send email to team@intelligent-artifacts.com for licensing support.)

from ia.gaius.agent_client import AgentClient

bottle_info = {'api_key': 'ABCD-1234',
               'name': 'gaius-agent',
               'domain': ':8181',
               'secure': False}

test_bottle = AgentClient(bottle_info)
test_bottle

Prior to utilizing the bottle, you must establish a connection between the client and bottle through the use of the connect method:

test_bottle.connect()

Note, this will download a copy of the gaius_agent's genome. Alternatively, you can manually inject your gaius_agent's genome into the bottle and connect in this manner:

test_bottle.inject_genome(genome)

Wait for return status.

Once you have a running gaius_agent, set ingress and query nodes by passing the node names in a list:

test_bottle.set_ingress_nodes(['P1'])
test_bottle.set_query_nodes(['P1'])

Send data to bottle:

data = {"strings": ["Hello"], "vectors": [], "determinants": []}
test_bottle.observe(data)

Query the bottle nodes:

print(test_bottle.show_status())
predictions = test_bottle.get_predictions()

When sending classifications to a gaius_agent, it is best practice to send the classification as a singular symbol in the last event of a sequence. This allows for querying the last event in the prediction's 'future' field for the answer. The classification, though, should be sent to all the query nodes along with the ingress nodes. The observe_classification function of the AgentClient class does that for us:

data = {"strings": ["World!"], "vectors": [], "determinants": []}
test_bottle.observe_classification(data)

To use Backtesting:

There are 3 built-in backtesting reports:

- classification:
    - Train and predict a string value to be a classification of observed data.
- utility - polarity:
    - Polarity is basically a +/- binary classification test using the prediction's 'utility' value.  It scores correct if the polarity of the prediction matches the polarity of the expected.
- utility - value:
    - Value tests for the actual predicted value against the expected and scores correct if within a provided `tolerance_threshold`.

For each, the observed data can be a sequence of one or more events, containing any vectors or strings.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ia-sdk-0.2.24.linux-x86_64.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ia_sdk-0.2.24-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file ia-sdk-0.2.24.linux-x86_64.tar.gz.

File metadata

  • Download URL: ia-sdk-0.2.24.linux-x86_64.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for ia-sdk-0.2.24.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 4ce40737cc2f0dc3a0b891795bd10700529f5cd13a61743596c16cba75872ae4
MD5 891e70b11f2e4106fcef81defcf8618f
BLAKE2b-256 57be2d3eba0516baca5c39830fc5da8d1ae976636ebc0f88838485c907f2dd7c

See more details on using hashes here.

File details

Details for the file ia_sdk-0.2.24-py3-none-any.whl.

File metadata

  • Download URL: ia_sdk-0.2.24-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for ia_sdk-0.2.24-py3-none-any.whl
Algorithm Hash digest
SHA256 e97b4758850ab810810beec7ac3dbde861805283ffc1505426cf86281624a000
MD5 42de3f21593c70bd62cfe83af2301ed5
BLAKE2b-256 41368e90198f5a08e74174133d87f8e70e98cb9b60be8c28aae7dd69edad09f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page