agentstr 0.0.5__tar.gz → 0.0.9__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.2
2
+ Name: agentstr
3
+ Version: 0.0.9
4
+ Summary: A library for collaborative AI agents
5
+ Home-page: https://github.com/synvya/agentstr
6
+ Author: Alejandro Gil
7
+ Author-email: Alejandro Gil <info@synvya.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/synvya/agentstr
10
+ Project-URL: Documentation, https://github.com/synvya/agentstr#readme
11
+ Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
12
+ Keywords: AI,agents,collaboration,library
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.6
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: phidata>=2.7.0
20
+ Requires-Dist: openai>=1.50.0
21
+ Dynamic: author
22
+ Dynamic: home-page
23
+ Dynamic: requires-python
24
+
25
+ AgentStr
26
+ ========
27
+ AgentStr is an extension of [Phidata](https://www.phidata.com) AI agents that allows for agents to communicate with other agents in separate computers using the Nostr communication protocol.
28
+
29
+ The goal is for Agent A operated by Company A to be able to work with Agent B operated by Company B to achieve a common goal. For example: Company A wants to buy a product sold by Company B so Agent A and Agent B can coordinate and execute the transaction.
30
+
31
+ # License
32
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
33
+
34
+ # Current status
35
+ The library is in its infancy.
36
+
37
+ Done:
38
+ - Workflow to package and distribute the library
39
+ - Create AgentStr as an extension of Phidata Agent
40
+ - Test the addition of new properties and capabilities for the AgentStr class
41
+
42
+ To be done:
43
+ - Incorporate Nostr capabilities
44
+ - Create unique public / private key identifiers for agent instances
45
+ - Send and retreive messages via Nostr
46
+ - Expose capabilities via Nostr
47
+ - Agent B retrieves capabilities exposed by Agent A
48
+ - Agent B coordinates transaction with Agent A
49
+
50
+ # Installation
51
+ AgentStr is offered as a python library available at https://pypi.org/project/agentstr/.
52
+
53
+ Here is an example on how to use the library:
54
+
55
+ 1. Create a new python environment for your app
56
+ ```
57
+ cd ~/
58
+ python3 -m venv ~/.venvs/aienv
59
+ source ~/.venvs/aienv/bin/acticate
60
+ ```
61
+ 2. Install the agentstr library
62
+ ```
63
+ pip install agentstr
64
+ mkdir ~/mysampleapp
65
+ cd ~/mysampleapp
66
+ ```
67
+ 3. Create a new python file
68
+ ```
69
+ touch main.py
70
+ ```
71
+ 4. Copy paste this code to the main.py file
72
+ ```
73
+ from agentstr.core import AgentStr
74
+ # Create the agent
75
+ agent = AgentStr("Synvya Inc", "Seller")
76
+
77
+ # Test AgentStr new capabilities
78
+ print(f"Public key: {agent.get_public_key()}\nPrivate key: {agent.get_private_key()}")
79
+ print(f"Company: {agent.get_company()}\nRole: {agent.get_role()}")
80
+
81
+ # Test phidata inherited capabilities
82
+ agent.print_response("Write two sentence poem for the love between the sun and the moon.")
83
+ ```
84
+ 5. Run the code
85
+ ```
86
+ python main.py
87
+ ```
88
+
89
+ # Contributing
90
+ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for specific instructions on installation instructions for developers and how to contribute.
91
+
92
+ # Acknowledgments
93
+ - [Phidata](https://www.phidata.com/.com/) - For building robust AI agents.
@@ -0,0 +1,69 @@
1
+ AgentStr
2
+ ========
3
+ AgentStr is an extension of [Phidata](https://www.phidata.com) AI agents that allows for agents to communicate with other agents in separate computers using the Nostr communication protocol.
4
+
5
+ The goal is for Agent A operated by Company A to be able to work with Agent B operated by Company B to achieve a common goal. For example: Company A wants to buy a product sold by Company B so Agent A and Agent B can coordinate and execute the transaction.
6
+
7
+ # License
8
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
9
+
10
+ # Current status
11
+ The library is in its infancy.
12
+
13
+ Done:
14
+ - Workflow to package and distribute the library
15
+ - Create AgentStr as an extension of Phidata Agent
16
+ - Test the addition of new properties and capabilities for the AgentStr class
17
+
18
+ To be done:
19
+ - Incorporate Nostr capabilities
20
+ - Create unique public / private key identifiers for agent instances
21
+ - Send and retreive messages via Nostr
22
+ - Expose capabilities via Nostr
23
+ - Agent B retrieves capabilities exposed by Agent A
24
+ - Agent B coordinates transaction with Agent A
25
+
26
+ # Installation
27
+ AgentStr is offered as a python library available at https://pypi.org/project/agentstr/.
28
+
29
+ Here is an example on how to use the library:
30
+
31
+ 1. Create a new python environment for your app
32
+ ```
33
+ cd ~/
34
+ python3 -m venv ~/.venvs/aienv
35
+ source ~/.venvs/aienv/bin/acticate
36
+ ```
37
+ 2. Install the agentstr library
38
+ ```
39
+ pip install agentstr
40
+ mkdir ~/mysampleapp
41
+ cd ~/mysampleapp
42
+ ```
43
+ 3. Create a new python file
44
+ ```
45
+ touch main.py
46
+ ```
47
+ 4. Copy paste this code to the main.py file
48
+ ```
49
+ from agentstr.core import AgentStr
50
+ # Create the agent
51
+ agent = AgentStr("Synvya Inc", "Seller")
52
+
53
+ # Test AgentStr new capabilities
54
+ print(f"Public key: {agent.get_public_key()}\nPrivate key: {agent.get_private_key()}")
55
+ print(f"Company: {agent.get_company()}\nRole: {agent.get_role()}")
56
+
57
+ # Test phidata inherited capabilities
58
+ agent.print_response("Write two sentence poem for the love between the sun and the moon.")
59
+ ```
60
+ 5. Run the code
61
+ ```
62
+ python main.py
63
+ ```
64
+
65
+ # Contributing
66
+ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for specific instructions on installation instructions for developers and how to contribute.
67
+
68
+ # Acknowledgments
69
+ - [Phidata](https://www.phidata.com/.com/) - For building robust AI agents.
@@ -0,0 +1,42 @@
1
+ from phi.agent import Agent
2
+ from phi.model.openai import OpenAIChat
3
+ from pydantic import Field
4
+ from typing import Optional
5
+
6
+
7
+ class AgentStr(Agent):
8
+
9
+ # -*- Agent settings
10
+ # Company operating the agent.
11
+ # Used as seed for public / private key identifier together with the agent role
12
+ company: str = None
13
+
14
+ # -*- Agent public / private key identifiers
15
+ # The public / private key should be deterministic for a given 'company' and 'role' combination
16
+ # Public key for the agent
17
+ npub: str = None
18
+ # Private key for the agent
19
+ nsec: str = None
20
+
21
+ # Call the parent class (Agent) constructor
22
+ def __init__(self, company: str, role: str):
23
+ super().__init__(role = role, model=OpenAIChat(id="gpt-4o"))
24
+ self.company = company
25
+ self.npub = f"npub - {self.company} - {self.role}"
26
+ self.nsec = f"nsec - {self.company} - {self.role}"
27
+
28
+ def get_public_key(self) -> str:
29
+ return self.npub
30
+
31
+ def get_private_key(self) -> str:
32
+ return self.nsec
33
+
34
+ def get_company(self) -> str:
35
+ return self.company
36
+
37
+ def get_role(self) -> str:
38
+ return self.role
39
+
40
+ def add(a, b):
41
+ """Add two numbers."""
42
+ return a + b
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.2
2
+ Name: agentstr
3
+ Version: 0.0.9
4
+ Summary: A library for collaborative AI agents
5
+ Home-page: https://github.com/synvya/agentstr
6
+ Author: Alejandro Gil
7
+ Author-email: Alejandro Gil <info@synvya.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/synvya/agentstr
10
+ Project-URL: Documentation, https://github.com/synvya/agentstr#readme
11
+ Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
12
+ Keywords: AI,agents,collaboration,library
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.6
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: phidata>=2.7.0
20
+ Requires-Dist: openai>=1.50.0
21
+ Dynamic: author
22
+ Dynamic: home-page
23
+ Dynamic: requires-python
24
+
25
+ AgentStr
26
+ ========
27
+ AgentStr is an extension of [Phidata](https://www.phidata.com) AI agents that allows for agents to communicate with other agents in separate computers using the Nostr communication protocol.
28
+
29
+ The goal is for Agent A operated by Company A to be able to work with Agent B operated by Company B to achieve a common goal. For example: Company A wants to buy a product sold by Company B so Agent A and Agent B can coordinate and execute the transaction.
30
+
31
+ # License
32
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
33
+
34
+ # Current status
35
+ The library is in its infancy.
36
+
37
+ Done:
38
+ - Workflow to package and distribute the library
39
+ - Create AgentStr as an extension of Phidata Agent
40
+ - Test the addition of new properties and capabilities for the AgentStr class
41
+
42
+ To be done:
43
+ - Incorporate Nostr capabilities
44
+ - Create unique public / private key identifiers for agent instances
45
+ - Send and retreive messages via Nostr
46
+ - Expose capabilities via Nostr
47
+ - Agent B retrieves capabilities exposed by Agent A
48
+ - Agent B coordinates transaction with Agent A
49
+
50
+ # Installation
51
+ AgentStr is offered as a python library available at https://pypi.org/project/agentstr/.
52
+
53
+ Here is an example on how to use the library:
54
+
55
+ 1. Create a new python environment for your app
56
+ ```
57
+ cd ~/
58
+ python3 -m venv ~/.venvs/aienv
59
+ source ~/.venvs/aienv/bin/acticate
60
+ ```
61
+ 2. Install the agentstr library
62
+ ```
63
+ pip install agentstr
64
+ mkdir ~/mysampleapp
65
+ cd ~/mysampleapp
66
+ ```
67
+ 3. Create a new python file
68
+ ```
69
+ touch main.py
70
+ ```
71
+ 4. Copy paste this code to the main.py file
72
+ ```
73
+ from agentstr.core import AgentStr
74
+ # Create the agent
75
+ agent = AgentStr("Synvya Inc", "Seller")
76
+
77
+ # Test AgentStr new capabilities
78
+ print(f"Public key: {agent.get_public_key()}\nPrivate key: {agent.get_private_key()}")
79
+ print(f"Company: {agent.get_company()}\nRole: {agent.get_role()}")
80
+
81
+ # Test phidata inherited capabilities
82
+ agent.print_response("Write two sentence poem for the love between the sun and the moon.")
83
+ ```
84
+ 5. Run the code
85
+ ```
86
+ python main.py
87
+ ```
88
+
89
+ # Contributing
90
+ Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for specific instructions on installation instructions for developers and how to contribute.
91
+
92
+ # Acknowledgments
93
+ - [Phidata](https://www.phidata.com/.com/) - For building robust AI agents.
@@ -7,5 +7,6 @@ agentstr/core.py
7
7
  agentstr.egg-info/PKG-INFO
8
8
  agentstr.egg-info/SOURCES.txt
9
9
  agentstr.egg-info/dependency_links.txt
10
+ agentstr.egg-info/requires.txt
10
11
  agentstr.egg-info/top_level.txt
11
12
  tests/test_core.py
@@ -0,0 +1,2 @@
1
+ phidata>=2.7.0
2
+ openai>=1.50.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" # Backend used for the build process
4
4
 
5
5
  [project]
6
6
  name = "agentstr"
7
- version = "0.0.5"
7
+ version = "0.0.9"
8
8
  description = "A library for collaborative AI agents"
9
9
  requires-python = ">=3.6"
10
10
  readme = "README.md"
@@ -18,7 +18,9 @@ classifiers = [
18
18
  "License :: OSI Approved :: MIT License",
19
19
  "Operating System :: OS Independent"
20
20
  ]
21
- dependencies = []
21
+ dependencies = [
22
+ "phidata>=2.7.0", "openai>=1.50.0"
23
+ ]
22
24
 
23
25
  [project.urls]
24
26
  Homepage = "https://github.com/synvya/agentstr"
@@ -2,14 +2,16 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="agentstr",
5
- version="0.0.5",
5
+ version="0.0.9",
6
6
  author="Alejandro Gil",
7
7
  description="A library for collaborative AI agents",
8
8
  long_description=open("README.md").read(),
9
9
  long_description_content_type="text/markdown",
10
10
  url="https://github.com/synvya/agentstr",
11
11
  packages=find_packages(where="."),
12
- install_requires=[],
12
+ install_requires=[
13
+ "phidata>=2.7.0", "openai>=1.50.0"
14
+ ],
13
15
  classifiers=[
14
16
  "Programming Language :: Python :: 3",
15
17
  "License :: OSI Approved :: MIT License",
@@ -0,0 +1,17 @@
1
+ import unittest
2
+ import agentstr
3
+
4
+ from agentstr.core import add, AgentStr
5
+ from phi.model.openai import OpenAIChat
6
+ from dotenv import load_dotenv
7
+
8
+ load_dotenv()
9
+
10
+ def test_get_public_key():
11
+ agent = AgentStr(company="Synvya AI", role="Seller")
12
+ public_key = agent.get_public_key()
13
+ assert public_key == "npub - Synvya AI - Seller"
14
+
15
+ def test_add():
16
+ assert add(2, 3) == 5
17
+
agentstr-0.0.5/PKG-INFO DELETED
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: agentstr
3
- Version: 0.0.5
4
- Summary: A library for collaborative AI agents
5
- Home-page: https://github.com/synvya/agentstr
6
- Author: Alejandro Gil
7
- Author-email: Alejandro Gil <info@synvya.com>
8
- License: MIT
9
- Project-URL: Homepage, https://github.com/synvya/agentstr
10
- Project-URL: Documentation, https://github.com/synvya/agentstr#readme
11
- Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
12
- Keywords: AI,agents,collaboration,library
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Operating System :: OS Independent
16
- Requires-Python: >=3.6
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
-
20
- # agentstr
21
- Nostr based communication library for agents
agentstr-0.0.5/README.md DELETED
@@ -1,2 +0,0 @@
1
- # agentstr
2
- Nostr based communication library for agents
@@ -1,3 +0,0 @@
1
- def add(a, b):
2
- """Add two numbers."""
3
- return a + b
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: agentstr
3
- Version: 0.0.5
4
- Summary: A library for collaborative AI agents
5
- Home-page: https://github.com/synvya/agentstr
6
- Author: Alejandro Gil
7
- Author-email: Alejandro Gil <info@synvya.com>
8
- License: MIT
9
- Project-URL: Homepage, https://github.com/synvya/agentstr
10
- Project-URL: Documentation, https://github.com/synvya/agentstr#readme
11
- Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
12
- Keywords: AI,agents,collaboration,library
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Operating System :: OS Independent
16
- Requires-Python: >=3.6
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
-
20
- # agentstr
21
- Nostr based communication library for agents
@@ -1,8 +0,0 @@
1
- import unittest
2
- import agentstr
3
-
4
- from agentstr.core import add
5
-
6
- def test_add():
7
- assert add(2, 3) == 5
8
-
File without changes
File without changes
File without changes