Skip to content

Commit 7c11f09

Browse files
committed
further stubs for outlines
1 parent 5cc2e78 commit 7c11f09

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

stubs/mlx/__init__.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ from . import nn
44

55
# mlx is imported as a package, primarily for mlx.nn
66
__all__: list[str] = []
7-
8-
nn: Any

stubs/outlines/inputs.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from __future__ import annotations
2+
3+
from collections.abc import Sequence
4+
from typing import Any
5+
6+
from PIL.Image import Image as PILImage
7+
8+
class Chat:
9+
def __init__(self, messages: list[dict[str, Any]] | None = None) -> None: ...
10+
def add_system_message(self, content: str) -> None: ...
11+
def add_user_message(self, content: str | Sequence[str | Image]) -> None: ...
12+
def add_assistant_message(self, content: str | list[str | Image]) -> None: ...
13+
def extend(self, messages: list[dict[str, Any]]) -> None: ...
14+
def append(self, message: dict[str, Any]) -> None: ...
15+
def pop(self) -> dict[str, Any] | None: ...
16+
17+
class Image:
18+
def __init__(self, image: PILImage.Image) -> None: ...

stubs/outlines/models/base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ class Model:
55
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
66
def stream(self, *args: Any, **kwargs: Any) -> Iterable[Any]: ...
77

8-
class AsyncModel(Model):
8+
class AsyncModel:
99
async def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
1010
def stream(self, *args: Any, **kwargs: Any) -> AsyncIterable[Any]: ...

stubs/outlines/types/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from typing import Any
2+
3+
__all__: list[str] = []

stubs/outlines/types/dsl.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from typing import Any
2+
3+
class JsonSchema:
4+
def __init__(self, schema: dict[str, Any]) -> None: ...

0 commit comments

Comments
 (0)