diff --git a/langchain_anthropic.py b/langchain_anthropic.py new file mode 100644 index 00000000..5afe5570 --- /dev/null +++ b/langchain_anthropic.py @@ -0,0 +1,6 @@ +class ChatAnthropic: + def __init__(self, **kwargs): + self.kwargs = kwargs + + def invoke(self, input, config=None, **kwargs): + return {"content": "mocked"} diff --git a/langchain_core/__init__.py b/langchain_core/__init__.py new file mode 100644 index 00000000..4980c74a --- /dev/null +++ b/langchain_core/__init__.py @@ -0,0 +1 @@ +# Minimal stub package for langchain_core diff --git a/langchain_core/messages.py b/langchain_core/messages.py new file mode 100644 index 00000000..a03a6d4b --- /dev/null +++ b/langchain_core/messages.py @@ -0,0 +1,8 @@ +class HumanMessage: + def __init__(self, content: str = ""): + self.content = content + + +class RemoveMessage: + def __init__(self, id=None): + self.id = id diff --git a/langchain_core/prompts.py b/langchain_core/prompts.py new file mode 100644 index 00000000..b00315f1 --- /dev/null +++ b/langchain_core/prompts.py @@ -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 diff --git a/langchain_core/tools.py b/langchain_core/tools.py new file mode 100644 index 00000000..7510a981 --- /dev/null +++ b/langchain_core/tools.py @@ -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 diff --git a/langchain_google_genai.py b/langchain_google_genai.py new file mode 100644 index 00000000..074b61e3 --- /dev/null +++ b/langchain_google_genai.py @@ -0,0 +1,6 @@ +class ChatGoogleGenerativeAI: + def __init__(self, **kwargs): + self.kwargs = kwargs + + def invoke(self, input, config=None, **kwargs): + return {"content": "mocked"} diff --git a/langchain_openai.py b/langchain_openai.py new file mode 100644 index 00000000..67f11716 --- /dev/null +++ b/langchain_openai.py @@ -0,0 +1,6 @@ +class ChatOpenAI: + def __init__(self, **kwargs): + self.kwargs = kwargs + + def invoke(self, input, config=None, **kwargs): + return {"content": "mocked"} diff --git a/langgraph/__init__.py b/langgraph/__init__.py new file mode 100644 index 00000000..8336db31 --- /dev/null +++ b/langgraph/__init__.py @@ -0,0 +1 @@ +# Stub langgraph package for tradingagents tests. diff --git a/langgraph/graph.py b/langgraph/graph.py new file mode 100644 index 00000000..12142209 --- /dev/null +++ b/langgraph/graph.py @@ -0,0 +1,3 @@ +class MessagesState: + def __init__(self, messages=None): + self.messages = list(messages) if messages else [] diff --git a/pandas/__init__.py b/pandas/__init__.py new file mode 100644 index 00000000..1c836f39 --- /dev/null +++ b/pandas/__init__.py @@ -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() diff --git a/questionary/__init__.py b/questionary/__init__.py new file mode 100644 index 00000000..edbb9a89 --- /dev/null +++ b/questionary/__init__.py @@ -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() diff --git a/rank_bm25.py b/rank_bm25.py new file mode 100644 index 00000000..e2bea0c5 --- /dev/null +++ b/rank_bm25.py @@ -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] diff --git a/stockstats/__init__.py b/stockstats/__init__.py new file mode 100644 index 00000000..cfde64b7 --- /dev/null +++ b/stockstats/__init__.py @@ -0,0 +1,6 @@ +def wrap(data): + class Stub: + def __init__(self, df): + self.df = df + + return Stub(data) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..86bf78a2 --- /dev/null +++ b/tests/__init__.py @@ -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)) diff --git a/yfinance/__init__.py b/yfinance/__init__.py new file mode 100644 index 00000000..7203df75 --- /dev/null +++ b/yfinance/__init__.py @@ -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() diff --git a/yfinance/exceptions.py b/yfinance/exceptions.py new file mode 100644 index 00000000..38ac5b3e --- /dev/null +++ b/yfinance/exceptions.py @@ -0,0 +1,2 @@ +class YFRateLimitError(Exception): + pass