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/factory.py
View on GitHubimport os
from agno.models.openai import OpenAIChat
from agno.models.ollama import Ollama
from agno.models.dashscope import DashScope
from agno.models.deepseek import DeepSeek
from agno.models.openrouter import OpenRouter
def get_model(model_provider: str, model_id: str, **kwargs):
"""
Factory to get the appropriate LLM model.
Args:
model_provider: "openai", "ollama", "deepseek"
model_id: The specific model ID (e.g., "gpt-4o", "llama3", "deepseek-chat")
**kwargs: Additional arguments for the model constructor
"""
if model_provider == "openai":
return OpenAIChat(id=model_id, **kwargs)
elif model_provider == "ollama":
return Ollama(id=model_id, **kwargs)
elif model_provider == "deepseek":
# DeepSeek is OpenAI compatible
api_key = os.getenv("DEEPSEEK_API_KEY")
if not api_key:
print("Warning: DEEPSEEK_API_KEY not set.")
return DeepSeek(
id=model_id,
api_key=api_key,
**kwargs
)
elif model_provider == "dashscope":
api_key = os.getenv("DASHSCOPE_API_KEY")
if not api_key:
print("Warning: DASHSCOPE_API_KEY not set.")
return DashScope(
id=model_id,
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
api_key=api_key,
**kwargs
)
elif model_provider == 'openrouter':
api_key = os.getenv("OPENROUTER_API_KEY")
if not api_key:
print('Warning: OPENROUTER_API_KEY not set.')
return OpenRouter(
id=model_id,
api_key=api_key,
**kwargs
)
elif model_provider == 'zai':
api_key = os.getenv("ZAI_KEY_API")
if not api_key:
print('Warning: ZAI_KEY_API not set.')
# role_map to ensure compatibility.
default_role_map = {
"system": "system",
"user": "user",
"assistant": "assistant",
"tool": "tool",
"model": "assistant",
}
# Allow callers to override role_map via kwargs, otherwise use default
role_map = kwargs.pop("role_map", default_role_map)
return OpenAIChat(
id=model_id,
base_url="https://api.z.ai/api/paas/v4",
api_key=api_key,
timeout=60,
role_map=role_map,
extra_body={"enable_thinking": False}, # TODO: one more setting for thinking
**kwargs
)
elif model_provider == 'ust':
api_key = os.getenv("UST_KEY_API")
if not api_key:
print('Warning: UST_KEY_API not set.')
# Some UST-compatible endpoints expect the standard OpenAI role names
# (e.g. "system", "user", "assistant") rather than Agno's default
# mapping which maps "system" -> "developer". Provide an explicit
# role_map to ensure compatibility.
default_role_map = {
"system": "system",
"user": "user",
"assistant": "assistant",
"tool": "tool",
"model": "assistant",
}
# Allow callers to override role_map via kwargs, otherwise use default
role_map = kwargs.pop("role_map", default_role_map)
return OpenAIChat(
id=model_id,
api_key=api_key,
base_url=os.getenv("UST_URL"),
role_map=role_map,
extra_body={"enable_thinking": False}, # TODO: one more setting for thinking
**kwargs
)
else:
raise ValueError(f"Unknown model provider: {model_provider}")
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 |