|
| 1 | +from .types import * |
| 2 | +from .autodedent import autodedent as autodedent |
| 3 | +from .private._private_helpers import async_wrap_stream_and_count as async_wrap_stream_and_count, encode_image as encode_image, wrap_stream_and_count as wrap_stream_and_count |
| 4 | +from _typeshed import Incomplete |
| 5 | +from typing import Any, AsyncGenerator, Callable, Generator |
| 6 | +from typing_extensions import Unpack |
| 7 | + |
| 8 | +class Chain: |
| 9 | + client: Incomplete |
| 10 | + asyncClient: Incomplete |
| 11 | + model: Incomplete |
| 12 | + system: Incomplete |
| 13 | + user_prompt: Incomplete |
| 14 | + model_response: Incomplete |
| 15 | + raw_model_response: Incomplete |
| 16 | + usage: Incomplete |
| 17 | + detailed_usage: Incomplete |
| 18 | + def __init__(self, model: str, api_key: str = '', environ_key: str = 'OPENAI_API_KEY') -> None: ... |
| 19 | + async def async_ask(self, system: Message | None, user_messages: list[Message], json_schema: dict[Any, Any] | None = None, stream: bool = False, plain_text_stream: bool = False, **params: Unpack[RequestParams]) -> Any: ... |
| 20 | + def unhook(self) -> Chain: ... |
| 21 | + def anchor(self, system_prompt: str) -> Chain: ... |
| 22 | + def transform(self, function: Callable[[Any], Any]) -> Chain: ... |
| 23 | + def link(self, modifier: Callable[[str | Any | None], str] | str, model: str | None = None, assistant: bool = False, images: str | Any | list[str | Any] | ImageFormat = None) -> Chain: ... |
| 24 | + def setup_pull(self, asynchronous: bool = False, json_schema: dict[Any, Any] | None = None, **params: Unpack[RequestParams]) -> Any: ... |
| 25 | + def pull(self, json_schema: dict[Any, Any] | None = None, **params: Unpack[RequestParams]) -> Chain: ... |
| 26 | + async def async_pull(self, json_schema: dict[Any, Any] | None = None, **params: Unpack[RequestParams]) -> Chain: ... |
| 27 | + def stream(self, plain_text_stream: bool = False, **params: Unpack[RequestParams]) -> Generator[str | Any | None, None, None]: ... |
| 28 | + async def async_stream(self, plain_text_stream: bool = False, **params: Unpack[RequestParams]) -> AsyncGenerator[str | Any | None, None]: ... |
| 29 | + def last(self) -> Any: ... |
| 30 | + def token_usage(self) -> Usage: ... |
| 31 | + def detailed_token_usage(self) -> list[DetailedUsage]: ... |
| 32 | + def reset_token_usage(self) -> Chain: ... |
| 33 | + def subscribe_token_usage(self, usage_object: Usage) -> Chain: ... |
| 34 | + def subscribe_detailed_token_usage(self, detailed_usage_object: list[DetailedUsage]) -> Chain: ... |
| 35 | + def log(self) -> Chain: ... |
| 36 | + def log_tokens(self) -> Chain: ... |
| 37 | + def log_detailed_tokens(self) -> Chain: ... |
0 commit comments