agentstr 0.0.5__py3-none-any.whl → 0.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentstr/core.py +39 -0
- agentstr-0.0.8.dist-info/METADATA +92 -0
- agentstr-0.0.8.dist-info/RECORD +7 -0
- {agentstr-0.0.5.dist-info → agentstr-0.0.8.dist-info}/WHEEL +1 -1
- agentstr-0.0.5.dist-info/METADATA +0 -21
- agentstr-0.0.5.dist-info/RECORD +0 -7
- {agentstr-0.0.5.dist-info → agentstr-0.0.8.dist-info}/LICENSE +0 -0
- {agentstr-0.0.5.dist-info → agentstr-0.0.8.dist-info}/top_level.txt +0 -0
agentstr/core.py
CHANGED
@@ -1,3 +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
|
+
|
1
40
|
def add(a, b):
|
2
41
|
"""Add two numbers."""
|
3
42
|
return a + b
|
@@ -0,0 +1,92 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: agentstr
|
3
|
+
Version: 0.0.8
|
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: phi>=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 mysampleapp
|
59
|
+
source mysampleapp/bin/acticate
|
60
|
+
```
|
61
|
+
2. Install the agentstr library
|
62
|
+
```
|
63
|
+
cd ~/mysampleapp
|
64
|
+
pip install agentstr
|
65
|
+
```
|
66
|
+
3. Create a new python file
|
67
|
+
```
|
68
|
+
touch main.py
|
69
|
+
```
|
70
|
+
4. Copy paste this code to the main.py file
|
71
|
+
```
|
72
|
+
from agentstr.core import AgentStr
|
73
|
+
# Create the agent
|
74
|
+
agent = AgentStr("Synvya Inc", "Seller")
|
75
|
+
|
76
|
+
# Test AgentStr new capabilities
|
77
|
+
print(f"Public key: {agent.get_public_key()}\nPrivate key: {agent.get_private_key()}")
|
78
|
+
print(f"Company: {agent.get_company()}\nRole: {agent.get_role()}")
|
79
|
+
|
80
|
+
# Test phidata inherited capabilities
|
81
|
+
agent.print_response("Write two sentence poem for the love between the sun and the moon.")
|
82
|
+
```
|
83
|
+
5. Run the code
|
84
|
+
```
|
85
|
+
~/mysampleapp/bin/python main.py
|
86
|
+
```
|
87
|
+
|
88
|
+
# Contributing
|
89
|
+
Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for specific instructions on installation instructions for developers and how to contribute.
|
90
|
+
|
91
|
+
# Acknowledgments
|
92
|
+
- [Phidata](https://www.phidata.com/.com/) - For building robust AI agents.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
agentstr/__init__.py,sha256=sXLh7g3KC4QCFxcZGBTpG2scR7hmmBsMjq6LqRptkRg,22
|
2
|
+
agentstr/core.py,sha256=xS5q8ltl81DqLjKgiVtjUQ5r-jbEPXXjTlJ0pWcV5p8,1214
|
3
|
+
agentstr-0.0.8.dist-info/LICENSE,sha256=xF8akIKB07gOtkhjENT0xVbWGdFp4-srDKpZKjD03Js,1063
|
4
|
+
agentstr-0.0.8.dist-info/METADATA,sha256=LEYr0pBbK9tZoaUxVKPXmzF9PDnZKM3G4XAGypHXDds,3178
|
5
|
+
agentstr-0.0.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
6
|
+
agentstr-0.0.8.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
7
|
+
agentstr-0.0.8.dist-info/RECORD,,
|
@@ -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.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
agentstr/__init__.py,sha256=sXLh7g3KC4QCFxcZGBTpG2scR7hmmBsMjq6LqRptkRg,22
|
2
|
-
agentstr/core.py,sha256=GMS9WOSF8ymsQ4Ja9EIzMlQAA8oreikKL4yaRANWu9U,59
|
3
|
-
agentstr-0.0.5.dist-info/LICENSE,sha256=xF8akIKB07gOtkhjENT0xVbWGdFp4-srDKpZKjD03Js,1063
|
4
|
-
agentstr-0.0.5.dist-info/METADATA,sha256=kVShRpj10G7cW9FeKqxXu6DGwoGp50RBEXU5absSCWc,751
|
5
|
-
agentstr-0.0.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
6
|
-
agentstr-0.0.5.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
7
|
-
agentstr-0.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|