SYMBOL INDEX (1469 symbols across 108 files) FILE: docs/examples/extract_event_details.py class Event (line 15) | class Event(BaseModel): FILE: examples/babyagi.py function create_tasks_fmt (line 26) | def create_tasks_fmt(result: str) -> List[str]: function prioritize_tasks_fmt (line 38) | def prioritize_tasks_fmt(result: str): function one_cycle (line 61) | def one_cycle(objective: str, task_list, next_task_id: int): FILE: examples/beam-cloud/app.py function load_models (line 11) | def load_models(): function predict (line 32) | def predict(context, **inputs): FILE: examples/bentoml/import_model.py function import_model (line 7) | def import_model(model_id, bento_model_tag): FILE: examples/bentoml/service.py class Outlines (line 53) | class Outlines: method __init__ (line 56) | def __init__(self) -> None: method generate (line 72) | async def generate( FILE: examples/cerebrium/main.py function generate (line 40) | def generate( FILE: examples/dating_profile.py class QuestionChoice (line 12) | class QuestionChoice(str, Enum): class QuestionAnswer (line 22) | class QuestionAnswer: class DatingProfile (line 27) | class DatingProfile(BaseModel): class Example (line 39) | class Example: FILE: examples/llamacpp_example.py class Weapon (line 9) | class Weapon(str, Enum): class Armor (line 18) | class Armor(str, Enum): class Character (line 24) | class Character(BaseModel): FILE: examples/llamacpp_processor.py class Weapon (line 10) | class Weapon(str, Enum): class Armor (line 19) | class Armor(str, Enum): class Character (line 25) | class Character(BaseModel): FILE: examples/math_generate_code.py function execute_code (line 35) | def execute_code(code): FILE: examples/meta_prompting.py function split_into_steps (line 24) | def split_into_steps(question, model_name: str): function fill_in_the_blanks (line 45) | def fill_in_the_blanks(question, model_name: str): function ask_an_expert (line 66) | def ask_an_expert(question, model_name: str): function ask_an_expert_simple (line 105) | def ask_an_expert_simple(question, model_name: str): function run_example (line 132) | def run_example(model_fn, question, model_name): FILE: examples/modal_example.py function import_model (line 14) | def import_model(): function generate (line 64) | def generate( function main (line 85) | def main( FILE: examples/react.py function search_wikipedia (line 45) | def search_wikipedia(query: str): FILE: examples/vllm_offline_integration.py class Person (line 11) | class Person(BaseModel): FILE: outlines/applications.py class Application (line 14) | class Application: method __init__ (line 55) | def __init__( method __call__ (line 76) | def __call__( FILE: outlines/backends/__init__.py function _get_backend (line 32) | def _get_backend(backend_name: str, model: SteerableModel) -> BaseBackend: function get_json_schema_logits_processor (line 58) | def get_json_schema_logits_processor( function get_regex_logits_processor (line 87) | def get_regex_logits_processor( function get_cfg_logits_processor (line 116) | def get_cfg_logits_processor( FILE: outlines/backends/base.py class BaseBackend (line 10) | class BaseBackend(ABC): method get_json_schema_logits_processor (line 19) | def get_json_schema_logits_processor( method get_regex_logits_processor (line 38) | def get_regex_logits_processor(self, regex: str) -> LogitsProcessorType: method get_cfg_logits_processor (line 55) | def get_cfg_logits_processor(self, grammar: str) -> LogitsProcessorType: FILE: outlines/backends/llguidance.py class LLGuidanceLogitsProcessor (line 20) | class LLGuidanceLogitsProcessor(OutlinesLogitsProcessor): method __init__ (line 23) | def __init__( method reset (line 46) | def reset(self): method _setup (line 50) | def _setup(self, batch_size: int) -> None: method _bias_logits_mlx (line 90) | def _bias_logits_mlx( # pragma: no cover method _bias_logits_torch (line 107) | def _bias_logits_torch( method _bias_logits_numpy (line 130) | def _bias_logits_numpy( method process_logits (line 144) | def process_logits( class LLGuidanceBackend (line 180) | class LLGuidanceBackend(BaseBackend): method __init__ (line 183) | def __init__(self, model: SteerableModel): method _create_llg_tokenizer (line 197) | def _create_llg_tokenizer(self, model: SteerableModel) -> "LLGTokenizer": method get_json_schema_logits_processor (line 237) | def get_json_schema_logits_processor( method get_regex_logits_processor (line 258) | def get_regex_logits_processor( method get_cfg_logits_processor (line 279) | def get_cfg_logits_processor( FILE: outlines/backends/outlines_core.py class OutlinesCoreLogitsProcessor (line 19) | class OutlinesCoreLogitsProcessor(OutlinesLogitsProcessor): method __init__ (line 22) | def __init__(self, index: Index, tensor_library_name: str): method reset (line 38) | def reset(self) -> None: method _setup (line 42) | def _setup(self, batch_size: int, vocab_size: int) -> None: method _bias_logits_mlx (line 84) | def _bias_logits_mlx( # pragma: no cover method _bias_logits_torch (line 104) | def _bias_logits_torch(self, batch_size: int, logits: TensorType) -> T... method _bias_logits_numpy (line 124) | def _bias_logits_numpy(self, batch_size: int, logits: TensorType) -> T... method process_logits (line 140) | def process_logits(self, input_ids: TensorType, logits: TensorType) ->... class OutlinesCoreBackend (line 176) | class OutlinesCoreBackend(BaseBackend): method __init__ (line 179) | def __init__(self, model: SteerableModel): method get_json_schema_logits_processor (line 214) | def get_json_schema_logits_processor(self, json_schema: str): method get_regex_logits_processor (line 231) | def get_regex_logits_processor(self, regex: str): method get_cfg_logits_processor (line 248) | def get_cfg_logits_processor(self, grammar): method create_outlines_core_vocabulary (line 254) | def create_outlines_core_vocabulary( FILE: outlines/backends/xgrammar.py class XGrammarLogitsProcessor (line 13) | class XGrammarLogitsProcessor(OutlinesLogitsProcessor): method __init__ (line 16) | def __init__(self, compiled_grammar: str, tensor_library_name: str,): method reset (line 34) | def reset(self): method _setup (line 38) | def _setup(self, batch_size: int, vocab_size: int) -> None: method _bias_logits_torch (line 55) | def _bias_logits_torch( method _bias_logits_mlx (line 75) | def _bias_logits_mlx( # pragma: no cover method process_logits (line 92) | def process_logits( class XGrammarBackend (line 113) | class XGrammarBackend(BaseBackend): method __init__ (line 116) | def __init__(self, model: SteerableModel): method get_json_schema_logits_processor (line 143) | def get_json_schema_logits_processor( method get_regex_logits_processor (line 167) | def get_regex_logits_processor( method get_cfg_logits_processor (line 189) | def get_cfg_logits_processor( FILE: outlines/caching.py class CloudpickleDisk (line 17) | class CloudpickleDisk(Disk): # pragma: no cover method __init__ (line 18) | def __init__(self, directory, compress_level=1, **kwargs): method put (line 22) | def put(self, key): method get (line 26) | def get(self, key, raw): method store (line 30) | def store(self, value, read, key=UNKNOWN): method fetch (line 35) | def fetch(self, mode, filename, value, read): function get_cache (line 43) | def get_cache(): function cache (line 86) | def cache(expire: Optional[float] = None, typed=False, ignore=()): function disable_cache (line 156) | def disable_cache(): function clear_cache (line 180) | def clear_cache(): function cache_disabled (line 187) | def cache_disabled(): FILE: outlines/generator.py class BlackBoxGenerator (line 28) | class BlackBoxGenerator: method __init__ (line 38) | def __init__(self, model: BlackBoxModel, output_type: Optional[Any]): method __call__ (line 51) | def __call__(self, prompt: Any, **inference_kwargs) -> Any: method batch (line 71) | def batch(self, prompts: List[Any], **inference_kwargs) -> List[Any]: method stream (line 91) | def stream(self, prompt: Any, **inference_kwargs) -> Iterator[Any]: class AsyncBlackBoxGenerator (line 112) | class AsyncBlackBoxGenerator: method __init__ (line 122) | def __init__(self, model: AsyncBlackBoxModel, output_type: Optional[An... method __call__ (line 135) | async def __call__(self, prompt: Any, **inference_kwargs) -> Any: method batch (line 155) | async def batch(self, prompts: List[Any], **inference_kwargs) -> List[... method stream (line 175) | async def stream(self, prompt: Any, **inference_kwargs) -> AsyncIterat... class SteerableGenerator (line 197) | class SteerableGenerator: method __init__ (line 216) | def __init__( method from_processor (line 260) | def from_processor( method __call__ (line 279) | def __call__(self, prompt: Any, **inference_kwargs) -> Any: method batch (line 301) | def batch(self, prompts: List[Any], **inference_kwargs) -> List[Any]: method stream (line 323) | def stream(self, prompt: Any, **inference_kwargs) -> Iterator[Any]: function Generator (line 346) | def Generator( FILE: outlines/grammars.py function read_grammar (line 8) | def read_grammar( FILE: outlines/inputs.py class Image (line 12) | class Image: method __post_init__ (line 26) | def __post_init__(self): class Video (line 41) | class Video: class Audio (line 58) | class Audio: class Chat (line 75) | class Chat: method __post_init__ (line 112) | def __post_init__(self): method append (line 116) | def append(self, message: Dict[str, Any]): method extend (line 127) | def extend(self, messages: List[Dict[str, Any]]): method pop (line 138) | def pop(self) -> Dict[str, Any]: method add_system_message (line 149) | def add_system_message(self, content: str | List[Any]): method add_user_message (line 160) | def add_user_message(self, content: str | List[Any]): method add_assistant_message (line 171) | def add_assistant_message(self, content: str | List[Any]): method __str__ (line 182) | def __str__(self): method __repr__ (line 185) | def __repr__(self): FILE: outlines/models/anthropic.py class AnthropicTypeAdapter (line 15) | class AnthropicTypeAdapter(ModelTypeAdapter): method format_input (line 27) | def format_input(self, model_input): method format_str_model_input (line 48) | def format_str_model_input(self, model_input: str) -> dict: method format_list_model_input (line 54) | def format_list_model_input(self, model_input: list) -> dict: method format_chat_model_input (line 62) | def format_chat_model_input(self, model_input: Chat) -> dict: method _create_message (line 74) | def _create_message(self, role: str, content: str | list) -> dict: method format_output_type (line 117) | def format_output_type(self, output_type): class Anthropic (line 128) | class Anthropic(Model): method __init__ (line 135) | def __init__( method generate (line 151) | def generate( method generate_batch (line 195) | def generate_batch( method generate_stream (line 205) | def generate_stream( function from_anthropic (line 257) | def from_anthropic( FILE: outlines/models/base.py class ModelTypeAdapter (line 7) | class ModelTypeAdapter(ABC): method format_input (line 19) | def format_input(self, model_input: Any) -> Any: method format_output_type (line 42) | def format_output_type(self, output_type: Optional[Any] = None) -> Any: class Model (line 62) | class Model(ABC): method __call__ (line 80) | def __call__( method batch (line 124) | def batch( method stream (line 170) | def stream( method generate (line 219) | def generate( method generate_batch (line 249) | def generate_batch( method generate_stream (line 278) | def generate_stream( class AsyncModel (line 307) | class AsyncModel(ABC): method __call__ (line 325) | async def __call__( method batch (line 370) | async def batch( method stream (line 416) | async def stream( method generate (line 467) | async def generate( method generate_batch (line 497) | async def generate_batch( method generate_stream (line 527) | async def generate_stream( FILE: outlines/models/dottxt.py class DottxtTypeAdapter (line 14) | class DottxtTypeAdapter(ModelTypeAdapter): method format_input (line 17) | def format_input(self, model_input: str) -> str: method format_output_type (line 38) | def format_output_type(self, output_type: Optional[Any] = None) -> str: class Dottxt (line 78) | class Dottxt(Model): method __init__ (line 86) | def __init__( method generate (line 108) | def generate( method generate_batch (line 155) | def generate_batch( method generate_stream (line 165) | def generate_stream( function from_dottxt (line 178) | def from_dottxt( FILE: outlines/models/gemini.py class GeminiTypeAdapter (line 31) | class GeminiTypeAdapter(ModelTypeAdapter): method format_input (line 41) | def format_input(self, model_input): method format_str_model_input (line 62) | def format_str_model_input(self, model_input: str) -> dict: method format_list_model_input (line 66) | def format_list_model_input(self, model_input: list) -> dict: method format_chat_model_input (line 74) | def format_chat_model_input(self, model_input: Chat) -> dict: method _create_message (line 86) | def _create_message(self, role: str, content: str | list) -> dict: method _create_text_part (line 129) | def _create_text_part(self, text: str) -> dict: method _create_img_part (line 135) | def _create_img_part(self, image: Image) -> dict: method format_output_type (line 144) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: method format_enum_output_type (line 205) | def format_enum_output_type(self, output_type: Optional[Any]) -> dict: method format_json_output_type (line 211) | def format_json_output_type(self, output_type: Optional[Any]) -> dict: method format_list_output_type (line 217) | def format_list_output_type(self, output_type: Optional[Any]) -> dict: class Gemini (line 246) | class Gemini(Model): method __init__ (line 255) | def __init__(self, client: "Client", model_name: Optional[str] = None): method generate (line 269) | def generate( method generate_batch (line 305) | def generate_batch( method generate_stream (line 315) | def generate_stream( function from_gemini (line 354) | def from_gemini(client: "Client", model_name: Optional[str] = None) -> G... FILE: outlines/models/llamacpp.py class LlamaCppTokenizer (line 28) | class LlamaCppTokenizer(Tokenizer): method __init__ (line 29) | def __init__(self, model: "Llama"): method decode (line 89) | def decode(self, token_ids: List[int]) -> List[str]: method encode (line 93) | def encode( method convert_token_to_string (line 115) | def convert_token_to_string(self, token: str) -> str: method __eq__ (line 129) | def __eq__(self, other): method __hash__ (line 134) | def __hash__(self): method __getstate__ (line 146) | def __getstate__(self): method __setstate__ (line 156) | def __setstate__(self, state): class LlamaCppTypeAdapter (line 160) | class LlamaCppTypeAdapter(ModelTypeAdapter): method __init__ (line 168) | def __init__(self, has_chat_template: bool = False): method format_input (line 178) | def format_input(self, model_input): method format_str_input (line 198) | def format_str_input(self, model_input: str) -> str | list: method format_chat_input (line 204) | def format_chat_input(self, model_input: Chat) -> list: method format_output_type (line 222) | def format_output_type( class LlamaCpp (line 245) | class LlamaCpp(Model): method __init__ (line 254) | def __init__(self, model: "Llama", chat_mode: bool = True): method generate (line 275) | def generate( method generate_batch (line 323) | def generate_batch( method generate_stream (line 331) | def generate_stream( function from_llamacpp (line 380) | def from_llamacpp(model: "Llama", chat_mode: bool = True) -> LlamaCpp: FILE: outlines/models/lmstudio.py class LMStudioTypeAdapter (line 24) | class LMStudioTypeAdapter(ModelTypeAdapter): method _prepare_lmstudio_image (line 27) | def _prepare_lmstudio_image(self, image: Image): method format_input (line 41) | def format_input(self, model_input): method format_str_model_input (line 61) | def format_str_model_input(self, model_input: str) -> str: method format_list_model_input (line 66) | def format_list_model_input(self, model_input: list) -> "LMStudioChat": method format_chat_model_input (line 82) | def format_chat_model_input(self, model_input: Chat) -> "LMStudioChat": method format_output_type (line 122) | def format_output_type( class LMStudio (line 160) | class LMStudio(Model): method __init__ (line 168) | def __init__(self, client: "Client", model_name: Optional[str] = None): method generate (line 184) | def generate( method generate_batch (line 224) | def generate_batch( method generate_stream (line 234) | def generate_stream( class AsyncLMStudio (line 276) | class AsyncLMStudio(AsyncModel): method __init__ (line 284) | def __init__( method close (line 302) | async def close(self) -> None: method generate (line 308) | async def generate( method generate_batch (line 352) | async def generate_batch( method generate_stream (line 362) | async def generate_stream( # type: ignore function from_lmstudio (line 408) | def from_lmstudio( FILE: outlines/models/mistral.py class MistralTypeAdapter (line 35) | class MistralTypeAdapter(ModelTypeAdapter): method format_input (line 44) | def format_input(self, model_input): method format_str_model_input (line 64) | def format_str_model_input(self, model_input: str) -> list: method format_list_model_input (line 83) | def format_list_model_input(self, model_input: list) -> list: method format_chat_model_input (line 103) | def format_chat_model_input(self, model_input: Chat) -> list: method _create_message_content (line 137) | def _create_message_content( method format_output_type (line 189) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: method format_json_schema_type (line 242) | def format_json_schema_type( class Mistral (line 273) | class Mistral(Model): method __init__ (line 281) | def __init__( method generate (line 297) | def generate( method generate_batch (line 348) | def generate_batch( method generate_stream (line 358) | def generate_stream( class AsyncMistral (line 411) | class AsyncMistral(AsyncModel): method __init__ (line 419) | def __init__( method generate (line 435) | async def generate( method generate_batch (line 487) | async def generate_batch( method generate_stream (line 497) | async def generate_stream( function from_mistral (line 552) | def from_mistral( FILE: outlines/models/mlxlm.py class MLXLMTypeAdapter (line 19) | class MLXLMTypeAdapter(ModelTypeAdapter): method __init__ (line 22) | def __init__(self, tokenizer: "PreTrainedTokenizer", has_chat_template... method format_input (line 27) | def format_input(self, model_input): method format_str_input (line 47) | def format_str_input(self, model_input: str) -> str: method format_chat_input (line 53) | def format_chat_input(self, model_input: Chat) -> str: method format_output_type (line 69) | def format_output_type( class MLXLM (line 90) | class MLXLM(Model): method __init__ (line 100) | def __init__( method generate (line 125) | def generate( method generate_batch (line 159) | def generate_batch( method generate_stream (line 218) | def generate_stream( function from_mlxlm (line 254) | def from_mlxlm(model: "nn.Module", tokenizer: "PreTrainedTokenizer") -> ... FILE: outlines/models/ollama.py class OllamaTypeAdapter (line 25) | class OllamaTypeAdapter(ModelTypeAdapter): method format_input (line 29) | def format_input(self, model_input): method format_str_model_input (line 50) | def format_str_model_input(self, model_input: str) -> list: method format_list_model_input (line 60) | def format_list_model_input(self, model_input: list) -> list: method format_chat_model_input (line 70) | def format_chat_model_input(self, model_input: Chat) -> list: method _create_message (line 80) | def _create_message(self, role: str, content: str | list) -> dict: method format_output_type (line 109) | def format_output_type( class Ollama (line 147) | class Ollama(Model): method __init__ (line 155) | def __init__(self, client: "Client", model_name: Optional[str] = None): method generate (line 169) | def generate(self, method generate_batch (line 205) | def generate_batch( method generate_stream (line 215) | def generate_stream( class AsyncOllama (line 253) | class AsyncOllama(AsyncModel): method __init__ (line 261) | def __init__( method generate (line 277) | async def generate(self, method generate_batch (line 311) | async def generate_batch( method generate_stream (line 321) | async def generate_stream( # type: ignore function from_ollama (line 359) | def from_ollama( FILE: outlines/models/openai.py class OpenAITypeAdapter (line 33) | class OpenAITypeAdapter(ModelTypeAdapter): method format_input (line 43) | def format_input(self, model_input): method format_str_model_input (line 63) | def format_str_model_input(self, model_input: str) -> list: method format_list_model_input (line 73) | def format_list_model_input(self, model_input: list) -> list: method format_chat_model_input (line 83) | def format_chat_model_input(self, model_input: Chat) -> list: method _create_message (line 93) | def _create_message(self, role: str, content: str | list) -> dict: method _create_img_content (line 129) | def _create_img_content(self, image: Image) -> dict: method format_output_type (line 138) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: method format_json_output_type (line 181) | def format_json_output_type(self, schema: dict) -> dict: method format_json_mode_type (line 200) | def format_json_mode_type(self) -> dict: class OpenAI (line 209) | class OpenAI(Model): method __init__ (line 217) | def __init__( method generate (line 235) | def generate( method generate_batch (line 295) | def generate_batch( method generate_stream (line 305) | def generate_stream( class AsyncOpenAI (line 359) | class AsyncOpenAI(AsyncModel): method __init__ (line 367) | def __init__( method generate (line 385) | async def generate( method generate_batch (line 445) | async def generate_batch( method generate_stream (line 455) | async def generate_stream( # type: ignore function from_openai (line 509) | def from_openai( FILE: outlines/models/sglang.py class SGLangTypeAdapter (line 25) | class SGLangTypeAdapter(ModelTypeAdapter): method format_input (line 28) | def format_input(self, model_input: Union[Chat, list, str]) -> list: method format_output_type (line 47) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: class SGLang (line 82) | class SGLang(Model): method __init__ (line 92) | def __init__(self, client, model_name: Optional[str] = None): method generate (line 106) | def generate( method generate_batch (line 152) | def generate_batch( method generate_stream (line 162) | def generate_stream( method _build_client_args (line 199) | def _build_client_args( class AsyncSGLang (line 221) | class AsyncSGLang(AsyncModel): method __init__ (line 231) | def __init__(self, client, model_name: Optional[str] = None): method generate (line 250) | async def generate( method generate_batch (line 294) | async def generate_batch( method generate_stream (line 304) | async def generate_stream( # type: ignore method _build_client_args (line 342) | def _build_client_args( function from_sglang (line 364) | def from_sglang( FILE: outlines/models/tgi.py class TGITypeAdapter (line 23) | class TGITypeAdapter(ModelTypeAdapter): method format_input (line 27) | def format_input(self, model_input): method format_str_input (line 47) | def format_str_input(self, model_input: str) -> str: method format_output_type (line 50) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: class TGI (line 88) | class TGI(Model): method __init__ (line 98) | def __init__(self, client): method generate (line 109) | def generate( method generate_batch (line 142) | def generate_batch( method generate_stream (line 150) | def generate_stream( method _build_client_args (line 186) | def _build_client_args( class AsyncTGI (line 205) | class AsyncTGI(AsyncModel): method __init__ (line 215) | def __init__(self, client): method generate (line 226) | async def generate( method generate_batch (line 259) | async def generate_batch( method generate_stream (line 267) | async def generate_stream( # type: ignore method _build_client_args (line 303) | def _build_client_args( function from_tgi (line 322) | def from_tgi( FILE: outlines/models/tokenizer.py class Tokenizer (line 10) | class Tokenizer(Hashable, Protocol): method encode (line 17) | def encode( method decode (line 23) | def decode(self, token_ids: "NDArray[np.int64]") -> List[str]: method convert_token_to_string (line 27) | def convert_token_to_string(self, token: str) -> str: function _check_hf_chat_template (line 37) | def _check_hf_chat_template(tokenizer: "PreTrainedTokenizer | PreTrained... FILE: outlines/models/transformers.py function get_llama_tokenizer_types (line 26) | def get_llama_tokenizer_types(): class TransformerTokenizer (line 68) | class TransformerTokenizer(Tokenizer): method __init__ (line 71) | def __init__(self, tokenizer: "PreTrainedTokenizer", **kwargs): method encode (line 89) | def encode( method decode (line 97) | def decode(self, token_ids: "torch.LongTensor") -> List[str]: method convert_token_to_string (line 101) | def convert_token_to_string(self, token: str) -> str: method __eq__ (line 111) | def __eq__(self, other): method __hash__ (line 121) | def __hash__(self): method __getstate__ (line 126) | def __getstate__(self): method __setstate__ (line 130) | def __setstate__(self, state): class TransformersTypeAdapter (line 134) | class TransformersTypeAdapter(ModelTypeAdapter): method __init__ (line 137) | def __init__(self, tokenizer: "PreTrainedTokenizer", has_chat_template... method format_input (line 142) | def format_input(self, model_input): method format_str_input (line 162) | def format_str_input(self, model_input: str) -> str: method format_chat_input (line 168) | def format_chat_input(self, model_input: Chat) -> str: method format_output_type (line 175) | def format_output_type( class Transformers (line 199) | class Transformers(Model): method __init__ (line 209) | def __init__( method _prepare_model_inputs (line 283) | def _prepare_model_inputs( method generate (line 309) | def generate( method generate_batch (line 355) | def generate_batch( method generate_stream (line 376) | def generate_stream(self, model_input, output_type, **inference_kwargs): method _generate_output_seq (line 386) | def _generate_output_seq(self, prompts, inputs, **inference_kwargs): method _decode_generation (line 402) | def _decode_generation(self, generated_ids: "torch.Tensor"): class TransformersMultiModalTypeAdapter (line 419) | class TransformersMultiModalTypeAdapter(ModelTypeAdapter): method __init__ (line 422) | def __init__(self, **kwargs): method format_input (line 426) | def format_input(self, model_input): method format_chat_input (line 448) | def format_chat_input(self, model_input: Chat) -> dict: method _prepare_message (line 469) | def _prepare_message(self, role: str, content: str | list) -> tuple[di... method _extract_assets_from_content (line 493) | def _extract_assets_from_content(self, content: list) -> list: method _format_asset_for_template (line 535) | def _format_asset_for_template(self, asset: Image | Video | Audio) -> ... method format_list_input (line 550) | def format_list_input(self, model_input: list) -> dict: method format_output_type (line 583) | def format_output_type( class TransformersMultiModal (line 607) | class TransformersMultiModal(Transformers): method __init__ (line 617) | def __init__( method _prepare_model_inputs (line 654) | def _prepare_model_inputs( function from_transformers (line 690) | def from_transformers( FILE: outlines/models/utils.py function set_additional_properties_false_json_schema (line 4) | def set_additional_properties_false_json_schema(schema: dict) -> dict: FILE: outlines/models/vllm.py class VLLMTypeAdapter (line 17) | class VLLMTypeAdapter(ModelTypeAdapter): method format_input (line 20) | def format_input(self, model_input: Union[Chat, str, list]) -> list: method format_output_type (line 39) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: class VLLM (line 68) | class VLLM(Model): method __init__ (line 77) | def __init__( method generate (line 93) | def generate( method generate_batch (line 139) | def generate_batch( method generate_stream (line 147) | def generate_stream( method _build_client_args (line 184) | def _build_client_args( class AsyncVLLM (line 209) | class AsyncVLLM(AsyncModel): method __init__ (line 218) | def __init__( method generate (line 234) | async def generate( method generate_batch (line 278) | async def generate_batch( method generate_stream (line 286) | async def generate_stream( # type: ignore method _build_client_args (line 323) | def _build_client_args( function from_vllm (line 348) | def from_vllm( FILE: outlines/models/vllm_offline.py class VLLMOfflineTypeAdapter (line 19) | class VLLMOfflineTypeAdapter(ModelTypeAdapter): method __init__ (line 22) | def __init__(self, has_chat_template: bool = False): method format_input (line 26) | def format_input(self, model_input): method format_input_str (line 42) | def format_input_str(self, model_input: str) -> str | list: method format_input_chat (line 51) | def format_input_chat(self, model_input: Chat) -> list: method format_output_type (line 64) | def format_output_type(self, output_type: Optional[Any] = None) -> dict: class VLLMOffline (line 99) | class VLLMOffline(Model): method __init__ (line 107) | def __init__(self, model: "LLM"): method _build_generation_args (line 120) | def _build_generation_args( method generate (line 142) | def generate( method generate_batch (line 193) | def generate_batch( method generate_stream (line 240) | def generate_stream(self, model_input, output_type, **inference_kwargs): method _check_chat_template (line 250) | def _check_chat_template(self) -> bool: function from_vllm_offline (line 273) | def from_vllm_offline(model: "LLM") -> VLLMOffline: FILE: outlines/processors/base_logits_processor.py class OutlinesLogitsProcessor (line 14) | class OutlinesLogitsProcessor: method __init__ (line 25) | def __init__(self, tensor_library_name: str): method reset (line 48) | def reset(self): method process_logits (line 58) | def process_logits( method __call__ (line 85) | def __call__( FILE: outlines/processors/tensor_adapters/base.py class TensorAdapter (line 12) | class TensorAdapter(ABC): method shape (line 29) | def shape(self, tensor: TensorType) -> list[int]: method unsqueeze (line 47) | def unsqueeze(self, tensor: TensorType) -> TensorType: method squeeze (line 64) | def squeeze(self, tensor: TensorType) -> TensorType: method to_list (line 81) | def to_list(self, tensor: TensorType) -> list: method to_scalar (line 98) | def to_scalar(self, tensor: TensorType) -> Any: method full_like (line 115) | def full_like(self, tensor: "torch.Tensor", fill_value: Any) -> Tensor... method concatenate (line 139) | def concatenate( method get_device (line 161) | def get_device(self, tensor: TensorType) -> str: method to_device (line 178) | def to_device(self, tensor: TensorType, device: str) -> TensorType: method boolean_ones_like (line 197) | def boolean_ones_like(self, tensor: TensorType) -> TensorType: method apply_mask (line 215) | def apply_mask( method argsort_descending (line 239) | def argsort_descending( FILE: outlines/processors/tensor_adapters/mlx.py class MLXTensorAdapter (line 6) | class MLXTensorAdapter(TensorAdapter): method __init__ (line 9) | def __init__(self): method shape (line 14) | def shape(self, tensor): method unsqueeze (line 17) | def unsqueeze(self, tensor): method squeeze (line 20) | def squeeze(self, tensor): method to_list (line 25) | def to_list(self, tensor): method to_scalar (line 28) | def to_scalar(self, tensor): method full_like (line 31) | def full_like(self, tensor, fill_value): method concatenate (line 35) | def concatenate(self, tensors): method get_device (line 45) | def get_device(self, tensor): method to_device (line 48) | def to_device(self, tensor, device): method boolean_ones_like (line 51) | def boolean_ones_like(self, tensor): method apply_mask (line 54) | def apply_mask(self, tensor, mask, value): method argsort_descending (line 59) | def argsort_descending(self, tensor): FILE: outlines/processors/tensor_adapters/numpy.py class NumpyTensorAdapter (line 6) | class NumpyTensorAdapter(TensorAdapter): method __init__ (line 9) | def __init__(self): method shape (line 14) | def shape(self, tensor): method unsqueeze (line 17) | def unsqueeze(self, tensor): method squeeze (line 20) | def squeeze(self, tensor): method to_list (line 23) | def to_list(self, tensor): method to_scalar (line 26) | def to_scalar(self, tensor): method full_like (line 29) | def full_like(self, tensor, fill_value): method concatenate (line 32) | def concatenate(self, tensors): method get_device (line 35) | def get_device(self, tensor): method to_device (line 38) | def to_device(self, tensor, device): method boolean_ones_like (line 41) | def boolean_ones_like(self, tensor): method apply_mask (line 44) | def apply_mask(self, tensor, mask, value): method argsort_descending (line 49) | def argsort_descending(self, tensor): FILE: outlines/processors/tensor_adapters/torch.py class TorchTensorAdapter (line 6) | class TorchTensorAdapter(TensorAdapter): method __init__ (line 9) | def __init__(self): method shape (line 14) | def shape(self, tensor): method unsqueeze (line 17) | def unsqueeze(self, tensor): method squeeze (line 20) | def squeeze(self, tensor): method to_list (line 23) | def to_list(self, tensor): method to_scalar (line 26) | def to_scalar(self, tensor): method full_like (line 29) | def full_like(self, tensor, fill_value): method concatenate (line 32) | def concatenate(self, tensors): method get_device (line 35) | def get_device(self, tensor): method to_device (line 38) | def to_device(self, tensor, device): method boolean_ones_like (line 41) | def boolean_ones_like(self, tensor): method apply_mask (line 44) | def apply_mask(self, tensor, mask, value): method argsort_descending (line 47) | def argsort_descending(self, tensor): FILE: outlines/templates.py function Vision (line 21) | def Vision(prompt: str, image: PILImage.Image) -> list: class Template (line 59) | class Template: method __call__ (line 68) | def __call__(self, *args, **kwargs) -> str: method from_string (line 80) | def from_string(cls, content: str, filters: Dict[str, Callable] = {}): method from_file (line 98) | def from_file(cls, path: Path, filters: Dict[str, Callable] = {}): function build_template_from_string (line 125) | def build_template_from_string( function build_template_from_file (line 147) | def build_template_from_file( function create_jinja_env (line 156) | def create_jinja_env( function get_fn_name (line 203) | def get_fn_name(fn: Callable): function get_fn_args (line 216) | def get_fn_args(fn: Callable): function get_fn_description (line 228) | def get_fn_description(fn: Callable): function get_fn_source (line 242) | def get_fn_source(fn: Callable): function get_fn_signature (line 257) | def get_fn_signature(fn: Callable): function get_schema (line 273) | def get_schema(model: Any): function get_schema_dict (line 280) | def get_schema_dict(model: Dict): function get_schema_pydantic (line 286) | def get_schema_pydantic(model: Type[BaseModel]): function parse_pydantic_schema (line 301) | def parse_pydantic_schema(raw_schema, definitions): FILE: outlines/types/__init__.py class AirportImportError (line 26) | class AirportImportError: method __getattr__ (line 28) | def __getattr__(self, name): class CountryImportError (line 39) | class CountryImportError: method __getattr__ (line 41) | def __getattr__(self, name): FILE: outlines/types/countries.py function get_country_flags (line 8) | def get_country_flags(): FILE: outlines/types/dsl.py class Term (line 82) | class Term: method __add__ (line 104) | def __add__(self: "Term", other: "Term") -> "Sequence": method __radd__ (line 110) | def __radd__(self: "Term", other: "Term") -> "Sequence": method __or__ (line 116) | def __or__(self: "Term", other: "Term") -> "Alternatives": method __ror__ (line 122) | def __ror__(self: "Term", other: "Term") -> "Alternatives": method __get_validator__ (line 128) | def __get_validator__(self, _core_schema): method __get_pydantic_core_schema__ (line 134) | def __get_pydantic_core_schema__( method __get_pydantic_json_schema__ (line 139) | def __get_pydantic_json_schema__( method validate (line 144) | def validate(self, value: str) -> str: method matches (line 153) | def matches(self, value: str) -> bool: method display_ascii_tree (line 166) | def display_ascii_tree(self, indent="", is_last=True) -> str: method _display_node (line 178) | def _display_node(self): method _display_children (line 181) | def _display_children(self, indent: str) -> str: method __str__ (line 185) | def __str__(self): method optional (line 188) | def optional(self) -> "Optional": method exactly (line 191) | def exactly(self, count: int) -> "QuantifyExact": method at_least (line 194) | def at_least(self, count: int) -> "QuantifyMinimum": method at_most (line 197) | def at_most(self, count: int) -> "QuantifyMaximum": method between (line 200) | def between(self, min_count: int, max_count: int) -> "QuantifyBetween": method one_or_more (line 203) | def one_or_more(self) -> "KleenePlus": method zero_or_more (line 206) | def zero_or_more(self) -> "KleeneStar": class String (line 211) | class String(Term): method _display_node (line 214) | def _display_node(self) -> str: method __repr__ (line 217) | def __repr__(self): class Regex (line 222) | class Regex(Term): method _display_node (line 233) | def _display_node(self) -> str: method __repr__ (line 236) | def __repr__(self): class CFG (line 241) | class CFG(Term): method _display_node (line 252) | def _display_node(self) -> str: method __repr__ (line 255) | def __repr__(self): method __eq__ (line 258) | def __eq__(self, other): method from_file (line 264) | def from_file(cls, path: str) -> "CFG": class JsonSchema (line 282) | class JsonSchema(Term): method __init__ (line 293) | def __init__( method is_json_schema (line 339) | def is_json_schema(cls, obj: Any) -> bool: method convert_to (line 362) | def convert_to( method _display_node (line 441) | def _display_node(self) -> str: method __repr__ (line 444) | def __repr__(self): method __eq__ (line 447) | def __eq__(self, other): method from_file (line 458) | def from_file(cls, path: str) -> "JsonSchema": class Choice (line 478) | class Choice(Term): method _display_node (line 489) | def _display_node(self) -> str: method __repr__ (line 492) | def __repr__(self): class KleeneStar (line 497) | class KleeneStar(Term): method _display_node (line 500) | def _display_node(self) -> str: method _display_children (line 503) | def _display_children(self, indent: str) -> str: method __repr__ (line 506) | def __repr__(self): class KleenePlus (line 511) | class KleenePlus(Term): method _display_node (line 514) | def _display_node(self) -> str: method _display_children (line 517) | def _display_children(self, indent: str) -> str: method __repr__ (line 520) | def __repr__(self): class Optional (line 525) | class Optional(Term): method _display_node (line 528) | def _display_node(self) -> str: method _display_children (line 531) | def _display_children(self, indent: str) -> str: method __repr__ (line 534) | def __repr__(self): class Alternatives (line 539) | class Alternatives(Term): method _display_node (line 542) | def _display_node(self) -> str: method _display_children (line 545) | def _display_children(self, indent: str) -> str: method __repr__ (line 551) | def __repr__(self): class Sequence (line 556) | class Sequence(Term): method _display_node (line 559) | def _display_node(self) -> str: method _display_children (line 562) | def _display_children(self, indent: str) -> str: method __repr__ (line 568) | def __repr__(self): class QuantifyExact (line 573) | class QuantifyExact(Term): method _display_node (line 577) | def _display_node(self) -> str: method _display_children (line 580) | def _display_children(self, indent: str) -> str: method __repr__ (line 583) | def __repr__(self): class QuantifyMinimum (line 588) | class QuantifyMinimum(Term): method _display_node (line 592) | def _display_node(self) -> str: method _display_children (line 595) | def _display_children(self, indent: str) -> str: method __repr__ (line 598) | def __repr__(self): class QuantifyMaximum (line 605) | class QuantifyMaximum(Term): method _display_node (line 609) | def _display_node(self) -> str: method _display_children (line 612) | def _display_children(self, indent: str) -> str: method __repr__ (line 615) | def __repr__(self): class QuantifyBetween (line 622) | class QuantifyBetween(Term): method __post_init__ (line 627) | def __post_init__(self): method _display_node (line 633) | def _display_node(self) -> str: method _display_children (line 636) | def _display_children(self, indent: str) -> str: method __repr__ (line 639) | def __repr__(self): function regex (line 643) | def regex(pattern: str): function cfg (line 647) | def cfg(definition: str): function json_schema (line 651) | def json_schema(schema: Union[str, dict, type[BaseModel]]): function either (line 655) | def either(*terms: Union[str, Term]): function optional (line 666) | def optional(term: Union[Term, str]) -> Optional: function exactly (line 671) | def exactly(count: int, term: Union[Term, str]) -> QuantifyExact: function at_least (line 677) | def at_least(count: int, term: Union[Term, str]) -> QuantifyMinimum: function at_most (line 683) | def at_most(count: int, term: Union[Term, str]) -> QuantifyMaximum: function between (line 689) | def between(min_count: int, max_count: int, term: Union[Term, str]) -> Q... function zero_or_more (line 694) | def zero_or_more(term: Union[Term, str]) -> KleeneStar: function one_or_more (line 699) | def one_or_more(term: Union[Term, str]) -> KleenePlus: function python_types_to_terms (line 704) | def python_types_to_terms(ptype: Any, recursion_depth: int = 0) -> Term: function _get_enum_members (line 798) | def _get_enum_members(ptype: EnumMeta) -> List[Any]: function _handle_literal (line 811) | def _handle_literal(args: tuple) -> Alternatives: function _ensure_json_quoted (line 815) | def _ensure_json_quoted(term: Term) -> Term: function _handle_union (line 831) | def _handle_union(args: tuple, recursion_depth: int) -> Alternatives: function _handle_list (line 846) | def _handle_list(args: tuple, recursion_depth: int) -> Sequence: function _handle_tuple (line 863) | def _handle_tuple(args: tuple, recursion_depth: int) -> Union[Sequence, ... function _handle_dict (line 887) | def _handle_dict(args: tuple, recursion_depth: int) -> Sequence: function to_regex (line 913) | def to_regex(term: Term) -> str: FILE: outlines/types/json_schema_utils.py function schema_type_to_python (line 15) | def schema_type_to_python( function json_schema_dict_to_typeddict (line 67) | def json_schema_dict_to_typeddict( function json_schema_dict_to_pydantic (line 100) | def json_schema_dict_to_pydantic( function json_schema_dict_to_dataclass (line 134) | def json_schema_dict_to_dataclass( FILE: outlines/types/utils.py function is_int (line 35) | def is_int(value: Any) -> bool: function is_int_instance (line 44) | def is_int_instance(value: Any) -> bool: function is_float (line 48) | def is_float(value: Any) -> bool: function is_float_instance (line 57) | def is_float_instance(value: Any) -> bool: function is_str (line 61) | def is_str(value: Any) -> bool: function is_str_instance (line 70) | def is_str_instance(value: Any) -> bool: function is_bool (line 74) | def is_bool(value: Any) -> bool: function is_dict_instance (line 83) | def is_dict_instance(value: Any) -> bool: function is_datetime (line 87) | def is_datetime(value: Any) -> bool: function is_date (line 91) | def is_date(value: Any) -> bool: function is_time (line 95) | def is_time(value: Any) -> bool: function is_native_dict (line 99) | def is_native_dict(value: Any) -> bool: function is_typing_dict (line 103) | def is_typing_dict(value: Any) -> bool: function is_typing_list (line 107) | def is_typing_list(value: Any) -> bool: function is_typing_tuple (line 111) | def is_typing_tuple(value: Any) -> bool: function is_union (line 115) | def is_union(value: Any) -> bool: function is_literal (line 119) | def is_literal(value: Any) -> bool: function is_dataclass (line 123) | def is_dataclass(value: Any) -> bool: function is_typed_dict (line 127) | def is_typed_dict(value: Any) -> bool: function is_pydantic_model (line 131) | def is_pydantic_model(value): function is_genson_schema_builder (line 139) | def is_genson_schema_builder(value: Any) -> bool: function is_enum (line 143) | def is_enum(value: Any) -> bool: function is_callable (line 147) | def is_callable(value: Any) -> bool: function get_enum_from_literal (line 154) | def get_enum_from_literal(value) -> Enum: function get_enum_from_choice (line 161) | def get_enum_from_choice(value) -> Enum: function get_schema_from_signature (line 168) | def get_schema_from_signature(fn: Callable) -> dict: function get_schema_from_enum (line 196) | def get_schema_from_enum(myenum: type[Enum]) -> dict: FILE: tests/backends/test_backends.py function model (line 23) | def model(): function json_schema (line 30) | def json_schema(): function regex (line 38) | def regex(): function cfg_lark (line 42) | def cfg_lark(): function cfg_ebnf (line 65) | def cfg_ebnf(): function test_get_backend (line 72) | def test_get_backend(model): function test_get_json_schema_logits_processor (line 86) | def test_get_json_schema_logits_processor(model, json_schema): function test_get_regex_logits_processor (line 97) | def test_get_regex_logits_processor(model, regex): function test_get_cfg_logits_processor (line 108) | def test_get_cfg_logits_processor(model, cfg_lark, cfg_ebnf): FILE: tests/backends/test_backends_utils.py function simulate_model_calling_processor (line 5) | def simulate_model_calling_processor(processor, tensor_library_name, voc... class TorchTensorAdapter (line 29) | class TorchTensorAdapter(): method randn (line 30) | def randn(self, shape): method randint (line 33) | def randint(self, low, high, size): method add_token_inputs_ids (line 36) | def add_token_inputs_ids(self, input_ids, logits): class NumpyTensorAdapter (line 42) | class NumpyTensorAdapter(): method randn (line 43) | def randn(self, shape): method randint (line 46) | def randint(self, low, high, size): method add_token_inputs_ids (line 49) | def add_token_inputs_ids(self, input_ids, logits): class MLXTensorAdapter (line 56) | class MLXTensorAdapter(): method __init__ (line 57) | def __init__(self): method randn (line 61) | def randn(self, shape): method randint (line 64) | def randint(self, low, high, size): method add_token_inputs_ids (line 67) | def add_token_inputs_ids(self, input_ids, logits): FILE: tests/backends/test_llguidance.py function model_transformers (line 23) | def model_transformers(): function model_llamacpp (line 29) | def model_llamacpp(): function model_mlxlm (line 38) | def model_mlxlm(): function json_schema (line 44) | def json_schema(): function regex (line 52) | def regex(): function cfg_lark (line 56) | def cfg_lark(): function cfg_ebnf (line 79) | def cfg_ebnf(): function test_llguidance_processor_torch (line 86) | def test_llguidance_processor_torch(regex): function test_llguidance_processor_numpy (line 105) | def test_llguidance_processor_numpy(regex): function test_llguidance_processor_mlx (line 125) | def test_llguidance_processor_mlx(regex): function test_llguidance_backend (line 151) | def test_llguidance_backend(model, tensor_library_name, json_schema, reg... FILE: tests/backends/test_outlines_core.py function model_transformers (line 23) | def model_transformers(): function model_llamacpp (line 30) | def model_llamacpp(): function model_mlxlm (line 40) | def model_mlxlm(): function json_schema (line 45) | def json_schema(): function regex (line 54) | def regex(): function cfg (line 59) | def cfg(): function test_outlines_core_processor_torch (line 82) | def test_outlines_core_processor_torch(regex): function test_outlines_core_processor_numpy (line 97) | def test_outlines_core_processor_numpy(regex): function test_outlines_core_processor_mlx (line 112) | def test_outlines_core_processor_mlx(): function test_create_vocabulary_preserves_duplicate_token_ids (line 126) | def test_create_vocabulary_preserves_duplicate_token_ids(): function test_outlines_core_backend (line 159) | def test_outlines_core_backend(model, tensor_library_name, json_schema, ... FILE: tests/backends/test_xgrammar.py function model_transformers (line 19) | def model_transformers(): function model_llamacpp (line 25) | def model_llamacpp(): function model_mlxlm (line 34) | def model_mlxlm(): function tokenizer_info (line 40) | def tokenizer_info(): function json_schema (line 49) | def json_schema(): function regex (line 57) | def regex(): function cfg (line 61) | def cfg(): function test_xgr_processor_torch (line 68) | def test_xgr_processor_torch(regex): function test_xgr_processor_mlx (line 92) | def test_xgr_processor_mlx(tokenizer_info): function test_xgrammar_backend (line 119) | def test_xgrammar_backend(model, tensor_library_name, json_schema, regex... function test_xgrammar_backend_invalid_model (line 163) | def test_xgrammar_backend_invalid_model(): FILE: tests/conftest.py function pytest_collection_modifyitems (line 6) | def pytest_collection_modifyitems(config, items): FILE: tests/models/test_anthopic_type_adapter.py function image (line 11) | def image(): function adapter (line 26) | def adapter(): function test_anthropic_type_adapter_input_text (line 30) | def test_anthropic_type_adapter_input_text(adapter): function test_anthropic_type_adapter_input_vision (line 36) | def test_anthropic_type_adapter_input_vision(adapter, image): function test_anthropic_type_adapter_input_chat (line 60) | def test_anthropic_type_adapter_input_chat(adapter, image): function test_anthropic_type_adapter_input_invalid (line 90) | def test_anthropic_type_adapter_input_invalid(adapter): function test_anthropic_type_adapter_output (line 113) | def test_anthropic_type_adapter_output(adapter): FILE: tests/models/test_anthropic.py function model (line 17) | def model(): function model_no_model_name (line 22) | def model_no_model_name(): function image (line 27) | def image(): function test_init_from_client (line 41) | def test_init_from_client(): function test_anthropic_wrong_inference_parameters (line 57) | def test_anthropic_wrong_inference_parameters(): function test_anthropic_wrong_input_type (line 63) | def test_anthropic_wrong_input_type(image): function test_anthropic_wrong_output_type (line 76) | def test_anthropic_wrong_output_type(): function test_anthropic_simple_call (line 87) | def test_anthropic_simple_call(model): function test_anthropic_direct_call (line 94) | def test_anthropic_direct_call(model_no_model_name): function test_anthropic_simple_vision (line 104) | def test_anthropic_simple_vision(model, image): function test_anthropic_chat (line 116) | def test_anthropic_chat(model, image): function test_anthopic_streaming (line 128) | def test_anthopic_streaming(model): function test_anthropic_batch (line 134) | def test_anthropic_batch(model): FILE: tests/models/test_dottxt.py class User (line 17) | class User(BaseModel): function api_key (line 24) | def api_key(): function model_name_and_revision (line 39) | def model_name_and_revision(api_key): function model (line 46) | def model(api_key, model_name_and_revision): function model_no_model_name (line 56) | def model_no_model_name(api_key): function test_dottxt_init_from_client (line 62) | def test_dottxt_init_from_client(api_key, model_name_and_revision): function test_dottxt_wrong_output_type (line 83) | def test_dottxt_wrong_output_type(model_no_model_name): function test_dottxt_wrong_input_type (line 88) | def test_dottxt_wrong_input_type(model_no_model_name): function test_dottxt_wrong_inference_parameters (line 94) | def test_dottxt_wrong_inference_parameters(model_no_model_name): function test_dottxt_direct_pydantic_call (line 100) | def test_dottxt_direct_pydantic_call(model_no_model_name): function test_dottxt_direct_jsonschema_call (line 106) | def test_dottxt_direct_jsonschema_call( function test_dottxt_generator_pydantic_call (line 119) | def test_dottxt_generator_pydantic_call(model): function test_dottxt_streaming (line 126) | def test_dottxt_streaming(model): function test_dottxt_batch (line 135) | def test_dottxt_batch(model): FILE: tests/models/test_dottxt_type_adapter.py function schema (line 22) | def schema(): function image (line 35) | def image(): function adapter (line 50) | def adapter(): function test_dottxt_type_adapter_input_text (line 54) | def test_dottxt_type_adapter_input_text(adapter): function test_dottxt_type_adapter_input_invalid (line 60) | def test_dottxt_type_adapter_input_invalid(adapter, image): function test_dottxt_type_adapter_output_invalid (line 66) | def test_dottxt_type_adapter_output_invalid(adapter): function test_dottxt_type_adapter_output_dataclass (line 83) | def test_dottxt_type_adapter_output_dataclass(adapter, schema): function test_dottxt_type_adapter_output_typed_dict (line 93) | def test_dottxt_type_adapter_output_typed_dict(adapter, schema): function test_dottxt_type_adapter_output_pydantic (line 102) | def test_dottxt_type_adapter_output_pydantic(adapter, schema): function test_dottxt_type_adapter_output_genson_schema_builder (line 111) | def test_dottxt_type_adapter_output_genson_schema_builder(adapter, schema): function test_dottxt_type_adapter_json_schema_str (line 129) | def test_dottxt_type_adapter_json_schema_str(adapter, schema): function test_dottxt_type_adapter_json_schema_dict (line 135) | def test_dottxt_type_adapter_json_schema_dict(adapter, schema): FILE: tests/models/test_gemini.py function model (line 27) | def model(): function model_no_model_name (line 32) | def model_no_model_name(): function image (line 37) | def image(): function test_gemini_init_from_client (line 52) | def test_gemini_init_from_client(): function test_gemini_wrong_inference_parameters (line 69) | def test_gemini_wrong_inference_parameters(model): function test_gemini_wrong_input_type (line 75) | def test_gemini_wrong_input_type(model, image): function test_gemini_simple_call (line 81) | def test_gemini_simple_call(model): function test_gemini_direct_call (line 87) | def test_gemini_direct_call(model_no_model_name): function test_gemini_simple_vision (line 96) | def test_gemini_simple_vision(model, image): function test_gemini_chat (line 102) | def test_gemini_chat(model, image): function test_gemini_simple_pydantic (line 114) | def test_gemini_simple_pydantic(model): function test_gemini_simple_vision_pydantic (line 124) | def test_gemini_simple_vision_pydantic(model, image): function test_gemini_nested_pydantic (line 134) | def test_gemini_nested_pydantic(model): function test_gemini_simple_json_schema_string (line 153) | def test_gemini_simple_json_schema_string(model): function test_gemini_simple_json_schema_dict (line 164) | def test_gemini_simple_json_schema_dict(model): function test_gemini_simple_typed_dict (line 176) | def test_gemini_simple_typed_dict(model): function test_gemini_simple_dataclass (line 186) | def test_gemini_simple_dataclass(model): function test_gemini_simple_choice_enum (line 197) | def test_gemini_simple_choice_enum(model): function test_gemini_simple_choice_choice (line 208) | def test_gemini_simple_choice_choice(model): function test_gemini_sample_choice_literal (line 215) | def test_gemini_sample_choice_literal(model): function test_gemini_simple_choice_list (line 225) | def test_gemini_simple_choice_list(model): function test_gemini_simple_list_pydantic (line 233) | def test_gemini_simple_list_pydantic(model): function test_gemini_streaming (line 244) | def test_gemini_streaming(model): function test_gemini_batch (line 251) | def test_gemini_batch(model): FILE: tests/models/test_gemini_type_adapter.py function schema (line 24) | def schema(): function image (line 37) | def image(): function adapter (line 52) | def adapter(): function test_gemini_type_adapter_input_text (line 56) | def test_gemini_type_adapter_input_text(adapter): function test_gemini_type_adapter_input_vision (line 62) | def test_gemini_type_adapter_input_vision(adapter, image): function test_gemini_type_adapter_input_chat (line 84) | def test_gemini_type_adapter_input_chat(adapter, image): function test_gemini_type_adapter_input_invalid (line 113) | def test_gemini_type_adapter_input_invalid(adapter): function test_gemini_type_adapter_output_invalid (line 125) | def test_gemini_type_adapter_output_invalid(adapter): function test_gemini_type_adapter_output_none (line 139) | def test_gemini_type_adapter_output_none(adapter): function test_gemini_type_adapter_output_json_schema (line 144) | def test_gemini_type_adapter_output_json_schema(adapter, schema): function test_gemini_type_adapter_output_list_json_schema (line 151) | def test_gemini_type_adapter_output_list_json_schema(adapter, schema): function test_gemini_type_adapter_output_dataclass (line 160) | def test_gemini_type_adapter_output_dataclass(adapter): function test_gemini_type_adapter_output_list_dataclass (line 173) | def test_gemini_type_adapter_output_list_dataclass(adapter): function test_gemini_type_adapter_output_typed_dict (line 185) | def test_gemini_type_adapter_output_typed_dict(adapter): function test_gemini_type_adapter_output_list_typed_dict (line 197) | def test_gemini_type_adapter_output_list_typed_dict(adapter): function test_gemini_type_adapter_output_pydantic (line 209) | def test_gemini_type_adapter_output_pydantic(adapter): function test_gemini_type_adapter_output_list_pydantic (line 221) | def test_gemini_type_adapter_output_list_pydantic(adapter): function test_gemini_type_adapter_output_genson_schema_builder (line 233) | def test_gemini_type_adapter_output_genson_schema_builder(adapter): function test_gemini_type_adapter_output_list_genson_schema_builder (line 242) | def test_gemini_type_adapter_output_list_genson_schema_builder(adapter): function test_gemini_type_adapter_output_enum (line 253) | def test_gemini_type_adapter_output_enum(adapter): function test_gemini_type_adapter_output_literal (line 265) | def test_gemini_type_adapter_output_literal(adapter): FILE: tests/models/test_llamacpp.py function test_load_model (line 18) | def test_load_model(): function model (line 35) | def model(tmp_path_factory): function model_no_chat (line 45) | def model_no_chat(tmp_path_factory): function lark_grammar (line 55) | def lark_grammar(): function ebnf_grammar (line 78) | def ebnf_grammar(): function test_llamacpp_simple (line 85) | def test_llamacpp_simple(model): function test_llamacpp_chat (line 90) | def test_llamacpp_chat(model): function test_llamacpp_regex (line 103) | def test_llamacpp_regex(model): function test_llamacpp_json (line 110) | def test_llamacpp_json(model): function test_llamacpp_choice (line 119) | def test_llamacpp_choice(model): function test_llamacpp_cfg (line 128) | def test_llamacpp_cfg(model, ebnf_grammar): function test_llamacpp_cfg_outlines_core (line 133) | def test_llamacpp_cfg_outlines_core(model, lark_grammar): function test_llamacpp_text_stop (line 145) | def test_llamacpp_text_stop(model): function test_llamacpp_stream_simple (line 150) | def test_llamacpp_stream_simple(model): function test_llamacpp_stream_chat (line 157) | def test_llamacpp_stream_chat(model): function test_llamacpp_stream_regex (line 171) | def test_llamacpp_stream_regex(model): function test_llamacpp_stream_json (line 178) | def test_llamacpp_stream_json(model): function test_llamacpp_stream_cfg (line 190) | def test_llamacpp_stream_cfg(model, ebnf_grammar): function test_llamacpp_stream_cfg_outlines_core (line 199) | def test_llamacpp_stream_cfg_outlines_core(model, lark_grammar): function test_llamacpp_stream_choice (line 212) | def test_llamacpp_stream_choice(model): function test_llamacpp_stream_text_stop (line 223) | def test_llamacpp_stream_text_stop(model): function test_llamacpp_batch (line 231) | def test_llamacpp_batch(model): function test_llamacpp_no_chat (line 237) | def test_llamacpp_no_chat(model_no_chat): FILE: tests/models/test_llamacpp_tokenizer.py function model (line 14) | def model(): function model_no_hf_tokenizer (line 29) | def model_no_hf_tokenizer(): function different_model (line 40) | def different_model(): function tokenizer (line 49) | def tokenizer(model): function another_tokenizer (line 54) | def another_tokenizer(model): function tokenizer_no_hf_tokenizer (line 59) | def tokenizer_no_hf_tokenizer(model_no_hf_tokenizer): function different_tokenizer (line 64) | def different_tokenizer(different_model): function test_llama_cpp_tokenizer_init (line 68) | def test_llama_cpp_tokenizer_init(tokenizer, tokenizer_no_hf_tokenizer): function test_llama_cpp_tokenizer_encode (line 80) | def test_llama_cpp_tokenizer_encode(tokenizer): function test_llama_cpp_tokenizer_decode (line 92) | def test_llama_cpp_tokenizer_decode(tokenizer): function test_llama_cpp_tokenizer_convert_token_to_string (line 99) | def test_llama_cpp_tokenizer_convert_token_to_string( function test_llama_cpp_tokenizer_eq (line 112) | def test_llama_cpp_tokenizer_eq(tokenizer, another_tokenizer, different_... function test_llama_cpp_tokenizer_hash (line 118) | def test_llama_cpp_tokenizer_hash(tokenizer, another_tokenizer, differen... function test_llama_cpp_tokenizer_getstate (line 124) | def test_llama_cpp_tokenizer_getstate(tokenizer): function test_llama_cpp_tokenizer_setstate (line 135) | def test_llama_cpp_tokenizer_setstate(tokenizer): function _make_mock_model (line 140) | def _make_mock_model(n_vocab, eos_id, pieces): function test_vocab_truncation_retry_path (line 161) | def test_vocab_truncation_retry_path(): function test_attention_mask_all_ones_even_with_eos (line 207) | def test_attention_mask_all_ones_even_with_eos(): function test_negative_n_skips_invalid_token (line 243) | def test_negative_n_skips_invalid_token(): FILE: tests/models/test_llamacpp_type_adapter.py function adapter (line 14) | def adapter(): function logits_processor (line 19) | def logits_processor(): function image (line 26) | def image(): function test_llamacpp_type_adapter_format_input (line 40) | def test_llamacpp_type_adapter_format_input(adapter, image): function test_llamacpp_type_adapter_format_input_with_chat_template (line 65) | def test_llamacpp_type_adapter_format_input_with_chat_template(): function test_llamacpp_type_adapter_format_input_without_chat_template (line 73) | def test_llamacpp_type_adapter_format_input_without_chat_template(): function test_llamacpp_type_adapter_format_output_type (line 81) | def test_llamacpp_type_adapter_format_output_type(adapter, logits_proces... FILE: tests/models/test_lmstudio.py class Foo (line 51) | class Foo(BaseModel): function model (line 109) | def model(): function model_no_model_name (line 114) | def model_no_model_name(): function async_model (line 119) | def async_model(): function async_model_no_model_name (line 128) | def async_model_no_model_name(): function test_lmstudio_init_from_client (line 136) | def test_lmstudio_init_from_client(): function test_lmstudio_simple (line 169) | def test_lmstudio_simple(model): function test_lmstudio_direct (line 174) | def test_lmstudio_direct(model_no_model_name): function test_lmstudio_simple_vision (line 184) | def test_lmstudio_simple_vision(model): function test_lmstudio_chat (line 193) | def test_lmstudio_chat(model): function test_lmstudio_json (line 209) | def test_lmstudio_json(model): function test_lmstudio_wrong_output_type (line 215) | def test_lmstudio_wrong_output_type(model): function test_lmstudio_wrong_input_type (line 224) | def test_lmstudio_wrong_input_type(model): function test_lmstudio_stream (line 232) | def test_lmstudio_stream(model): function test_lmstudio_stream_json (line 238) | def test_lmstudio_stream_json(model_no_model_name): function test_lmstudio_batch (line 246) | def test_lmstudio_batch(model): function test_lmstudio_async_init_from_client (line 251) | def test_lmstudio_async_init_from_client(): function test_lmstudio_async_simple (line 281) | async def test_lmstudio_async_simple(async_model): function test_lmstudio_async_direct (line 287) | async def test_lmstudio_async_direct(async_model_no_model_name): function test_lmstudio_async_simple_vision (line 298) | async def test_lmstudio_async_simple_vision(async_model): function test_lmstudio_async_chat (line 308) | async def test_lmstudio_async_chat(async_model): function test_lmstudio_async_json (line 325) | async def test_lmstudio_async_json(async_model): function test_lmstudio_async_wrong_output_type (line 332) | async def test_lmstudio_async_wrong_output_type(async_model): function test_lmstudio_async_wrong_input_type (line 342) | async def test_lmstudio_async_wrong_input_type(async_model): function test_lmstudio_async_stream (line 351) | async def test_lmstudio_async_stream(async_model): function test_lmstudio_async_stream_json (line 358) | async def test_lmstudio_async_stream_json(async_model_no_model_name): function test_lmstudio_async_batch (line 367) | async def test_lmstudio_async_batch(async_model): FILE: tests/models/test_lmstudio_type_adapter.py function schema (line 33) | def schema(): function adapter (line 46) | def adapter(): function image (line 51) | def image(): function test_lmstudio_type_adapter_input_text (line 65) | def test_lmstudio_type_adapter_input_text(adapter): function test_lmstudio_type_adapter_input_vision (line 73) | def test_lmstudio_type_adapter_input_vision(adapter, image): function test_lmstudio_type_adapter_input_chat (line 82) | def test_lmstudio_type_adapter_input_chat(adapter): function test_lmstudio_type_adapter_input_chat_no_system (line 96) | def test_lmstudio_type_adapter_input_chat_no_system(adapter): function test_lmstudio_type_adapter_input_chat_with_image (line 108) | def test_lmstudio_type_adapter_input_chat_with_image(adapter, image): function test_lmstudio_type_adapter_input_invalid (line 124) | def test_lmstudio_type_adapter_input_invalid(adapter): function test_lmstudio_type_adapter_input_chat_invalid_content (line 130) | def test_lmstudio_type_adapter_input_chat_invalid_content(adapter): function test_lmstudio_type_adapter_input_chat_invalid_role (line 138) | def test_lmstudio_type_adapter_input_chat_invalid_role(adapter): function test_lmstudio_type_adapter_output_none (line 146) | def test_lmstudio_type_adapter_output_none(adapter): function test_lmstudio_type_adapter_output_invalid (line 151) | def test_lmstudio_type_adapter_output_invalid(adapter): function test_lmstudio_type_adapter_output_dataclass (line 165) | def test_lmstudio_type_adapter_output_dataclass(adapter, schema): function test_lmstudio_type_adapter_output_typed_dict (line 175) | def test_lmstudio_type_adapter_output_typed_dict(adapter, schema): function test_lmstudio_type_adapter_output_pydantic (line 184) | def test_lmstudio_type_adapter_output_pydantic(adapter, schema): function test_lmstudio_type_adapter_output_genson_schema_builder (line 193) | def test_lmstudio_type_adapter_output_genson_schema_builder(adapter): function test_lmstudio_type_adapter_json_schema_str (line 208) | def test_lmstudio_type_adapter_json_schema_str(adapter, schema): function test_lmstudio_type_adapter_json_schema_dict (line 214) | def test_lmstudio_type_adapter_json_schema_dict(adapter, schema): FILE: tests/models/test_mistral.py function api_key (line 22) | def api_key(): function image (line 36) | def image(): function model (line 50) | def model(api_key): function vision_model (line 55) | def vision_model(api_key): function async_model (line 60) | def async_model(api_key): function async_vision_model (line 65) | def async_vision_model(api_key): function model_no_model_name (line 70) | def model_no_model_name(api_key): function async_model_no_model_name (line 75) | def async_model_no_model_name(api_key): function test_mistral_init_from_client (line 79) | def test_mistral_init_from_client(api_key): function test_mistral_wrong_inference_parameters (line 95) | def test_mistral_wrong_inference_parameters(model): function test_mistral_wrong_input_type (line 100) | def test_mistral_wrong_input_type(model): function test_mistral_wrong_output_type (line 105) | def test_mistral_wrong_output_type(model): function test_mistral_call (line 114) | def test_mistral_call(model): function test_mistral_call_model_name (line 120) | def test_mistral_call_model_name(model_no_model_name): function test_mistral_multiple_samples (line 129) | def test_mistral_multiple_samples(model): function test_mistral_vision (line 138) | def test_mistral_vision(image, vision_model): function test_mistral_chat (line 144) | def test_mistral_chat(image, vision_model): function test_mistral_pydantic (line 156) | def test_mistral_pydantic(model): function test_mistral_pydantic_refusal (line 166) | def test_mistral_pydantic_refusal(model): function test_mistral_vision_pydantic (line 175) | def test_mistral_vision_pydantic(vision_model, image): function test_mistral_json_schema (line 185) | def test_mistral_json_schema(model): function test_mistral_streaming (line 197) | def test_mistral_streaming(model): function test_mistral_batch (line 203) | def test_mistral_batch(model): function test_mistral_async_init_from_client (line 210) | def test_mistral_async_init_from_client(api_key): function test_mistral_async_wrong_inference_parameters (line 227) | async def test_mistral_async_wrong_inference_parameters(async_model): function test_mistral_async_wrong_input_type (line 233) | async def test_mistral_async_wrong_input_type(async_model): function test_mistral_async_wrong_output_type (line 239) | async def test_mistral_async_wrong_output_type(async_model): function test_mistral_async_call (line 249) | async def test_mistral_async_call(async_model): function test_mistral_async_call_model_name (line 256) | async def test_mistral_async_call_model_name(async_model_no_model_name): function test_mistral_async_multiple_samples (line 266) | async def test_mistral_async_multiple_samples(async_model): function test_mistral_async_vision (line 276) | async def test_mistral_async_vision(async_vision_model, image): function test_mistral_async_chat (line 283) | async def test_mistral_async_chat(async_vision_model, image): function test_mistral_async_pydantic (line 296) | async def test_mistral_async_pydantic(async_model): function test_mistral_async_pydantic_refusal (line 307) | async def test_mistral_async_pydantic_refusal(async_model): function test_mistral_async_vision_pydantic (line 317) | async def test_mistral_async_vision_pydantic(async_vision_model, image): function test_mistral_async_json_schema (line 328) | async def test_mistral_async_json_schema(async_model): function test_mistral_async_streaming (line 341) | async def test_mistral_async_streaming(async_model): function test_mistral_async_batch (line 350) | async def test_mistral_async_batch(async_model): FILE: tests/models/test_mistral_type_adapter.py function schema (line 28) | def schema(): function image (line 41) | def image(): function adapter (line 55) | def adapter(): function test_mistral_type_adapter_input_text (line 59) | def test_mistral_type_adapter_input_text(adapter): function test_mistral_type_adapter_input_list (line 67) | def test_mistral_type_adapter_input_list(adapter, image): function test_mistral_type_adapter_input_chat (line 79) | def test_mistral_type_adapter_input_chat(adapter, image): function test_mistral_type_adapter_input_invalid (line 98) | def test_mistral_type_adapter_input_invalid(adapter, image): function test_mistral_type_adapter_output_none (line 131) | def test_mistral_type_adapter_output_none(adapter): function test_mistral_type_adapter_output_json_mode (line 136) | def test_mistral_type_adapter_output_json_mode(adapter): function test_mistral_type_adapter_dataclass (line 141) | def test_mistral_type_adapter_dataclass(adapter, schema): function test_mistral_type_adapter_typed_dict (line 153) | def test_mistral_type_adapter_typed_dict(adapter, schema): function test_mistral_type_adapter_pydantic (line 164) | def test_mistral_type_adapter_pydantic(adapter, schema): function test_mistral_type_adapter_genson_schema_builder (line 175) | def test_mistral_type_adapter_genson_schema_builder(adapter, schema): function test_mistral_type_adapter_json_schema_str (line 194) | def test_mistral_type_adapter_json_schema_str(adapter, schema): function test_mistral_type_adapter_output_unsupported (line 202) | def test_mistral_type_adapter_output_unsupported(adapter): FILE: tests/models/test_mlxlm.py function test_mlxlm_model_initialization (line 29) | def test_mlxlm_model_initialization(): function model (line 42) | def model(tmp_path_factory): function test_mlxlm_tokenizer (line 48) | def test_mlxlm_tokenizer(model): function test_mlxlm_simple (line 57) | def test_mlxlm_simple(model): function test_mlxlm_call (line 63) | def test_mlxlm_call(model): function test_mlxlm_invalid_input_type (line 69) | def test_mlxlm_invalid_input_type(model): function test_mlxlm_invalid_inference_kwargs (line 75) | def test_mlxlm_invalid_inference_kwargs(model): function test_mlxlm_inference_kwargs (line 81) | def test_mlxlm_inference_kwargs(model): function test_mlxlm_regex (line 88) | def test_mlxlm_regex(model): function test_mlxlm_json_schema (line 95) | def test_mlxlm_json_schema(model): function test_mlxlm_choice (line 104) | def test_mlxlm_choice(model): function test_mlxlm_stream_text_stop (line 114) | def test_mlxlm_stream_text_stop(model): function test_mlxlm_batch (line 123) | def test_mlxlm_batch(model): function test_mlxlm_batch_output_type (line 134) | def test_mlxlm_batch_output_type(model): FILE: tests/models/test_mlxlm_type_adapter.py function adapter (line 25) | def adapter(): function logits_processor (line 31) | def logits_processor(): function image (line 38) | def image(): function test_mlxlm_type_adapter_format_input_with_template (line 50) | def test_mlxlm_type_adapter_format_input_with_template(): function test_mlxlm_type_adapter_format_input_without_template (line 67) | def test_mlxlm_type_adapter_format_input_without_template(): function test_mlxlm_type_adapter_format_input (line 79) | def test_mlxlm_type_adapter_format_input(adapter, image): function test_mlxlm_type_adapter_format_output_type (line 109) | def test_mlxlm_type_adapter_format_output_type(adapter, logits_processor): FILE: tests/models/test_ollama.py function model (line 20) | def model(): function model_no_model_name (line 25) | def model_no_model_name(): function async_model (line 30) | def async_model(): function async_model_no_model_name (line 35) | def async_model_no_model_name(): function image (line 40) | def image(): function test_ollama_init_from_client (line 54) | def test_ollama_init_from_client(): function test_ollama_wrong_inference_parameters (line 74) | def test_ollama_wrong_inference_parameters(model): function test_ollama_simple (line 81) | def test_ollama_simple(model): function test_ollama_direct (line 88) | def test_ollama_direct(model_no_model_name): function test_ollama_simple_vision (line 97) | def test_ollama_simple_vision(image, model): function test_ollama_chat (line 107) | def test_ollama_chat(image, model): function test_ollama_json (line 123) | def test_ollama_json(model): function test_ollama_wrong_output_type (line 132) | def test_ollama_wrong_output_type(model): function test_ollama_wrong_input_type (line 141) | def test_ollama_wrong_input_type(model, image): function test_ollama_stream (line 149) | def test_ollama_stream(model): function test_ollama_stream_json (line 154) | def test_ollama_stream_json(model_no_model_name): function test_ollama_batch (line 165) | def test_ollama_batch(model): function test_ollama_async_init_from_client (line 172) | def test_ollama_async_init_from_client(): function test_ollama_async_wrong_inference_parameters (line 189) | async def test_ollama_async_wrong_inference_parameters(async_model): function test_ollama_async_simple (line 197) | async def test_ollama_async_simple(async_model): function test_ollama_async_direct (line 205) | async def test_ollama_async_direct(async_model_no_model_name): function test_ollama_async_simple_vision (line 215) | async def test_ollama_async_simple_vision(image, async_model): function test_ollama_async_chat (line 226) | async def test_ollama_async_chat(image, async_model): function test_ollama_async_json (line 243) | async def test_ollama_async_json(async_model): function test_ollama_async_wrong_output_type (line 253) | async def test_ollama_async_wrong_output_type(async_model): function test_ollama_async_wrong_input_type (line 263) | async def test_ollama_async_wrong_input_type(async_model): function test_ollama_async_stream (line 269) | async def test_ollama_async_stream(async_model): function test_ollama_async_stream_json (line 275) | async def test_ollama_async_stream_json(async_model_no_model_name): function test_ollama_async_batch (line 287) | async def test_ollama_async_batch(async_model): FILE: tests/models/test_ollama_type_adapter.py function schema (line 22) | def schema(): function image (line 35) | def image(): function adapter (line 50) | def adapter(): function test_ollama_type_adapter_input_text (line 54) | def test_ollama_type_adapter_input_text(adapter): function test_ollama_type_adapter_input_vision (line 62) | def test_ollama_type_adapter_input_vision(adapter, image): function test_ollama_type_adapter_input_chat (line 75) | def test_ollama_type_adapter_input_chat(adapter, image): function test_ollama_type_adapter_input_invalid (line 93) | def test_ollama_type_adapter_input_invalid(adapter): function test_ollama_type_adapter_output_invalid (line 105) | def test_ollama_type_adapter_output_invalid(adapter): function test_ollama_type_adapter_output_dataclass (line 119) | def test_ollama_type_adapter_output_dataclass(adapter, schema): function test_ollama_type_adapter_output_typed_dict (line 129) | def test_ollama_type_adapter_output_typed_dict(adapter, schema): function test_ollama_type_adapter_output_pydantic (line 138) | def test_ollama_type_adapter_output_pydantic(adapter, schema): function test_ollama_type_adapter_output_genson_schema_builder (line 147) | def test_ollama_type_adapter_output_genson_schema_builder(adapter): function test_ollama_type_adapter_json_schema_str (line 162) | def test_ollama_type_adapter_json_schema_str(adapter, schema): function test_ollama_type_adapter_json_schema_dict (line 168) | def test_ollama_type_adapter_json_schema_dict(adapter, schema): FILE: tests/models/test_openai.py function api_key (line 20) | def api_key(): function image (line 34) | def image(): function model (line 49) | def model(api_key): function async_model (line 54) | def async_model(api_key): function model_no_model_name (line 59) | def model_no_model_name(api_key): function async_model_no_model_name (line 64) | def async_model_no_model_name(api_key): function test_openai_init_from_client (line 68) | def test_openai_init_from_client(api_key): function test_openai_wrong_inference_parameters (line 84) | def test_openai_wrong_inference_parameters(model): function test_openai_wrong_input_type (line 89) | def test_openai_wrong_input_type(model, image): function test_openai_wrong_output_type (line 101) | def test_openai_wrong_output_type(model): function test_openai_simple_call (line 111) | def test_openai_simple_call(model): function test_openai_simple_call_multiple_samples (line 117) | def test_openai_simple_call_multiple_samples(model): function test_openai_direct_call (line 126) | def test_openai_direct_call(model_no_model_name): function test_openai_simple_vision (line 135) | def test_openai_simple_vision(image, model): function test_openai_chat (line 141) | def test_openai_chat(image, model): function test_openai_simple_pydantic (line 153) | def test_openai_simple_pydantic(model): function test_openai_simple_pydantic_refusal (line 163) | def test_openai_simple_pydantic_refusal(model): function test_openai_simple_vision_pydantic (line 172) | def test_openai_simple_vision_pydantic(image, model): function test_openai_simple_json_schema (line 182) | def test_openai_simple_json_schema(model): function test_openai_streaming (line 194) | def test_openai_streaming(model): function test_openai_batch (line 200) | def test_openai_batch(model): function test_openai_async_init_from_client (line 207) | def test_openai_async_init_from_client(api_key): function test_openai_async_wrong_inference_parameters (line 224) | async def test_openai_async_wrong_inference_parameters(async_model): function test_openai_async_wrong_input_type (line 230) | async def test_openai_async_wrong_input_type(async_model, image): function test_openai_async_wrong_output_type (line 243) | async def test_openai_async_wrong_output_type(async_model): function test_openai_async_simple_call (line 254) | async def test_openai_async_simple_call(async_model): function test_openai_async_simple_call_multiple_samples (line 261) | async def test_openai_async_simple_call_multiple_samples(async_model): function test_openai_async_direct_call (line 271) | async def test_openai_async_direct_call(async_model_no_model_name): function test_openai_async_simple_vision (line 281) | async def test_openai_async_simple_vision(image, async_model): function test_openai_async_chat (line 288) | async def test_openai_async_chat(image, async_model): function test_openai_async_simple_pydantic (line 301) | async def test_openai_async_simple_pydantic(async_model): function test_openai_async_simple_pydantic_refusal (line 312) | async def test_openai_async_simple_pydantic_refusal(async_model): function test_openai_async_simple_vision_pydantic (line 322) | async def test_openai_async_simple_vision_pydantic(image, async_model): function test_openai_async_simple_json_schema (line 333) | async def test_openai_async_simple_json_schema(async_model): function test_openai_async_streaming (line 346) | async def test_openai_async_streaming(async_model): function test_openai_async_batch (line 355) | async def test_openai_async_batch(async_model): FILE: tests/models/test_openai_type_adapter.py function schema (line 23) | def schema(): function image (line 37) | def image(): function adapter (line 52) | def adapter(): function test_openai_type_adapter_input_text (line 56) | def test_openai_type_adapter_input_text(adapter): function test_openai_type_adapter_input_vision (line 62) | def test_openai_type_adapter_input_vision(adapter, image): function test_openai_type_adapter_input_chat (line 82) | def test_openai_type_adapter_input_chat(adapter, image): function test_openai_type_adapter_input_invalid (line 111) | def test_openai_type_adapter_input_invalid(adapter): function test_openai_type_adapter_output_invalid (line 134) | def test_openai_type_adapter_output_invalid(adapter): function test_openai_type_adapter_output_none (line 157) | def test_openai_type_adapter_output_none(adapter): function test_openai_type_adapter_json_mode (line 162) | def test_openai_type_adapter_json_mode(adapter): function test_openai_type_adapter_dataclass (line 167) | def test_openai_type_adapter_dataclass(adapter, schema): function test_openai_type_adapter_typed_dict (line 179) | def test_openai_type_adapter_typed_dict(adapter, schema): function test_openai_type_adapter_pydantic (line 190) | def test_openai_type_adapter_pydantic(adapter, schema): function test_openai_type_adapter_genson_schema_builder (line 201) | def test_openai_type_adapter_genson_schema_builder(adapter, schema): function test_openai_type_adapter_json_schema_str (line 220) | def test_openai_type_adapter_json_schema_str(adapter, schema): function test_openai_type_adapter_json_schema_dict (line 228) | def test_openai_type_adapter_json_schema_dict(adapter, schema): FILE: tests/models/test_sglang.py function sync_model (line 179) | def sync_model(): function sync_model_no_model_name (line 184) | def sync_model_no_model_name(): function async_model (line 189) | def async_model(): function async_model_no_model_name (line 194) | def async_model_no_model_name(): function test_sglang_init (line 198) | def test_sglang_init(): function test_sglang_sync_simple_call (line 232) | def test_sglang_sync_simple_call(sync_model): function test_sglang_sync_streaming (line 237) | def test_sglang_sync_streaming(sync_model_no_model_name): function test_sglang_sync_batch (line 246) | def test_sglang_sync_batch(sync_model): function test_sglang_sync_vision (line 253) | def test_sglang_sync_vision(sync_model): function test_sglang_sync_vision_chat (line 258) | def test_sglang_sync_vision_chat(sync_model): function test_sglang_sync_multiple_samples (line 273) | def test_sglang_sync_multiple_samples(sync_model): function test_sglang_sync_json (line 281) | def test_sglang_sync_json(sync_model): function test_sglang_sync_regex (line 291) | def test_sglang_sync_regex(sync_model): function test_sglang_sync_cfg (line 297) | def test_sglang_sync_cfg(sync_model): function test_sglang_async_simple_call (line 308) | async def test_sglang_async_simple_call(async_model): function test_sglang_async_streaming (line 314) | async def test_sglang_async_streaming(async_model_no_model_name): function test_sglang_async_batch (line 326) | async def test_sglang_async_batch(async_model): function test_sglang_async_vision (line 334) | async def test_sglang_async_vision(async_model): function test_sglang_async_vision_chat (line 340) | async def test_sglang_async_vision_chat(async_model): function test_sglang_async_multiple_samples (line 356) | async def test_sglang_async_multiple_samples(async_model): function test_sglang_async_json (line 365) | async def test_sglang_async_json(async_model): function test_sglang_async_regex (line 376) | async def test_sglang_async_regex(async_model): function test_sglang_async_cfg (line 383) | async def test_sglang_async_cfg(async_model): FILE: tests/models/test_sglang_type_adapter.py function type_adapter (line 29) | def type_adapter(): function cfg_instance (line 33) | def cfg_instance(): function json_schema_instance (line 37) | def json_schema_instance(): function json_schema_whitespace_instance (line 41) | def json_schema_whitespace_instance(): function image (line 45) | def image(): function test_sglang_type_adapter_input_text (line 59) | def test_sglang_type_adapter_input_text(type_adapter): function test_sglang_type_adapter_input_vision (line 65) | def test_sglang_type_adapter_input_vision(type_adapter, image): function test_sglang_type_adapter_input_chat (line 84) | def test_sglang_type_adapter_input_chat(type_adapter, image): function test_sglang_type_adapter_input_invalid (line 113) | def test_sglang_type_adapter_input_invalid(type_adapter): function test_sglang_type_adapter_output_type (line 125) | def test_sglang_type_adapter_output_type( FILE: tests/models/test_tgi.py function sync_model (line 85) | def sync_model(): function async_model (line 90) | def async_model(): function test_tgi_init (line 94) | def test_tgi_init(): function test_tgi_sync_simple_call (line 109) | def test_tgi_sync_simple_call(sync_model): function test_tgi_sync_streaming (line 114) | def test_tgi_sync_streaming(sync_model): function test_tgi_sync_batch (line 123) | def test_tgi_sync_batch(sync_model): function test_tgi_sync_json (line 130) | def test_tgi_sync_json(sync_model): function test_tgi_sync_regex (line 137) | def test_tgi_sync_regex(sync_model): function test_tgi_sync_cfg (line 143) | def test_tgi_sync_cfg(sync_model): function test_tgi_async_simple_call (line 152) | async def test_tgi_async_simple_call(async_model): function test_tgi_async_streaming (line 158) | async def test_tgi_async_streaming(async_model): function test_tgi_async_batch (line 167) | async def test_tgi_async_batch(async_model): function test_tgi_async_json (line 175) | async def test_tgi_async_json(async_model): function test_tgi_async_regex (line 183) | async def test_tgi_async_regex(async_model): function test_tgi_async_cfg (line 190) | async def test_tgi_async_cfg(async_model): FILE: tests/models/test_tgi_model_adapter.py function type_adapter (line 24) | def type_adapter(): function cfg_instance (line 28) | def cfg_instance(): function json_schema_instance (line 32) | def json_schema_instance(): function json_schema_whitespace_instance (line 36) | def json_schema_whitespace_instance(): function test_tgi_type_adapter_input_text (line 40) | def test_tgi_type_adapter_input_text(type_adapter): function test_tgi_type_adapter_input_invalid (line 45) | def test_tgi_type_adapter_input_invalid(type_adapter): function test_tgi_type_adapter_output_type (line 53) | def test_tgi_type_adapter_output_type( function test_tgi_type_adapter_output_type_invalid (line 80) | def test_tgi_type_adapter_output_type_invalid( FILE: tests/models/test_tokenizer.py function test_tokenizer (line 6) | def test_tokenizer(): function test_check_hf_chat_template (line 10) | def test_check_hf_chat_template(): FILE: tests/models/test_transformers.py function test_transformers_instantiate_invalid (line 24) | def test_transformers_instantiate_invalid(): function test_transformers_instantiate_simple (line 32) | def test_transformers_instantiate_simple(): function test_transformers_instantiate_mamba (line 43) | def test_transformers_instantiate_mamba(): function test_transformers_instantiate_tokenizer_kwargs_dtype (line 51) | def test_transformers_instantiate_tokenizer_kwargs_dtype(): function model (line 65) | def model(): function model_bart (line 77) | def model_bart(): function test_transformers_simple (line 85) | def test_transformers_simple(model): function test_transformers_call (line 90) | def test_transformers_call(model, model_bart): function test_transformers_chat (line 102) | def test_transformers_chat(model): function test_transformers_inference_kwargs (line 112) | def test_transformers_inference_kwargs(model): function test_transformers_invalid_inference_kwargs (line 117) | def test_transformers_invalid_inference_kwargs(model): function test_transformers_regex (line 122) | def test_transformers_regex(model): function test_transformers_json (line 128) | def test_transformers_json(model): function test_transformers_choice (line 136) | def test_transformers_choice(model): function test_transformers_multiple_samples (line 145) | def test_transformers_multiple_samples(model): function test_transformers_batch (line 155) | def test_transformers_batch(model): function test_transformers_multiple_samples_constrained (line 189) | def test_transformers_multiple_samples_constrained(model): function test_transformers_batch_constrained (line 201) | def test_transformers_batch_constrained(model): function test_transformers_streaming (line 230) | def test_transformers_streaming(model): function test_transformers_parametrized_smoke (line 242) | def test_transformers_parametrized_smoke(model_name): FILE: tests/models/test_transformers_multimodal.py function image (line 29) | def image(): function model (line 42) | def model(): function test_transformers_multimodal_instantiate (line 51) | def test_transformers_multimodal_instantiate(): function test_transformers_multimodal_simple (line 64) | def test_transformers_multimodal_simple(model, image): function test_transformers_multimodal_call (line 73) | def test_transformers_multimodal_call(model, image): function test_transformers_multimodal_wrong_number_image (line 88) | def test_transformers_multimodal_wrong_number_image(model, image): function test_transformers_multimodal_wrong_input_type (line 99) | def test_transformers_multimodal_wrong_input_type(model): function test_transformers_multimodal_chat (line 104) | def test_transformers_multimodal_chat(model, image): function test_transformers_inference_kwargs (line 136) | def test_transformers_inference_kwargs(model, image): function test_transformers_invalid_inference_kwargs (line 144) | def test_transformers_invalid_inference_kwargs(model, image): function test_transformers_several_image (line 155) | def test_transformers_several_image(model, image): function test_transformers_multimodal_json (line 167) | def test_transformers_multimodal_json(model, image): function test_transformers_multimodal_regex (line 179) | def test_transformers_multimodal_regex(model, image): function test_transformers_multimodal_choice (line 189) | def test_transformers_multimodal_choice(model, image): function test_transformers_multimodal_multiple_samples (line 203) | def test_transformers_multimodal_multiple_samples(model, image): function test_transformers_multimodal_batch (line 214) | def test_transformers_multimodal_batch(model, image): FILE: tests/models/test_transformers_multimodal_type_adapter.py function adapter (line 19) | def adapter(): function logits_processor (line 28) | def logits_processor(): function image (line 35) | def image(): function video (line 45) | def video(): function audio (line 51) | def audio(): function test_transformers_multimodal_type_adapter_format_input (line 56) | def test_transformers_multimodal_type_adapter_format_input(adapter, image): function test_transformers_multimodal_type_adapter_format_input_empty_assets (line 103) | def test_transformers_multimodal_type_adapter_format_input_empty_assets(... function test_transformers_multimodal_type_adapter_format_input_chat_invalid_asset_type (line 108) | def test_transformers_multimodal_type_adapter_format_input_chat_invalid_... function test_transformers_multimodal_type_adapter_format_input_chat_unsupported_content_type (line 123) | def test_transformers_multimodal_type_adapter_format_input_chat_unsuppor... function test_transformers_multimodal_type_adapter_format_output_type (line 135) | def test_transformers_multimodal_type_adapter_format_output_type( function test_transformers_multimodal_type_adapter_format_input_chat_missing_asset_key (line 148) | def test_transformers_multimodal_type_adapter_format_input_chat_missing_... function test_transformers_multimodal_type_adapter_format_input_chat_missing_type_key (line 175) | def test_transformers_multimodal_type_adapter_format_input_chat_missing_... function test_transformers_multimodal_type_adapter_format_input_invalid_content_type (line 189) | def test_transformers_multimodal_type_adapter_format_input_invalid_conte... function test_transformers_multimodal_type_adapter_format_asset_for_template (line 206) | def test_transformers_multimodal_type_adapter_format_asset_for_template(... function test_transformers_multimodal_type_adapter_format_asset_for_template_invalid_type (line 223) | def test_transformers_multimodal_type_adapter_format_asset_for_template_... function test_transformers_multimodal_type_adapter_multiple_assets_in_single_item (line 235) | def test_transformers_multimodal_type_adapter_multiple_assets_in_single_... function test_transformers_multimodal_type_adapter_correct_multiple_assets_usage (line 251) | def test_transformers_multimodal_type_adapter_correct_multiple_assets_us... FILE: tests/models/test_transformers_tokenizer.py function tokenizer (line 16) | def tokenizer(): function tokenizer_no_pad_token_id (line 21) | def tokenizer_no_pad_token_id(tokenizer): function tokenizer_seq2seq (line 27) | def tokenizer_seq2seq(): function transformer_tokenizer (line 32) | def transformer_tokenizer(tokenizer): function another_transformer_tokenizer (line 37) | def another_transformer_tokenizer(tokenizer): function transformer_tokenizer_seq2seq (line 42) | def transformer_tokenizer_seq2seq(tokenizer_seq2seq): function test_get_llama_tokenizer_types (line 46) | def test_get_llama_tokenizer_types(): function test_transformer_tokenizer_init (line 54) | def test_transformer_tokenizer_init( function test_transformer_tokenizer_encode (line 75) | def test_transformer_tokenizer_encode(transformer_tokenizer): function test_transformer_tokenizer_decode (line 82) | def test_transformer_tokenizer_decode(transformer_tokenizer): function test_transformer_tokenizer_convert_token_to_string (line 89) | def test_transformer_tokenizer_convert_token_to_string(transformer_token... function test_transformer_tokenizer_eq (line 104) | def test_transformer_tokenizer_eq( function test_transformer_tokenizer_hash (line 124) | def test_transformer_tokenizer_hash( function test_transformer_tokenizer_getstate_setstate (line 134) | def test_transformer_tokenizer_getstate_setstate( FILE: tests/models/test_transformers_type_adapter.py function adapter (line 18) | def adapter(): function logits_processor (line 27) | def logits_processor(): function image (line 33) | def image(): function test_transformers_type_adapter_format_input (line 48) | def test_transformers_type_adapter_format_input(adapter, image): function test_transformers_type_adapter_format_output_type (line 72) | def test_transformers_type_adapter_format_output_type( FILE: tests/models/test_utils.py function test_set_additional_properties_false_json_schema (line 4) | def test_set_additional_properties_false_json_schema(): FILE: tests/models/test_vllm.py function sync_model (line 173) | def sync_model(): function sync_model_no_model_name (line 178) | def sync_model_no_model_name(): function async_model (line 183) | def async_model(): function async_model_no_model_name (line 188) | def async_model_no_model_name(): function test_vllm_init (line 192) | def test_vllm_init(): function test_vllm_sync_simple_call (line 226) | def test_vllm_sync_simple_call(sync_model): function test_vllm_sync_streaming (line 231) | def test_vllm_sync_streaming(sync_model_no_model_name): function test_vllm_sync_batch (line 240) | def test_vllm_sync_batch(sync_model): function test_vllm_sync_vision (line 247) | def test_vllm_sync_vision(sync_model): function test_vllm_sync_vision_chat (line 252) | def test_vllm_sync_vision_chat(sync_model): function test_vllm_sync_multiple_samples (line 267) | def test_vllm_sync_multiple_samples(sync_model): function test_vllm_sync_json (line 275) | def test_vllm_sync_json(sync_model): function test_vllm_sync_regex (line 282) | def test_vllm_sync_regex(sync_model): function test_vllm_sync_cfg (line 288) | def test_vllm_sync_cfg(sync_model): function test_vllm_async_simple_call (line 295) | async def test_vllm_async_simple_call(async_model): function test_vllm_async_streaming (line 301) | async def test_vllm_async_streaming(async_model_no_model_name): function test_vllm_async_batch (line 313) | async def test_vllm_async_batch(async_model): function test_vllm_async_vision (line 321) | async def test_vllm_async_vision(async_model): function test_vllm_async_vision_chat (line 327) | async def test_vllm_async_vision_chat(async_model): function test_vllm_async_multiple_samples (line 343) | async def test_vllm_async_multiple_samples(async_model): function test_vllm_async_json (line 352) | async def test_vllm_async_json(async_model): function test_vllm_async_regex (line 360) | async def test_vllm_async_regex(async_model): function test_vllm_async_cfg (line 367) | async def test_vllm_async_cfg(async_model): FILE: tests/models/test_vllm_offline.py function image (line 33) | def image(): function test_vllm_model_initialization (line 47) | def test_vllm_model_initialization(): function model (line 55) | def model(tmp_path_factory): function test_vllm_simple (line 60) | def test_vllm_simple(model): function test_vllm_call (line 65) | def test_vllm_call(model): function test_vllm_inference_kwargs (line 70) | def test_vllm_inference_kwargs(model): function test_vllm_chat (line 80) | def test_vllm_chat(model): function test_vllm_invalid_inference_kwargs (line 92) | def test_vllm_invalid_inference_kwargs(model): function test_vllm_regex (line 97) | def test_vllm_regex(model): function test_vllm_json (line 103) | def test_vllm_json(model): function test_vllm_choice (line 111) | def test_vllm_choice(model): function test_vllm_multiple_samples (line 120) | def test_vllm_multiple_samples(model): function test_vllm_batch (line 129) | def test_vllm_batch(model): function test_vllm_streaming (line 155) | def test_vllm_streaming(model): FILE: tests/models/test_vllm_offline_type_adapter.py function type_adapter (line 28) | def type_adapter(): function cfg_instance (line 32) | def cfg_instance(): function json_schema_instance (line 36) | def json_schema_instance(): function json_schema_whitespace_instance (line 40) | def json_schema_whitespace_instance(): function regex_instance (line 44) | def regex_instance(): function image (line 48) | def image(): function test_vllm_offline_type_adapter_input_text (line 62) | def test_vllm_offline_type_adapter_input_text(type_adapter): function test_vllm_offline_type_adapter_input_text_with_template (line 68) | def test_vllm_offline_type_adapter_input_text_with_template(): function test_vllm_offline_type_adapter_input_text_without_template (line 76) | def test_vllm_offline_type_adapter_input_text_without_template(): function test_vllm_offline_type_adapter_input_chat (line 84) | def test_vllm_offline_type_adapter_input_chat(type_adapter): function test_vllm_offline_type_adapter_input_invalid (line 98) | def test_vllm_offline_type_adapter_input_invalid(type_adapter, image): function test_vllm_offline_type_adapter_output_type (line 111) | def test_vllm_offline_type_adapter_output_type( FILE: tests/models/test_vllm_type_adapter.py function type_adapter (line 30) | def type_adapter(): function cfg_instance (line 34) | def cfg_instance(): function json_schema_instance (line 38) | def json_schema_instance(): function json_schema_whitespace_instance (line 42) | def json_schema_whitespace_instance(): function image (line 46) | def image(): function test_vllm_type_adapter_input_text (line 60) | def test_vllm_type_adapter_input_text(type_adapter): function test_vllm_type_adapter_input_vision (line 66) | def test_vllm_type_adapter_input_vision(type_adapter, image): function test_vllm_type_adapter_input_chat (line 85) | def test_vllm_type_adapter_input_chat(type_adapter, image): function test_vllm_type_adapter_input_invalid (line 114) | def test_vllm_type_adapter_input_invalid(type_adapter): function test_vllm_type_adapter_output_type (line 126) | def test_vllm_type_adapter_output_type( FILE: tests/processors/test_base_processor.py class MockLogitsProcessor (line 56) | class MockLogitsProcessor(OutlinesLogitsProcessor): method process_logits (line 57) | def process_logits(self, input_ids, logits): function test_base_logits_processor_init (line 65) | def test_base_logits_processor_init(library): function test_base_logits_processor_call (line 74) | def test_base_logits_processor_call(library): function test_base_logits_processor_init_library_name (line 90) | def test_base_logits_processor_init_library_name(library): FILE: tests/processors/test_tensor_adapters.py function create_tensor (line 31) | def create_tensor(framework, shape, dtype=None): function compare_tensors (line 41) | def compare_tensors(framework, tensor1, tensor2): function test_tensor_adapter_shape (line 53) | def test_tensor_adapter_shape(framework): function test_tensor_adapter_unsqueeze (line 77) | def test_tensor_adapter_unsqueeze(framework): function test_tensor_adapter_squeeze (line 90) | def test_tensor_adapter_squeeze(framework): function test_tensor_adapter_to_list (line 109) | def test_tensor_adapter_to_list(framework): function test_tensor_adapter_to_scalar (line 138) | def test_tensor_adapter_to_scalar(framework): function test_tensor_adapter_full_like (line 155) | def test_tensor_adapter_full_like(framework): function test_tensor_adapter_concatenate (line 165) | def test_tensor_adapter_concatenate(framework): function test_tensor_adapter_get_to_device (line 199) | def test_tensor_adapter_get_to_device(framework): function test_tensor_adapter_boolean_ones_like (line 212) | def test_tensor_adapter_boolean_ones_like(framework): function test_tensor_adapter_apply_mask (line 223) | def test_tensor_adapter_apply_mask(framework): function test_tensor_adapter_argsort_descending (line 247) | def test_tensor_adapter_argsort_descending(framework): FILE: tests/test_applications.py function model (line 13) | def model(): function another_model (line 21) | def another_model(): function test_application_initialization (line 28) | def test_application_initialization(): function test_application_generator_no_model (line 39) | def test_application_generator_no_model(): function test_application_template_call (line 48) | def test_application_template_call(model): function test_application_callable_call (line 57) | def test_application_callable_call(model): function test_application_template_error (line 68) | def test_application_template_error(model): function test_application_generator_reuse (line 77) | def test_application_generator_reuse(model, another_model): FILE: tests/test_cache.py function temp_dir (line 13) | def temp_dir(): function refresh_environment (line 20) | def refresh_environment(): function test_cache (line 41) | def test_cache(refresh_environment): function test_get_cache (line 55) | def test_get_cache(test_cache): function test_disable_cache (line 81) | def test_disable_cache(test_cache): function test_clear_cache (line 103) | def test_clear_cache(test_cache): function test_version_upgrade_cache_invalidate (line 128) | def test_version_upgrade_cache_invalidate(test_cache, mocker): function test_cache_disabled_decorator (line 173) | def test_cache_disabled_decorator(test_cache): function temp_cache_dir (line 204) | def temp_cache_dir(): FILE: tests/test_generator.py function steerable_model (line 62) | def steerable_model(): function sample_processor (line 71) | def sample_processor(): function black_box_sync_model (line 78) | def black_box_sync_model(): function black_box_async_model (line 83) | def black_box_async_model(): function test_steerable_generator_init_valid_processor (line 90) | def test_steerable_generator_init_valid_processor(steerable_model, sampl... function test_steerable_generator_init_cfg_output_type (line 96) | def test_steerable_generator_init_cfg_output_type(steerable_model): function test_steerable_generator_init_other_output_type (line 102) | def test_steerable_generator_init_other_output_type(steerable_model): function test_steerable_generator_init_invalid_output_type (line 108) | def test_steerable_generator_init_invalid_output_type(steerable_model, s... function test_steerable_generator_call (line 113) | def test_steerable_generator_call(steerable_model): function test_steerable_generator_stream (line 119) | def test_steerable_generator_stream(steerable_model): function test_black_box_generator_init (line 130) | def test_black_box_generator_init(black_box_sync_model): function test_black_box_generator_call (line 135) | def test_black_box_generator_call(black_box_sync_model): function test_black_box_generator_stream (line 141) | def test_black_box_generator_stream(black_box_sync_model): function test_async_black_box_generator_init (line 151) | def test_async_black_box_generator_init(black_box_async_model): function test_async_black_box_generator_call (line 158) | async def test_async_black_box_generator_call(black_box_async_model): function test_async_black_box_generator_stream (line 165) | async def test_async_black_box_generator_stream(black_box_async_model): function test_generator_init_no_model (line 177) | def test_generator_init_no_model(): function test_generator_init_multiple_output_type (line 182) | def test_generator_init_multiple_output_type(steerable_model, sample_pro... function test_generator_steerable_output_type (line 187) | def test_generator_steerable_output_type(steerable_model): function test_generator_steerable_processor (line 194) | def test_generator_steerable_processor(steerable_model, sample_processor): function test_generator_black_box_sync_output_type (line 201) | def test_generator_black_box_sync_output_type(black_box_sync_model): function test_generator_black_box_sync_processor (line 208) | def test_generator_black_box_sync_processor(black_box_sync_model, sample... function test_generator_black_box_async_output_type (line 213) | def test_generator_black_box_async_output_type(black_box_async_model): function test_generator_black_box_async_processor (line 220) | def test_generator_black_box_async_processor(black_box_async_model, samp... FILE: tests/test_inputs.py function image_input (line 15) | def image_input(): function test_image_initialization (line 23) | def test_image_initialization(): function test_image_initialization_invalid (line 47) | def test_image_initialization_invalid(): function test_video_initialization (line 61) | def test_video_initialization(): function test_audio_initialization (line 67) | def test_audio_initialization(): function test_chat_initialization (line 73) | def test_chat_initialization(): function test_chat_append (line 94) | def test_chat_append(): function test_chat_extend (line 101) | def test_chat_extend(): function test_chat_pop (line 111) | def test_chat_pop(): function test_chat_add_system_message (line 129) | def test_chat_add_system_message(image_input): function test_add_user_message_string (line 152) | def test_add_user_message_string(image_input): function test_add_assistant_message_string (line 175) | def test_add_assistant_message_string(image_input): FILE: tests/test_templates.py function sample_function (line 25) | def sample_function(x, y=2): function function_with_annotations (line 29) | def function_with_annotations(x: int, y: str) -> str: function function_with_no_docstring (line 33) | def function_with_no_docstring(x, y): class CallableClass (line 36) | class CallableClass: method __call__ (line 37) | def __call__(self): class PydanticClass (line 40) | class PydanticClass(BaseModel): function test_vision_initialization (line 44) | def test_vision_initialization(): function test_vision_invalid_image_format (line 69) | def test_vision_invalid_image_format(): function render (line 79) | def render(content: str, filters: Optional[dict] = None, **kwargs): function test_render (line 84) | def test_render(): function test_render_escaped_linebreak (line 119) | def test_render_escaped_linebreak(): function test_render_jinja (line 141) | def test_render_jinja(): function test_render_filters (line 182) | def test_render_filters(): function temp_prompt_file (line 237) | def temp_prompt_file(): function test_prompt_from_file (line 277) | def test_prompt_from_file(temp_prompt_file): function test_prompt_from_str (line 300) | def test_prompt_from_str(): function test_template_from_str_with_extra_linebreaks (line 308) | def test_template_from_str_with_extra_linebreaks(): function test_get_fn_name (line 318) | def test_get_fn_name(): function test_get_fn_args (line 328) | def test_get_fn_args(): function test_get_fn_description (line 335) | def test_get_fn_description(): function test_get_fn_source (line 343) | def test_get_fn_source(): function test_get_fn_signature (line 354) | def test_get_fn_signature(): function test_get_schema (line 363) | def test_get_schema(): FILE: tests/test_utils/mock_lmstudio_client.py function normalize_for_hash (line 7) | def normalize_for_hash(obj): function normalize_lmstudio_messages (line 30) | def normalize_lmstudio_messages(messages): function normalize_lmstudio_content (line 42) | def normalize_lmstudio_content(content): function hash_lmstudio_request (line 63) | def hash_lmstudio_request(data: dict) -> str: class MockLMStudioResponse (line 69) | class MockLMStudioResponse: method __init__ (line 72) | def __init__(self, content: str): class MockLMStudioModel (line 76) | class MockLMStudioModel: method __init__ (line 79) | def __init__(self, mock_responses: Dict[str, Any]): method respond (line 82) | def respond(self, messages, **kwargs): method respond_stream (line 89) | def respond_stream(self, messages, **kwargs): class MockLMStudioLLM (line 98) | class MockLMStudioLLM: method __init__ (line 101) | def __init__(self, mock_responses: Dict[str, Any]): method model (line 104) | def model(self, model_key=None): class MockLMStudioClient (line 108) | class MockLMStudioClient: method __init__ (line 111) | def __init__(self): method add_mock_responses (line 115) | def add_mock_responses(self, mocks: List[Tuple[dict, Any]]): class MockAsyncLMStudioModel (line 122) | class MockAsyncLMStudioModel: method __init__ (line 125) | def __init__(self, mock_responses: Dict[str, Any]): method respond (line 128) | async def respond(self, messages, **kwargs): method respond_stream (line 135) | async def respond_stream(self, messages, **kwargs): class MockAsyncLMStudioLLM (line 149) | class MockAsyncLMStudioLLM: method __init__ (line 152) | def __init__(self, mock_responses: Dict[str, Any]): method model (line 155) | async def model(self, model_key=None): class MockAsyncLMStudioClient (line 159) | class MockAsyncLMStudioClient: method __init__ (line 162) | def __init__(self): method add_mock_responses (line 167) | def add_mock_responses(self, mocks: List[Tuple[dict, Any]]): method __aenter__ (line 173) | async def __aenter__(self): method __aexit__ (line 177) | async def __aexit__(self, exc_type, exc_val, exc_tb): FILE: tests/test_utils/mock_openai_client.py class MockChoice (line 7) | class MockChoice: method __init__ (line 8) | def __init__( class MockCompletionResponse (line 22) | class MockCompletionResponse: method __init__ (line 23) | def __init__(self, choices: List[MockChoice]): class MockStreamingChunk (line 27) | class MockStreamingChunk: method __init__ (line 28) | def __init__(self, content: Optional[str] = None): class MockOpenAIClient (line 38) | class MockOpenAIClient: method __init__ (line 41) | def __init__(self): method add_mock_responses (line 61) | def add_mock_responses(self, mocks: list): method _create_standard_response (line 66) | def _create_standard_response(self, response): method _create_streaming_response (line 72) | def _create_streaming_response(self, response): class MockAsyncOpenAIClient (line 77) | class MockAsyncOpenAIClient: method __init__ (line 80) | def __init__(self): method add_mock_responses (line 100) | def add_mock_responses(self, mocks: list): method _create_async_standard_response (line 105) | async def _create_async_standard_response(self, response): method _create_async_streaming_response (line 112) | async def _create_async_streaming_response(self, response): FILE: tests/test_utils/mock_tgi_client.py class MockTGIInferenceClient (line 7) | class MockTGIInferenceClient: method __init__ (line 10) | def __init__(self): method add_mock_responses (line 28) | def add_mock_responses(self, mocks: list): class MockAsyncTGIInferenceClient (line 34) | class MockAsyncTGIInferenceClient: method __init__ (line 37) | def __init__(self): method add_mock_responses (line 55) | def add_mock_responses(self, mocks: list): method _create_async_streaming_response (line 60) | async def _create_async_streaming_response(self, response): FILE: tests/test_utils/utils.py function hash_dict (line 6) | def hash_dict(d) -> str: FILE: tests/types/test_custom_types.py function test_type_regex (line 98) | def test_type_regex(custom_type, test_string, should_match): function test_type_enum (line 130) | def test_type_enum(custom_type, test_string, should_match): FILE: tests/types/test_dsl.py function test_dsl_init (line 69) | def test_dsl_init(): function test_dsl_term_methods (line 157) | def test_dsl_term_methods(): function test_dsl_sequence (line 195) | def test_dsl_sequence(): function test_dsl_alternatives (line 217) | def test_dsl_alternatives(): function test_dsl_optional (line 237) | def test_dsl_optional(): function test_dsl_exactly (line 251) | def test_dsl_exactly(): function test_dsl_at_least (line 266) | def test_dsl_at_least(): function test_dsl_at_most (line 281) | def test_dsl_at_most(): function test_between (line 296) | def test_between(): function test_dsl_zero_or_more (line 312) | def test_dsl_zero_or_more(): function test_dsl_one_or_more (line 326) | def test_dsl_one_or_more(): function test_dsl_aliases (line 340) | def test_dsl_aliases(): function test_dsl_term_pydantic_simple (line 348) | def test_dsl_term_pydantic_simple(): function test_dsl_term_pydantic_combination (line 363) | def test_dsl_term_pydantic_combination(): function test_dsl_display (line 382) | def test_dsl_display(): function test_cfg (line 395) | def test_cfg(): function test_json_schema (line 409) | def test_json_schema(): function test_dsl_cfg_from_file (line 490) | def test_dsl_cfg_from_file(): function test_dsl_json_schema_from_file (line 505) | def test_dsl_json_schema_from_file(): function test_dsl_python_types_to_terms (line 524) | def test_dsl_python_types_to_terms(): function test_dsl_handle_literal (line 650) | def test_dsl_handle_literal(): function test_dsl_handle_union (line 659) | def test_dsl_handle_union(): function test_dsl_handle_list (line 695) | def test_dsl_handle_list(): function test_dsl_handle_tuple (line 728) | def test_dsl_handle_tuple(): function test_dsl_handle_dict (line 769) | def test_dsl_handle_dict(): function test_ensure_json_quoted_string (line 791) | def test_ensure_json_quoted_string(): function test_ensure_json_quoted_alternatives (line 799) | def test_ensure_json_quoted_alternatives(): function test_ensure_json_quoted_passthrough (line 810) | def test_ensure_json_quoted_passthrough(): function test_list_of_literals_quoted (line 819) | def test_list_of_literals_quoted(): function test_tuple_of_literals_quoted (line 832) | def test_tuple_of_literals_quoted(): function test_dict_literal_key_quoted (line 844) | def test_dict_literal_key_quoted(): function test_list_of_int_unchanged (line 858) | def test_list_of_int_unchanged(): function test_ensure_json_quoted_sequence_passthrough (line 865) | def test_ensure_json_quoted_sequence_passthrough(): function test_ensure_json_quoted_regex_passthrough (line 871) | def test_ensure_json_quoted_regex_passthrough(): function test_list_single_literal (line 878) | def test_list_single_literal(): function test_dict_literal_value_quoted (line 889) | def test_dict_literal_value_quoted(): function test_tuple_ellipsis_literal_quoted (line 902) | def test_tuple_ellipsis_literal_quoted(): function test_list_of_bool_unchanged (line 914) | def test_list_of_bool_unchanged(): function test_dict_int_value_unchanged (line 921) | def test_dict_int_value_unchanged(): function test_ensure_json_quoted_nested_alternatives (line 931) | def test_ensure_json_quoted_nested_alternatives(): function test_literal_with_special_characters (line 947) | def test_literal_with_special_characters(): function test_e2e_list_literal_matches_quoted_json (line 965) | def test_e2e_list_literal_matches_quoted_json(): function test_e2e_standalone_literal_no_quotes (line 975) | def test_e2e_standalone_literal_no_quotes(): function test_e2e_list_literal_empty_string (line 983) | def test_e2e_list_literal_empty_string(): function test_e2e_list_mixed_literal_string_and_int (line 991) | def test_e2e_list_mixed_literal_string_and_int(): function test_e2e_dict_literal_keys_quoted (line 1001) | def test_e2e_dict_literal_keys_quoted(): function test_e2e_dict_literal_values_quoted (line 1009) | def test_e2e_dict_literal_values_quoted(): function test_e2e_tuple_fixed_literal_quoted (line 1016) | def test_e2e_tuple_fixed_literal_quoted(): function test_e2e_tuple_variadic_literal_quoted (line 1023) | def test_e2e_tuple_variadic_literal_quoted(): function test_e2e_list_enum_string_values_quoted (line 1031) | def test_e2e_list_enum_string_values_quoted(): function test_e2e_list_int_not_quoted (line 1044) | def test_e2e_list_int_not_quoted(): function test_e2e_list_literal_special_characters (line 1052) | def test_e2e_list_literal_special_characters(): function test_e2e_dict_literal_key_and_enum_value (line 1060) | def test_e2e_dict_literal_key_and_enum_value(): function test_to_regex (line 1073) | def test_to_regex(): FILE: tests/types/test_json_schema_utils.py function test_schema_type_to_python_simple_types (line 21) | def test_schema_type_to_python_simple_types(): function test_schema_type_to_python_enum (line 30) | def test_schema_type_to_python_enum(): function test_schema_type_to_python_array (line 36) | def test_schema_type_to_python_array(): function test_schema_type_to_python_object (line 53) | def test_schema_type_to_python_object(): function test_schema_type_to_python_unknown_type (line 88) | def test_schema_type_to_python_unknown_type(): function test_json_schema_dict_to_typeddict_basic (line 100) | def test_json_schema_dict_to_typeddict_basic(): function test_json_schema_dict_to_typeddict_array_enum (line 119) | def test_json_schema_dict_to_typeddict_array_enum(): function test_json_schema_dict_to_typeddict_nested_object (line 143) | def test_json_schema_dict_to_typeddict_nested_object(): function test_json_schema_dict_to_pydantic_basic (line 170) | def test_json_schema_dict_to_pydantic_basic(): function test_json_schema_dict_to_pydantic_array_enum (line 190) | def test_json_schema_dict_to_pydantic_array_enum(): function test_json_schema_dict_to_pydantic_nested_object (line 215) | def test_json_schema_dict_to_pydantic_nested_object(): function test_json_schema_dict_to_dataclass_basic (line 245) | def test_json_schema_dict_to_dataclass_basic(): function test_json_schema_dict_to_dataclass_array_enum (line 266) | def test_json_schema_dict_to_dataclass_array_enum(): function test_json_schema_dict_to_dataclass_nested_object (line 292) | def test_json_schema_dict_to_dataclass_nested_object(): FILE: tests/types/test_to_regex.py function test_to_regex_simple (line 23) | def test_to_regex_simple(): function test_to_regex_combinations (line 91) | def test_to_regex_combinations(): FILE: tests/types/test_types_utils.py function member (line 10) | def member(x): # type: ignore[no-redef] function sample_enum (line 68) | def sample_enum(): function sample_complex_enum (line 76) | def sample_complex_enum(): function sample_empty_enum (line 88) | def sample_empty_enum(): function sample_class (line 99) | def sample_class(): function sample_dataclass (line 106) | def sample_dataclass(): function sample_typed_dict (line 115) | def sample_typed_dict(): function sample_pydantic_model (line 123) | def sample_pydantic_model(): function sample_schema_builder (line 131) | def sample_schema_builder(): function sample_function (line 139) | def sample_function(): function sample_function_missing_type (line 146) | def sample_function_missing_type(): function test_is_int (line 153) | def test_is_int(): function test_is_int_instance (line 165) | def test_is_int_instance(): function test_is_float (line 173) | def test_is_float(): function test_is_float_instance (line 185) | def test_is_float_instance(): function test_is_str (line 192) | def test_is_str(): function test_is_str_instance (line 204) | def test_is_str_instance(): function test_is_bool (line 212) | def test_is_bool(): function test_is_datetime (line 222) | def test_is_datetime(): function test_is_date (line 229) | def test_is_date(): function test_is_time (line 236) | def test_is_time(): function test_is_native_dict (line 243) | def test_is_native_dict(): function test_is_typing_dict (line 251) | def test_is_typing_dict(): function test_is_typing_list (line 258) | def test_is_typing_list(): function test_is_typing_tuple (line 266) | def test_is_typing_tuple(): function test_is_union (line 274) | def test_is_union(): function test_is_literal (line 282) | def test_is_literal(): function test_is_dataclass (line 290) | def test_is_dataclass( function test_is_typed_dict (line 304) | def test_is_typed_dict( function test_is_pydantic_model (line 318) | def test_is_pydantic_model( function test_is_genson_schema_builder (line 332) | def test_is_genson_schema_builder( function test_is_enum (line 350) | def test_is_enum(sample_enum): function test_is_callable (line 358) | def test_is_callable(sample_function, sample_class, sample_dataclass, sa... function test_get_enum_from_choice (line 371) | def test_get_enum_from_choice(sample_enum): function test_get_enum_from_literal (line 380) | def test_get_enum_from_literal(sample_enum): function test_get_schema_from_signature (line 395) | def test_get_schema_from_signature(sample_function, sample_function_miss... function test_get_schema_from_enum (line 408) | def test_get_schema_from_enum(sample_complex_enum, sample_empty_enum):