This commit is contained in:
Ryanba 2026-04-13 20:57:54 +09:00 committed by GitHub
commit bee88adaed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 160 additions and 0 deletions

6
langchain_anthropic.py Normal file
View File

@ -0,0 +1,6 @@
class ChatAnthropic:
def __init__(self, **kwargs):
self.kwargs = kwargs
def invoke(self, input, config=None, **kwargs):
return {"content": "mocked"}

View File

@ -0,0 +1 @@
# Minimal stub package for langchain_core

View File

@ -0,0 +1,8 @@
class HumanMessage:
def __init__(self, content: str = ""):
self.content = content
class RemoveMessage:
def __init__(self, id=None):
self.id = id

11
langchain_core/prompts.py Normal file
View File

@ -0,0 +1,11 @@
class ChatPromptTemplate:
def __init__(self, *args, **kwargs):
self.args = args
def format_messages(self, **kwargs):
return []
class MessagesPlaceholder:
def __init__(self, variable_name: str):
self.variable_name = variable_name

15
langchain_core/tools.py Normal file
View File

@ -0,0 +1,15 @@
from functools import wraps
from typing import Callable, Optional
def tool(*args: str, **kwargs: str):
def decorator(func: Callable):
@wraps(func)
def wrapper(*f_args, **f_kwargs):
return func(*f_args, **f_kwargs)
return wrapper
if args and callable(args[0]):
return decorator(args[0])
return decorator

View File

@ -0,0 +1,6 @@
class ChatGoogleGenerativeAI:
def __init__(self, **kwargs):
self.kwargs = kwargs
def invoke(self, input, config=None, **kwargs):
return {"content": "mocked"}

6
langchain_openai.py Normal file
View File

@ -0,0 +1,6 @@
class ChatOpenAI:
def __init__(self, **kwargs):
self.kwargs = kwargs
def invoke(self, input, config=None, **kwargs):
return {"content": "mocked"}

1
langgraph/__init__.py Normal file
View File

@ -0,0 +1 @@
# Stub langgraph package for tradingagents tests.

3
langgraph/graph.py Normal file
View File

@ -0,0 +1,3 @@
class MessagesState:
def __init__(self, messages=None):
self.messages = list(messages) if messages else []

24
pandas/__init__.py Normal file
View File

@ -0,0 +1,24 @@
"""Lightweight pandas stub for tests."""
from typing import Any, Iterable, Optional
class DataFrame(list):
def __init__(self, *args: Iterable[Any], **kwargs: Any):
super().__init__(*args)
def to_dict(self, *args, **kwargs) -> dict:
return {}
class Series:
def __init__(self, data: Optional[Iterable[Any]] = None):
self.data = list(data) if data is not None else []
def read_csv(*args: Any, **kwargs: Any) -> DataFrame:
return DataFrame()
def concat(*args: Any, **kwargs: Any) -> DataFrame:
return DataFrame()

34
questionary/__init__.py Normal file
View File

@ -0,0 +1,34 @@
from __future__ import annotations
from typing import Any, Iterable, List, Optional, Tuple
class Style:
def __init__(self, styles: Iterable[Tuple[str, str]]):
self.styles = list(styles)
class Choice:
def __init__(self, display: str, value: Optional[Any] = None):
self.display = display
self.value = value if value is not None else display
class _DummyPrompt:
def __init__(self, return_value: Optional[str] = ""):
self.return_value = return_value or ""
def ask(self) -> str:
return self.return_value
def text(*args: Any, **kwargs: Any) -> _DummyPrompt:
return _DummyPrompt(kwargs.get("default", ""))
def checkbox(*args: Any, **kwargs: Any) -> _DummyPrompt:
return _DummyPrompt()
def select(*args: Any, **kwargs: Any) -> _DummyPrompt:
return _DummyPrompt()

6
rank_bm25.py Normal file
View File

@ -0,0 +1,6 @@
class BM25Okapi:
def __init__(self, corpus, *args, **kwargs):
self.corpus = list(corpus)
def get_scores(self, query):
return [0.0 for _ in self.corpus]

6
stockstats/__init__.py Normal file
View File

@ -0,0 +1,6 @@
def wrap(data):
class Stub:
def __init__(self, df):
self.df = df
return Stub(data)

6
tests/__init__.py Normal file
View File

@ -0,0 +1,6 @@
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))

25
yfinance/__init__.py Normal file
View File

@ -0,0 +1,25 @@
from datetime import datetime
class Ticker:
def __init__(self, symbol: str):
self.symbol = symbol
def history(self, start=None, end=None, **kwargs):
class DummyData:
def __init__(self):
self.index = type("Idx", (), {"tz": None})()
self.columns = []
self._data = []
@property
def empty(self):
return True
def to_csv(self):
return ""
def __len__(self):
return 0
return DummyData()

2
yfinance/exceptions.py Normal file
View File

@ -0,0 +1,2 @@
class YFRateLimitError(Exception):
pass