From 6ba828696eb6c084e3dcda9d6206af835e89492c Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 10 May 2023 09:31:47 +0000 Subject: automatic import of python-ia-genie-sdk --- .gitignore | 1 + python-ia-genie-sdk.spec | 566 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 568 insertions(+) create mode 100644 python-ia-genie-sdk.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..4033620 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/ia-genie-sdk-0.1.30.tar.gz diff --git a/python-ia-genie-sdk.spec b/python-ia-genie-sdk.spec new file mode 100644 index 0000000..6ac76a3 --- /dev/null +++ b/python-ia-genie-sdk.spec @@ -0,0 +1,566 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ia-genie-sdk +Version: 0.1.30 +Release: 1 +Summary: SDK for Intelligent Artifact's Genie, a general evolving networked intelligence engine using GAIuS framework. +License: MIT License +URL: https://bitbucket.org/intelligent-artifacts/geniesdk-python/src/master/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0b/e8/941be437f31c26ff9fbc78f60d1a428a47d799e4824ab36d1fd88fa4fa0e/ia-genie-sdk-0.1.30.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-pymongo + +%description +# Genie™ Python SDK +A Python SDK for Intelligent Artifacts' Genie™. + +## What is Genie™? +Genie™ is a General Evolving Networked Intelligence Engine. It is an Artificial General Intelligence platform for rapidly building machine intelligence solutions for any problem domain. + +Genie™ requires an account on [Intelligent Artifacts] (https://www.intelligent-artifacts.com). + +## What is Genie™ Python SDK? +This package, Genie™ Python SDK, is a software development kit for interacting with "GENIE agents" and "bottles" from Python. It provides useful tools and services. + +## Install +`pip install ia-genie-sdk` + +Provides: + + - GenomeInfo + - BottleClient + - BackTesting + +#### To use GenomeInfo: + +You will need to download your genie's genome file from your Intelligent Artifacts account. + +~~~ +from ialib.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 BottleClient: + +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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': 'intelligent-artifacts.com', + 'secure': True} + +test_bottle = BottleClient(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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': ':8181', + 'secure': False} + +test_bottle = BottleClient(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 genie's genome. Alternatively, you can manually inject your genie's genome into the bottle and connect in this manner: + +~~~ +test_bottle.inject_genome(genome) +~~~ + +Wait for return status. + +Once you have a running genie, 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() +~~~ + +You can also pass GenieMetalanguage data to the genie: + +~~~ +from ialib.genie_metalanguage import CLEAR_ALL_MEMORY, CLEAR_WM, LEARN, SET_PREDICTIONS_ON, SET_PREDICTIONS_OFF +test_bottle.observe(LEARN) +~~~ + +When sending classifications to a genie, 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 `BottleClient` 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. + + + + +%package -n python3-ia-genie-sdk +Summary: SDK for Intelligent Artifact's Genie, a general evolving networked intelligence engine using GAIuS framework. +Provides: python-ia-genie-sdk +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ia-genie-sdk +# Genie™ Python SDK +A Python SDK for Intelligent Artifacts' Genie™. + +## What is Genie™? +Genie™ is a General Evolving Networked Intelligence Engine. It is an Artificial General Intelligence platform for rapidly building machine intelligence solutions for any problem domain. + +Genie™ requires an account on [Intelligent Artifacts] (https://www.intelligent-artifacts.com). + +## What is Genie™ Python SDK? +This package, Genie™ Python SDK, is a software development kit for interacting with "GENIE agents" and "bottles" from Python. It provides useful tools and services. + +## Install +`pip install ia-genie-sdk` + +Provides: + + - GenomeInfo + - BottleClient + - BackTesting + +#### To use GenomeInfo: + +You will need to download your genie's genome file from your Intelligent Artifacts account. + +~~~ +from ialib.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 BottleClient: + +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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': 'intelligent-artifacts.com', + 'secure': True} + +test_bottle = BottleClient(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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': ':8181', + 'secure': False} + +test_bottle = BottleClient(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 genie's genome. Alternatively, you can manually inject your genie's genome into the bottle and connect in this manner: + +~~~ +test_bottle.inject_genome(genome) +~~~ + +Wait for return status. + +Once you have a running genie, 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() +~~~ + +You can also pass GenieMetalanguage data to the genie: + +~~~ +from ialib.genie_metalanguage import CLEAR_ALL_MEMORY, CLEAR_WM, LEARN, SET_PREDICTIONS_ON, SET_PREDICTIONS_OFF +test_bottle.observe(LEARN) +~~~ + +When sending classifications to a genie, 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 `BottleClient` 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. + + + + +%package help +Summary: Development documents and examples for ia-genie-sdk +Provides: python3-ia-genie-sdk-doc +%description help +# Genie™ Python SDK +A Python SDK for Intelligent Artifacts' Genie™. + +## What is Genie™? +Genie™ is a General Evolving Networked Intelligence Engine. It is an Artificial General Intelligence platform for rapidly building machine intelligence solutions for any problem domain. + +Genie™ requires an account on [Intelligent Artifacts] (https://www.intelligent-artifacts.com). + +## What is Genie™ Python SDK? +This package, Genie™ Python SDK, is a software development kit for interacting with "GENIE agents" and "bottles" from Python. It provides useful tools and services. + +## Install +`pip install ia-genie-sdk` + +Provides: + + - GenomeInfo + - BottleClient + - BackTesting + +#### To use GenomeInfo: + +You will need to download your genie's genome file from your Intelligent Artifacts account. + +~~~ +from ialib.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 BottleClient: + +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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': 'intelligent-artifacts.com', + 'secure': True} + +test_bottle = BottleClient(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 ialib.bottle_client import BottleClient + +bottle_info = {'api_key': 'ABCD-1234', + 'name': 'genie-bottle', + 'domain': ':8181', + 'secure': False} + +test_bottle = BottleClient(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 genie's genome. Alternatively, you can manually inject your genie's genome into the bottle and connect in this manner: + +~~~ +test_bottle.inject_genome(genome) +~~~ + +Wait for return status. + +Once you have a running genie, 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() +~~~ + +You can also pass GenieMetalanguage data to the genie: + +~~~ +from ialib.genie_metalanguage import CLEAR_ALL_MEMORY, CLEAR_WM, LEARN, SET_PREDICTIONS_ON, SET_PREDICTIONS_OFF +test_bottle.observe(LEARN) +~~~ + +When sending classifications to a genie, 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 `BottleClient` 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. + + + + +%prep +%autosetup -n ia-genie-sdk-0.1.30 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-ia-genie-sdk -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot - 0.1.30-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..deff9f8 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +86bce9ff220514cceab1c49f3a32cd60 ia-genie-sdk-0.1.30.tar.gz -- cgit v1.2.3