Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions agent/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,19 @@ async def search_token(
token: str, chain: Optional[str] = None
) -> Optional[TokenMetadata]:
"""Look up a token by name or symbol (e.g. "jup", "SOL", "bonk") and return its metadata including the token ID. Use this to resolve token names before calling tools that require a token ID."""
token: Optional[TokenMetadata] = await token_metadata_repo.search_token(
token, chain
)
if not token:
return "No token found."

return {
"id": f"{token.chain}:{token.address}",
"address": token.address,
"name": token.name,
"symbol": token.symbol,
"price_usd": token.price,
"chain": token.chain,
}

result: Optional[TokenMetadata] = await token_metadata_repo.search_token(
token, chain
)
if not result:
return "No token found."
return {
"id": f"{result.chain}:{result.address}",
"address": result.address,
"name": result.name,
"symbol": result.symbol,
"price_usd": result.price,
"chain": result.chain,
}
return [
# TVL tools
show_defi_llama_historical_global_tvl,
Expand Down
8 changes: 6 additions & 2 deletions server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

SKIP_TOKEN_AUTH_HEADER = os.getenv("SKIP_TOKEN_AUTH_HEADER")
SKIP_TOKEN_AUTH_KEY = os.getenv("SKIP_TOKEN_AUTH_KEY")

OG_RPC_URL: str = os.getenv("OG_RPC_URL", "https://ogevmdevnet.opengradient.ai")
WALLET_PRIV_KEY: str = os.getenv("WALLET_PRIV_KEY")

# Use OG TEE flag for LLM inference
USE_TEE = os.getenv("USE_OG_TEE", "").lower() == "true"

if not WALLET_PRIV_KEY:
raise EnvironmentError(
"WALLET_PRIV_KEY environment variable is not set. "
"Please set it in your .env file before starting the server."
)