Skip to content

RKiding/Awesome-finance-skills / skills/alphaear-predictor

alphaear-predictor

Unverified

Market prediction skill using Kronos. Use when user needs finance market time-series forecasting or news-aware finance market adjustments.

FileKindSize
SKILL.mdskill md2.1 KB
references/PROMPTS.mdmarkdown1.0 KB
scripts/__init__.pyscript0 B
scripts/forecast_agent.pyscript2.9 KB
scripts/json_utils.pyscript6.2 KB
scripts/kronos_predictor.pyscript7.6 KB
scripts/predictor/exports/models/kronos_news_v1_20260101_0015.ptother1.2 MB
scripts/predictor/model/__init__.pyscript394 B
scripts/predictor/model/kronos.pyscript30.4 KB
scripts/predictor/model/module.pyscript22.3 KB
scripts/prompts/fin_agent.pyscript6.6 KB
scripts/prompts/forecast_analyst.pyscript1.9 KB
scripts/prompts/intent_agent.pyscript2.2 KB
scripts/prompts/isq_prompt_generator.pyscript1.8 KB
scripts/prompts/report_agent.pyscript18.1 KB
scripts/prompts/trend_agent.pyscript7.4 KB
scripts/prompts/visualizer.pyscript2.0 KB
scripts/schema/isq_template.pyscript13.6 KB
scripts/schema/models.pyscript6.1 KB
scripts/utils/__init__.pyscript25 B
scripts/utils/database_manager.pyscript21.3 KB
scripts/utils/json_utils.pyscript6.2 KB
scripts/utils/llm/capability.pyscript2.8 KB
scripts/utils/llm/factory.pyscript3.6 KB
scripts/utils/llm/router.pyscript2.8 KB
scripts/utils/logging_setup.pyscript1.0 KB
scripts/utils/predictor/evaluation.pyscript5.6 KB
scripts/utils/predictor/kline_generate.pyscript7.6 KB
scripts/utils/predictor/model/__init__.pyscript394 B
scripts/utils/predictor/model/kronos.pyscript30.4 KB
scripts/utils/predictor/model/module.pyscript22.3 KB
scripts/utils/predictor/training.pyscript18.3 KB
scripts/utils/search_tools.pyscript28.6 KB
scripts/utils/stock_tools.pyscript9.8 KB
tests/test_predictor.pyscript1.0 KB

scripts/utils/llm/capability.py

View on GitHub
import os
from typing import Optional, List, Dict, Any
from agno.agent import Agent
from agno.models.base import Model
from loguru import logger
from ..llm.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}")
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall