Skip to content

Commit 9e2aa46

Browse files
authored
Merge pull request #26 from RSS3-Network/feat/executor_optimization
chore: experts rename
2 parents 8414cce + 075ea35 commit 9e2aa46

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

src/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ LLM_API_BASE=http://ollama:11434
3939

4040
## A database is required for vector and user management.
4141
## Database connection string
42-
DB_CONNECTION=postgresql+psycopg://postgres:password@vec_db:5434/vec
42+
DB_CONNECTION=postgresql+psycopg://postgres:password@vector_db:5434/vec
4343

4444
# End of basic configuration
4545
############################

src/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
networks:
1313
- openagent-network
1414

15-
vec_db:
15+
vector_db:
1616
image: pgvector/pgvector:pg16
1717
container_name: vec_db
1818
restart: unless-stopped

src/openagent/experts/article_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ARGS(BaseModel):
1818

1919

2020
class ArticleExpert(BaseTool):
21-
name = "article"
21+
name = "ArticleExecutor"
2222
description = (
2323
"A tool for searching web3-related articles. If you lack knowledge about web3, "
2424
"you can use this tool to find relevant articles that can help answer "

src/openagent/experts/feed_expert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ class ParamSchema(BaseModel):
2121

2222
type: str = Field(
2323
description="""Retrieve activities for the specified type,
24-
for example: all, post, comment, share."""
24+
eg. : all, post, comment, share."""
2525
)
2626

2727

2828
class FeedExpert(BaseTool):
29-
name = "feed"
29+
name = "FeedExecutor"
3030
description = """Use this tool to get the activities of a wallet address or \
3131
blockchain domain name and know what this address has done or doing recently."""
3232
args_schema: Type[ParamSchema] = ParamSchema
@@ -50,7 +50,7 @@ async def _arun(
5050

5151
async def fetch_feeds(address: str, type: str):
5252
url = f"{settings.RSS3_DATA_API}/decentralized/{address}?limit=5&action_limit=10&tag=social"
53-
if type != "all":
53+
if type in ["post", "comment", "share"]:
5454
url += f"&type={type}"
5555
headers = {"Accept": "application/json"}
5656
async with aiohttp.ClientSession() as session:

src/openagent/experts/nft_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ARGS(BaseModel):
3232

3333

3434
class NFTExpert(BaseTool):
35-
name = "NFT"
35+
name = "NFTExecutor"
3636
description = "A tool for searching NFT collections or getting collection rankings."
3737
args_schema: Type[ARGS] = ARGS
3838

src/openagent/experts/price_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ARGS(BaseModel):
1515

1616

1717
class PriceExpert(BaseTool):
18-
name = "price"
18+
name = "PriceExecutor"
1919
description = "use this tool to get the price of a token."
2020
args_schema: Type[ARGS] = ARGS
2121

src/openagent/experts/search_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def google_search(query: str) -> str:
3737

3838

3939
class SearchExpert(BaseTool):
40-
name = "search"
40+
name = "SearchExecutor"
4141
description = """
4242
A versatile search tool that can perform various types of searches based on the query type:
4343
- For queries related to charts, data visualization, or dashboards, use Dune search.

src/openagent/experts/swap_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SwapExpert(BaseTool):
3131
Tool for generating a swap widget for cryptocurrency swaps.
3232
"""
3333

34-
name = "swap"
34+
name = "SwapExecutor"
3535
description = "Use this tool to generate a swap widget for the user to swap cryptocurrencies."
3636
args_schema: Type[ParamSchema] = ParamSchema
3737
return_direct = False

src/openagent/experts/transfer_expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ParamSchema(BaseModel):
3434

3535

3636
class TransferExpert(BaseTool):
37-
name = "transfer"
37+
name = "TransferExecutor"
3838
description = """Use this tool to send cryptocurrencies to another address."""
3939
args_schema: Type[ParamSchema] = ParamSchema
4040
return_direct = False

src/openagent/ui/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def build_token(token_symbol: str, token_address: str):
7878

7979
async def handle_function_message(message: FunctionMessage, msg: cl.Message):
8080
"""Handle FunctionMessage type of messages."""
81-
if message.name == "swap":
81+
if message.name == "SwapExecutor":
8282
swap_dict = json.loads(message.content)
8383
await do_stream_swap_widget(msg, swap_dict)
8484

@@ -130,7 +130,7 @@ async def on_message(message: cl.Message):
130130
async def react_tool_call_handle(message, msg):
131131
try:
132132
swap_dict = parse_json_markdown(message.content)
133-
if "type" in swap_dict and swap_dict["type"] == "swap":
133+
if "type" in swap_dict and swap_dict["type"] == "SwapExecutor":
134134
await do_stream_swap_widget(msg, swap_dict)
135135
except Exception as e:
136136
logger.warning("Failed to handle react tool call message", e)

0 commit comments

Comments
 (0)