RKiding/Awesome-finance-skills / skills/alphaear-search
alphaear-search
VerifiedPerform finance web searches and local context searches. Use when the user needs general finance info from the web (Jina/DDG/Baidu) or needs to retrieve finance information from a local document store (RAG).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.2 KB |
| references/PROMPTS.md | markdown | 679 B |
| scripts/__init__.py | script | 0 B |
| scripts/content_extractor.py | script | 4.7 KB |
| scripts/database_manager.py | script | 5.8 KB |
| scripts/hybrid_search.py | script | 8.0 KB |
| scripts/llm/__init__.py | script | 0 B |
| scripts/llm/capability.py | script | 2.8 KB |
| scripts/llm/factory.py | script | 3.6 KB |
| scripts/llm/router.py | script | 2.8 KB |
| scripts/search_tools.py | script | 21.6 KB |
| scripts/sentiment_tools.py | script | 9.9 KB |
| tests/test_search.py | script | 861 B |
scripts/llm/capability.py
View on GitHubimport os
from typing import Optional, List, Dict, Any
from agno.agent import Agent
from agno.models.base import Model
from loguru import logger
from .factory import get_model
def test_tool_call_support(model: Model) -> bool:
"""
测试模型是否支持原生的 Tool Call (Function Calling)。
通过尝试执行一个简单的加法工具来验证。
"""
def get_current_weather(location: str):
"""获取指定地点的天气"""
return f"{location} 的天气是晴天,25度。"
test_agent = Agent(
model=model,
tools=[get_current_weather],
instructions="请调用工具查询北京的天气,并直接返回工具的输出结果。"
)
try:
# 运行一个简单的任务,观察是否触发了 tool_call
response = test_agent.run("北京天气怎么样?")
# 检查 response 中是否包含 tool_calls
# Agno 的 RunResponse 对象通常包含 messages,我们可以检查最后几条消息
has_tool_call = False
for msg in response.messages:
if hasattr(msg, 'tool_calls') and msg.tool_calls:
has_tool_call = True
break
if has_tool_call:
logger.info(f"✅ Model {model.id} supports native tool calling.")
return True
else:
# 如果没有 tool_calls 但返回了正确答案,可能是模型通过纯文本模拟了工具调用(ReAct)
# 或者根本没用工具。对于原生支持的判断,我们坚持要求有 tool_calls 结构。
logger.warning(f"⚠️ Model {model.id} did NOT use native tool calling structure.")
return False
except Exception as e:
logger.error(f"❌ Error testing tool call for {model.id}: {e}")
return False
class ModelCapabilityRegistry:
"""
模型能力注册表,用于缓存和管理不同模型的能力测试结果。
"""
_cache = {}
@classmethod
def get_capabilities(cls, provider: str, model_id: str, **kwargs) -> Dict[str, bool]:
key = f"{provider}:{model_id}"
if key not in cls._cache:
logger.info(f"🔍 Testing capabilities for {key}...")
model = get_model(provider, model_id, **kwargs)
supports_tool_call = test_tool_call_support(model)
cls._cache[key] = {
"supports_tool_call": supports_tool_call
}
return cls._cache[key]
if __name__ == "__main__":
# 简单测试脚本
from dotenv import load_dotenv
load_dotenv()
# 测试当前配置的模型
p = os.getenv("LLM_PROVIDER", "ust")
m = os.getenv("LLM_MODEL", "Qwen")
print(f"Testing {p}/{m}...")
res = ModelCapabilityRegistry.get_capabilities(p, m)
print(f"Result: {res}")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |
| fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks. | Stars: 115k | Updated | Claude CodeCodex | Verified | Install |