sakit 0.0.1__tar.gz
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.
- sakit-0.0.1/LICENSE +7 -0
- sakit-0.0.1/PKG-INFO +128 -0
- sakit-0.0.1/README.md +107 -0
- sakit-0.0.1/pyproject.toml +26 -0
- sakit-0.0.1/sakit/__init__.py +0 -0
- sakit-0.0.1/sakit/search_internet/__init__.py +5 -0
- sakit-0.0.1/sakit/search_internet/plugin.py +148 -0
sakit-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Bevan Hunt
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the โSoftwareโ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED โAS ISโ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
sakit-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: sakit
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Solana Agent Kit
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: ai,openai,ai agents,agi
|
|
7
|
+
Author: Bevan Hunt
|
|
8
|
+
Author-email: bevan@bevanhunt.com
|
|
9
|
+
Requires-Python: >=3.12,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
17
|
+
Requires-Dist: solana-agent (>=11.3.0,<12.0.0)
|
|
18
|
+
Project-URL: Repository, https://github.com/truemagic-coder/solana-agent-kit
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# Solana Agent Kit
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/solana-agent-kit/)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
[](https://www.python.org/downloads/)
|
|
26
|
+
|
|
27
|
+
A collection of powerful plugins to extend the capabilities of Solana Agent.
|
|
28
|
+
|
|
29
|
+
## ๐ Features
|
|
30
|
+
Solana Agent Kit provides a growing library of plugins that enhance your Solana Agent with new capabilities:
|
|
31
|
+
|
|
32
|
+
๐ Internet Search - Search the internet in real-time using Perplexity AI
|
|
33
|
+
|
|
34
|
+
๐ More plugins coming soon!
|
|
35
|
+
|
|
36
|
+
## ๐ฆ Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Using pip
|
|
40
|
+
pip install sakit
|
|
41
|
+
|
|
42
|
+
# Using Poetry
|
|
43
|
+
poetry add sakit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
๐ Plugins
|
|
47
|
+
Internet Search Plugin
|
|
48
|
+
This plugin enables Solana Agent to search the internet for up-to-date information using Perplexity AI.
|
|
49
|
+
|
|
50
|
+
Configuration
|
|
51
|
+
Add your Perplexity API key to your Solana Agent configuration:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
config = {
|
|
55
|
+
# Standard Solana Agent config
|
|
56
|
+
"openai": {
|
|
57
|
+
"api_key": "your-openai-key",
|
|
58
|
+
"default_model": "gpt-4o-mini"
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
# Required for the internet search plugin
|
|
62
|
+
"perplexity_api_key": "your-perplexity-key",
|
|
63
|
+
|
|
64
|
+
# Optional: Configure default search model
|
|
65
|
+
"tools": {
|
|
66
|
+
"search_internet": {
|
|
67
|
+
"default_model": "sonar-reasoning-pro" # Optional, defaults to "sonar"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
# Grant access to specific agents
|
|
72
|
+
"ai_agents": [
|
|
73
|
+
{
|
|
74
|
+
"name": "research_specialist",
|
|
75
|
+
"tools": ["search_internet"], # Enable the tool for this agent
|
|
76
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
|
77
|
+
"specialization": "Research and knowledge synthesis",
|
|
78
|
+
"model": "gpt-4o-mini"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Available Search Models**
|
|
85
|
+
* sonar: Fast, general-purpose search
|
|
86
|
+
* sonar-pro: Enhanced search capabilities
|
|
87
|
+
* sonar-reasoning-pro: Advanced reasoning with search
|
|
88
|
+
* sonar-reasoning: Basic reasoning with search
|
|
89
|
+
|
|
90
|
+
## Usage Examples
|
|
91
|
+
|
|
92
|
+
### Direct command:
|
|
93
|
+
|
|
94
|
+
`!search_internet What are the latest developments in quantum computing?`
|
|
95
|
+
|
|
96
|
+
### #With model parameter:
|
|
97
|
+
`!search_internet --model=sonar-pro What is the current Bitcoin price?`
|
|
98
|
+
|
|
99
|
+
### Automatic usage by agents:
|
|
100
|
+
|
|
101
|
+
AI agents with access to the tool will automatically use it when they determine current information is necessary to answer a query.
|
|
102
|
+
|
|
103
|
+
### Programmatic usage:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
# Execute the search tool directly
|
|
107
|
+
result = await solana_agent.get_tool_service().execute_tool(
|
|
108
|
+
"search_internet",
|
|
109
|
+
user_id="user123",
|
|
110
|
+
params={
|
|
111
|
+
"query": "Latest developments in AI",
|
|
112
|
+
"model": "sonar-reasoning-pro" # Optional, overrides default
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## ๐งฉ Plugin Development
|
|
118
|
+
Want to add your own plugins to Solana Agent Kit? Follow these guidelines:
|
|
119
|
+
|
|
120
|
+
1. Create a new plugin directory under solana_agent_kit/
|
|
121
|
+
2. Implement a plugin class that follows Solana Agent's plugin architecture
|
|
122
|
+
3. Add your plugin to the list in __init__.py
|
|
123
|
+
4. Test thoroughly
|
|
124
|
+
5. Submit a PR!
|
|
125
|
+
|
|
126
|
+
## ๐ License
|
|
127
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
128
|
+
|
sakit-0.0.1/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Solana Agent Kit
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/solana-agent-kit/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
|
|
7
|
+
A collection of powerful plugins to extend the capabilities of Solana Agent.
|
|
8
|
+
|
|
9
|
+
## ๐ Features
|
|
10
|
+
Solana Agent Kit provides a growing library of plugins that enhance your Solana Agent with new capabilities:
|
|
11
|
+
|
|
12
|
+
๐ Internet Search - Search the internet in real-time using Perplexity AI
|
|
13
|
+
|
|
14
|
+
๐ More plugins coming soon!
|
|
15
|
+
|
|
16
|
+
## ๐ฆ Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Using pip
|
|
20
|
+
pip install sakit
|
|
21
|
+
|
|
22
|
+
# Using Poetry
|
|
23
|
+
poetry add sakit
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
๐ Plugins
|
|
27
|
+
Internet Search Plugin
|
|
28
|
+
This plugin enables Solana Agent to search the internet for up-to-date information using Perplexity AI.
|
|
29
|
+
|
|
30
|
+
Configuration
|
|
31
|
+
Add your Perplexity API key to your Solana Agent configuration:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
config = {
|
|
35
|
+
# Standard Solana Agent config
|
|
36
|
+
"openai": {
|
|
37
|
+
"api_key": "your-openai-key",
|
|
38
|
+
"default_model": "gpt-4o-mini"
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
# Required for the internet search plugin
|
|
42
|
+
"perplexity_api_key": "your-perplexity-key",
|
|
43
|
+
|
|
44
|
+
# Optional: Configure default search model
|
|
45
|
+
"tools": {
|
|
46
|
+
"search_internet": {
|
|
47
|
+
"default_model": "sonar-reasoning-pro" # Optional, defaults to "sonar"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
# Grant access to specific agents
|
|
52
|
+
"ai_agents": [
|
|
53
|
+
{
|
|
54
|
+
"name": "research_specialist",
|
|
55
|
+
"tools": ["search_internet"], # Enable the tool for this agent
|
|
56
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
|
57
|
+
"specialization": "Research and knowledge synthesis",
|
|
58
|
+
"model": "gpt-4o-mini"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Available Search Models**
|
|
65
|
+
* sonar: Fast, general-purpose search
|
|
66
|
+
* sonar-pro: Enhanced search capabilities
|
|
67
|
+
* sonar-reasoning-pro: Advanced reasoning with search
|
|
68
|
+
* sonar-reasoning: Basic reasoning with search
|
|
69
|
+
|
|
70
|
+
## Usage Examples
|
|
71
|
+
|
|
72
|
+
### Direct command:
|
|
73
|
+
|
|
74
|
+
`!search_internet What are the latest developments in quantum computing?`
|
|
75
|
+
|
|
76
|
+
### #With model parameter:
|
|
77
|
+
`!search_internet --model=sonar-pro What is the current Bitcoin price?`
|
|
78
|
+
|
|
79
|
+
### Automatic usage by agents:
|
|
80
|
+
|
|
81
|
+
AI agents with access to the tool will automatically use it when they determine current information is necessary to answer a query.
|
|
82
|
+
|
|
83
|
+
### Programmatic usage:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
# Execute the search tool directly
|
|
87
|
+
result = await solana_agent.get_tool_service().execute_tool(
|
|
88
|
+
"search_internet",
|
|
89
|
+
user_id="user123",
|
|
90
|
+
params={
|
|
91
|
+
"query": "Latest developments in AI",
|
|
92
|
+
"model": "sonar-reasoning-pro" # Optional, overrides default
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## ๐งฉ Plugin Development
|
|
98
|
+
Want to add your own plugins to Solana Agent Kit? Follow these guidelines:
|
|
99
|
+
|
|
100
|
+
1. Create a new plugin directory under solana_agent_kit/
|
|
101
|
+
2. Implement a plugin class that follows Solana Agent's plugin architecture
|
|
102
|
+
3. Add your plugin to the list in __init__.py
|
|
103
|
+
4. Test thoroughly
|
|
104
|
+
5. Submit a PR!
|
|
105
|
+
|
|
106
|
+
## ๐ License
|
|
107
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "sakit"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "Solana Agent Kit"
|
|
5
|
+
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
repository = "https://github.com/truemagic-coder/solana-agent-kit"
|
|
9
|
+
keywords = ["ai", "openai", "ai agents", "agi"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
12
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
13
|
+
]
|
|
14
|
+
packages = [{ include = "sakit" }]
|
|
15
|
+
|
|
16
|
+
[tool.poetry.dependencies]
|
|
17
|
+
python = ">=3.12,<4.0"
|
|
18
|
+
requests = "^2.32.3"
|
|
19
|
+
solana-agent = "^11.3.0"
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["poetry-core"]
|
|
23
|
+
build-backend = "poetry.core.masonry.api"
|
|
24
|
+
|
|
25
|
+
[tool.poetry.plugins."solana_agent.plugins"]
|
|
26
|
+
search_internet = "sakit.search_internet:SolanaPlugin"
|
|
File without changes
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Search Internet Plugin for Solana Agent
|
|
3
|
+
Uses Perplexity AI API to search the web and provide results
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
from typing import Dict, Any, Optional, Literal, List
|
|
8
|
+
from solana_agent import Tool
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SearchInternetTool(Tool):
|
|
12
|
+
"""Tool for searching the internet using Perplexity AI."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, config=None):
|
|
15
|
+
"""Initialize with optional config."""
|
|
16
|
+
self._config = config or {}
|
|
17
|
+
self._api_key = self._config.get("perplexity_api_key")
|
|
18
|
+
self._default_model = (
|
|
19
|
+
self._config.get("tools", {})
|
|
20
|
+
.get("search_internet", {})
|
|
21
|
+
.get("default_model", "sonar")
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def name(self) -> str:
|
|
26
|
+
"""Return the tool name."""
|
|
27
|
+
return "search_internet"
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def description(self) -> str:
|
|
31
|
+
"""Return the tool description."""
|
|
32
|
+
return "Search the internet for current information on any topic using Perplexity AI"
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def parameters_schema(self) -> Dict[str, Any]:
|
|
36
|
+
"""Return the JSON schema for the tool parameters."""
|
|
37
|
+
return {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"query": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "The search query to look up online",
|
|
43
|
+
},
|
|
44
|
+
"model": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": [
|
|
47
|
+
"sonar",
|
|
48
|
+
"sonar-pro",
|
|
49
|
+
"sonar-reasoning-pro",
|
|
50
|
+
"sonar-reasoning",
|
|
51
|
+
],
|
|
52
|
+
"description": f"The Perplexity model to use for search (default: {self._default_model})",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
"required": ["query"],
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
def execute(self, query: str, model: Optional[str] = None) -> Dict[str, Any]:
|
|
59
|
+
"""Execute the search and return results.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
query: The search query string
|
|
63
|
+
model: Optional Perplexity model to use, overrides default if specified
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Dictionary containing search results or error message
|
|
67
|
+
"""
|
|
68
|
+
# Use specified model or fall back to default
|
|
69
|
+
search_model = model if model else self._default_model
|
|
70
|
+
|
|
71
|
+
result = self._search_internet(query, search_model)
|
|
72
|
+
|
|
73
|
+
if result.startswith("Failed") or result.startswith("Error"):
|
|
74
|
+
return {"status": "error", "message": result}
|
|
75
|
+
|
|
76
|
+
return {"status": "success", "result": result, "model_used": search_model}
|
|
77
|
+
|
|
78
|
+
def _search_internet(
|
|
79
|
+
self,
|
|
80
|
+
query: str,
|
|
81
|
+
model: Literal[
|
|
82
|
+
"sonar", "sonar-pro", "sonar-reasoning-pro", "sonar-reasoning"
|
|
83
|
+
] = "sonar",
|
|
84
|
+
) -> str:
|
|
85
|
+
"""Perform the internet search using Perplexity AI API.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
query: Search query string
|
|
89
|
+
model: Perplexity model to use
|
|
90
|
+
- sonar: Fast, general-purpose search
|
|
91
|
+
- sonar-pro: Enhanced search capabilities
|
|
92
|
+
- sonar-reasoning-pro: Advanced reasoning with search
|
|
93
|
+
- sonar-reasoning: Basic reasoning with search
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
Search results or error message if search fails
|
|
97
|
+
"""
|
|
98
|
+
try:
|
|
99
|
+
if not self._api_key:
|
|
100
|
+
return "Error: Perplexity API key not configured. Please add 'perplexity_api_key' to your configuration."
|
|
101
|
+
|
|
102
|
+
url = "https://api.perplexity.ai/chat/completions"
|
|
103
|
+
|
|
104
|
+
payload = {
|
|
105
|
+
"model": model,
|
|
106
|
+
"messages": [
|
|
107
|
+
{
|
|
108
|
+
"role": "system",
|
|
109
|
+
"content": "You answer the user's query by searching the internet for current information. Provide sources when available.",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"role": "user",
|
|
113
|
+
"content": query,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
}
|
|
117
|
+
headers = {
|
|
118
|
+
"Authorization": f"Bearer {self._api_key}",
|
|
119
|
+
"Content-Type": "application/json",
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
response = requests.post(url, json=payload, headers=headers)
|
|
123
|
+
if response.status_code == 200:
|
|
124
|
+
data = response.json()
|
|
125
|
+
content = data["choices"][0]["message"]["content"]
|
|
126
|
+
return content
|
|
127
|
+
else:
|
|
128
|
+
return (
|
|
129
|
+
f"Failed to search Perplexity. Status code: {response.status_code}"
|
|
130
|
+
)
|
|
131
|
+
except Exception as e:
|
|
132
|
+
return f"Failed to search Perplexity. Error: {e}"
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class SolanaPlugin:
|
|
136
|
+
"""Plugin provider for Solana Agent."""
|
|
137
|
+
|
|
138
|
+
def __init__(self):
|
|
139
|
+
"""Initialize the plugin."""
|
|
140
|
+
self.config = None
|
|
141
|
+
|
|
142
|
+
def initialize(self, config: Dict[str, Any]) -> None:
|
|
143
|
+
"""Initialize with config from Solana Agent."""
|
|
144
|
+
self.config = config
|
|
145
|
+
|
|
146
|
+
def get_tools(self) -> List[Tool]:
|
|
147
|
+
"""Return the list of tools provided by this plugin."""
|
|
148
|
+
return [SearchInternetTool(self.config)]
|