SYMBOL INDEX (652 symbols across 36 files) FILE: docs/plugins/llm-markov/llm_markov.py function register_models (line 9) | def register_models(register): function build_markov_table (line 13) | def build_markov_table(text): function generate (line 24) | def generate(transitions, length, start_word=None): class Markov (line 33) | class Markov(llm.Model): class Options (line 37) | class Options(llm.Options): method validate_length (line 46) | def validate_length(cls, length): method validate_delay (line 54) | def validate_delay(cls, delay): method execute (line 61) | def execute(self, prompt, stream, response, conversation): FILE: llm/__init__.py function get_plugins (line 73) | def get_plugins(all=False): function get_models_with_aliases (line 93) | def get_models_with_aliases() -> List["ModelWithAliases"]: function _get_loaders (line 116) | def _get_loaders(hook_method) -> Dict[str, Callable]: function get_template_loaders (line 132) | def get_template_loaders() -> Dict[str, Callable[[str], Template]]: function get_fragment_loaders (line 137) | def get_fragment_loaders() -> Dict[ function get_tools (line 145) | def get_tools() -> Dict[str, Union[Tool, Type[Toolbox]]]: function get_embedding_models_with_aliases (line 218) | def get_embedding_models_with_aliases() -> List["EmbeddingModelWithAlias... function get_embedding_models (line 241) | def get_embedding_models(): function get_embedding_model (line 252) | def get_embedding_model(name): function get_embedding_model_aliases (line 260) | def get_embedding_model_aliases() -> Dict[str, EmbeddingModel]: function get_async_model_aliases (line 269) | def get_async_model_aliases() -> Dict[str, AsyncModel]: function get_model_aliases (line 281) | def get_model_aliases() -> Dict[str, Model]: class UnknownModelError (line 291) | class UnknownModelError(KeyError): function get_models (line 295) | def get_models() -> List[Model]: function get_async_models (line 301) | def get_async_models() -> List[AsyncModel]: function get_async_model (line 307) | def get_async_model(name: Optional[str] = None) -> AsyncModel: function get_model (line 326) | def get_model(name: Optional[str] = None, _skip_async: bool = False) -> ... function get_key (line 347) | def get_key( function load_keys (line 387) | def load_keys(): function user_dir (line 395) | def user_dir(): function set_alias (line 405) | def set_alias(alias, model_id_or_alias): function remove_alias (line 434) | def remove_alias(alias): function encode (line 451) | def encode(values): function decode (line 455) | def decode(binary): function cosine_similarity (line 459) | def cosine_similarity(a, b): function get_default_model (line 466) | def get_default_model(filename="default_model.txt", default=DEFAULT_MODEL): function set_default_model (line 474) | def set_default_model(model, filename="default_model.txt"): function get_default_embedding_model (line 482) | def get_default_embedding_model(): function set_default_embedding_model (line 486) | def set_default_embedding_model(model): FILE: llm/cli.py class FragmentNotFound (line 88) | class FragmentNotFound(Exception): function validate_fragment_alias (line 92) | def validate_fragment_alias(ctx, param, value): function resolve_fragments (line 98) | def resolve_fragments( function process_fragments_in_chat (line 173) | def process_fragments_in_chat( class AttachmentError (line 206) | class AttachmentError(Exception): function resolve_attachment (line 212) | def resolve_attachment(value): class AttachmentType (line 254) | class AttachmentType(click.ParamType): method convert (line 257) | def convert(self, value, param, ctx): function resolve_attachment_with_type (line 264) | def resolve_attachment_with_type(value: str, mimetype: str) -> Attachment: function attachment_types_callback (line 280) | def attachment_types_callback(ctx, param, values) -> List[Attachment]: function json_validator (line 287) | def json_validator(object_name): function schema_option (line 302) | def schema_option(fn): function cli (line 318) | def cli(): function prompt (line 479) | def prompt( function chat (line 1022) | def chat( function load_conversation (line 1244) | def load_conversation( function keys (line 1281) | def keys(): function keys_list (line 1286) | def keys_list(): function keys_path_command (line 1299) | def keys_path_command(): function keys_get (line 1306) | def keys_get(name): function keys_set (line 1328) | def keys_set(name, value): function logs (line 1357) | def logs(): function logs_path (line 1362) | def logs_path(): function logs_status (line 1368) | def logs_status(): function backup (line 1390) | def backup(path): function logs_turn_on (line 1405) | def logs_turn_on(): function logs_turn_off (line 1413) | def logs_turn_off(): function logs_list (line 1576) | def logs_list( function models (line 2205) | def models(): function models_list (line 2231) | def models_list(options, async_, schemas, tools, query, model_ids): function models_default (line 2317) | def models_default(model): function templates (line 2335) | def templates(): function templates_list (line 2340) | def templates_list(): function templates_show (line 2372) | def templates_show(name): function templates_edit (line 2389) | def templates_edit(name): function templates_path (line 2401) | def templates_path(): function templates_loaders (line 2407) | def templates_loaders(): function schemas (line 2426) | def schemas(): function schemas_list (line 2454) | def schemas_list(path, database, queries, full, json_, nl): function schemas_show (line 2530) | def schemas_show(schema_id, path, database): function schemas_dsl_debug (line 2550) | def schemas_dsl_debug(input, multi): function tools (line 2566) | def tools(): function tools_list (line 2579) | def tools_list(tool_defs, json_, python_tools): function aliases (line 2683) | def aliases(): function aliases_list (line 2689) | def aliases_list(json_): function aliases_set (line 2722) | def aliases_set(alias, model_id, query): function aliases_remove (line 2764) | def aliases_remove(alias): function aliases_path (line 2780) | def aliases_path(): function fragments (line 2790) | def fragments(): function fragments_list (line 2808) | def fragments_list(queries, aliases, json_): function fragments_set (line 2868) | def fragments_set(alias, fragment): function fragments_show (line 2899) | def fragments_show(alias_or_hash): function fragments_remove (line 2917) | def fragments_remove(alias): function fragments_loaders (line 2935) | def fragments_loaders(): function plugins_list (line 2959) | def plugins_list(all, hooks): function display_truncated (line 2968) | def display_truncated(text): function install (line 3001) | def install(packages, upgrade, editable, force_reinstall, no_cache_dir, ... function uninstall (line 3022) | def uninstall(packages, yes): function embed (line 3065) | def embed( function embed_multi (line 3195) | def embed_multi( function similar (line 3390) | def similar(collection, id, input, content, binary, number, plain, datab... function embed_models (line 3457) | def embed_models(): function embed_models_list (line 3468) | def embed_models_list(query): function embed_models_default (line 3487) | def embed_models_default(model, remove_default): function collections (line 3512) | def collections(): function collections_path (line 3517) | def collections_path(): function embed_db_collections (line 3531) | def embed_db_collections(database, json_): function collections_delete (line 3569) | def collections_delete(collection, database): function options (line 3592) | def options(): function options_list (line 3597) | def options_list(): function options_show (line 3619) | def options_show(model): function options_set (line 3651) | def options_set(model, key, value): function options_clear (line 3686) | def options_clear(model, key): function template_dir (line 3724) | def template_dir(): function logs_db_path (line 3730) | def logs_db_path(): function get_history (line 3734) | def get_history(chat_id): function render_errors (line 3753) | def render_errors(errors): function _human_readable_size (line 3766) | def _human_readable_size(size_bytes): function logs_on (line 3780) | def logs_on(): function get_all_model_options (line 3784) | def get_all_model_options() -> dict: function get_model_options (line 3800) | def get_model_options(model_id: str) -> dict: function set_model_option (line 3822) | def set_model_option(model_id: str, key: str, value: Any) -> None: function clear_model_option (line 3851) | def clear_model_option(model_id: str, key: str) -> None: class LoadTemplateError (line 3879) | class LoadTemplateError(ValueError): function _parse_yaml_template (line 3883) | def _parse_yaml_template(name, content): function load_template (line 3899) | def load_template(name: str) -> Template: function _tools_from_code (line 3937) | def _tools_from_code(code_or_path: str) -> List[Tool]: function _debug_tool_call (line 3959) | def _debug_tool_call(_, tool_call, tool_result): function _approve_tool_call (line 3999) | def _approve_tool_call(_, tool_call): function _gather_tools (line 4012) | def _gather_tools( function _get_conversation_tools (line 4044) | def _get_conversation_tools(conversation, tools): FILE: llm/default_plugins/default_tools.py function register_tools (line 6) | def register_tools(register): FILE: llm/default_plugins/openai_models.py function register_models (line 34) | def register_models(register): function register_embedding_models (line 321) | def register_embedding_models(register): class OpenAIEmbeddingModel (line 358) | class OpenAIEmbeddingModel(EmbeddingModel): method __init__ (line 363) | def __init__(self, model_id, openai_model_id, dimensions=None): method embed_batch (line 368) | def embed_batch(self, items: Iterable[Union[str, bytes]]) -> Iterator[... function register_commands (line 381) | def register_commands(cli): class SharedOptions (line 423) | class SharedOptions(llm.Options): method validate_logit_bias (line 486) | def validate_logit_bias(cls, logit_bias): class ReasoningEffortEnum (line 511) | class ReasoningEffortEnum(str, Enum): class OptionsForReasoning (line 520) | class OptionsForReasoning(SharedOptions): function _attachment (line 535) | def _attachment(attachment): class _Shared (line 564) | class _Shared: method __init__ (line 565) | def __init__( method __str__ (line 621) | def __str__(self) -> str: method build_messages (line 624) | def build_messages(self, prompt, conversation): method set_usage (line 701) | def set_usage(self, response, usage): method get_client (line 711) | def get_client(self, key, *, async_=False): method build_kwargs (line 736) | def build_kwargs(self, prompt, stream): class Chat (line 765) | class Chat(_Shared, KeyModel): class Options (line 770) | class Options(SharedOptions): method execute (line 776) | def execute( class AsyncChat (line 855) | class AsyncChat(_Shared, AsyncKeyModel): class Options (line 860) | class Options(SharedOptions): method execute (line 866) | async def execute( class Completion (line 947) | class Completion(Chat): class Options (line 948) | class Options(SharedOptions): method __init__ (line 955) | def __init__(self, *args, default_max_tokens=None, **kwargs): method __str__ (line 959) | def __str__(self) -> str: method execute (line 962) | def execute( function not_nulls (line 1013) | def not_nulls(data) -> dict: function combine_chunks (line 1017) | def combine_chunks(chunks: List) -> dict: function redact_data (line 1065) | def redact_data(input_dict): FILE: llm/embeddings.py class Entry (line 14) | class Entry: class Collection (line 21) | class Collection: class DoesNotExist (line 22) | class DoesNotExist(Exception): method __init__ (line 25) | def __init__( method model (line 88) | def model(self) -> EmbeddingModel: method count (line 97) | def count(self) -> int: method embed (line 115) | def embed( method embed_multi (line 153) | def embed_multi( method embed_multi_with_metadata (line 173) | def embed_multi_with_metadata( method similar_by_vector (line 238) | def similar_by_vector( method similar_by_id (line 297) | def similar_by_id( method similar (line 326) | def similar( method exists (line 344) | def exists(cls, db: Database, name: str) -> bool: method delete (line 354) | def delete(self): method content_hash (line 363) | def content_hash(input: Union[str, bytes]) -> bytes: FILE: llm/embeddings_migrations.py function m001_create_tables (line 9) | def m001_create_tables(db): function m002_foreign_key (line 25) | def m002_foreign_key(db): function m003_add_updated (line 30) | def m003_add_updated(db): function m004_store_content_hash (line 41) | def m004_store_content_hash(db): function m005_add_content_blob (line 85) | def m005_add_content_blob(db): FILE: llm/errors.py class ModelError (line 1) | class ModelError(Exception): class NeedsKeyException (line 5) | class NeedsKeyException(ModelError): FILE: llm/hookspecs.py function register_commands (line 9) | def register_commands(cli): function register_models (line 14) | def register_models(register): function register_embedding_models (line 19) | def register_embedding_models(register): function register_template_loaders (line 24) | def register_template_loaders(register): function register_fragment_loaders (line 29) | def register_fragment_loaders(register): function register_tools (line 34) | def register_tools(register): FILE: llm/migrations.py function migrate (line 8) | def migrate(db): function ensure_migrations_table (line 24) | def ensure_migrations_table(db): function m001_initial (line 36) | def m001_initial(db): function m002_id_primary_key (line 57) | def m002_id_primary_key(db): function m003_chat_id_foreign_key (line 62) | def m003_chat_id_foreign_key(db): function m004_column_order (line 68) | def m004_column_order(db): function m004_drop_provider (line 83) | def m004_drop_provider(db): function m005_debug (line 88) | def m005_debug(db): function m006_new_logs_table (line 94) | def m006_new_logs_table(db): function m007_finish_logs_table (line 131) | def m007_finish_logs_table(db): function m008_reply_to_id_foreign_key (line 142) | def m008_reply_to_id_foreign_key(db): function m008_fix_column_order_in_logs (line 147) | def m008_fix_column_order_in_logs(db): function m009_delete_logs_table_if_empty (line 168) | def m009_delete_logs_table_if_empty(db): function m010_create_new_log_tables (line 176) | def m010_create_new_log_tables(db): function m011_fts_for_responses (line 205) | def m011_fts_for_responses(db): function m012_attachments_tables (line 210) | def m012_attachments_tables(db): function m013_usage (line 236) | def m013_usage(db): function m014_schemas (line 243) | def m014_schemas(db): function m015_fragments_tables (line 261) | def m015_fragments_tables(db): function m016_fragments_table_pks (line 308) | def m016_fragments_table_pks(db): function m017_tools_tables (line 316) | def m017_tools_tables(db): function m017_tools_plugin (line 374) | def m017_tools_plugin(db): function m018_tool_instances (line 379) | def m018_tool_instances(db): function m019_resolved_model (line 396) | def m019_resolved_model(db): function m020_tool_results_attachments (line 403) | def m020_tool_results_attachments(db): function m021_tool_results_exception (line 419) | def m021_tool_results_exception(db): FILE: llm/models.py class Usage (line 48) | class Usage: class Attachment (line 55) | class Attachment: method id (line 62) | def id(self): method resolve_type (line 75) | def resolve_type(self): method content_bytes (line 89) | def content_bytes(self): method base64_content (line 100) | def base64_content(self): method __repr__ (line 103) | def __repr__(self): method from_row (line 116) | def from_row(cls, row): class Tool (line 127) | class Tool: method __post_init__ (line 134) | def __post_init__(self): method hash (line 138) | def hash(self): method function (line 150) | def function(cls, function, name=None, description=None): function _get_arguments_input_schema (line 171) | def _get_arguments_input_schema(function, name): class Toolbox (line 190) | class Toolbox: method __init_subclass__ (line 206) | def __init_subclass__(cls, **kwargs): method method_tools (line 232) | def method_tools(cls) -> List[Tool]: method tools (line 246) | def tools(self) -> Iterable[Tool]: method add_tool (line 259) | def add_tool( method prepare (line 276) | def prepare(self): method prepare_async (line 283) | async def prepare_async(self): class ToolCall (line 291) | class ToolCall: class ToolResult (line 298) | class ToolResult: class ToolOutput (line 308) | class ToolOutput: class CancelToolCall (line 322) | class CancelToolCall(Exception): class Prompt (line 327) | class Prompt: method __init__ (line 340) | def __init__( method prompt (line 370) | def prompt(self): method system (line 374) | def system(self): function _wrap_tools (line 383) | def _wrap_tools(tools: List[ToolDef]) -> List[Tool]: class _BaseConversation (line 398) | class _BaseConversation: method from_row (line 408) | def from_row(cls, row: Any) -> "_BaseConversation": class Conversation (line 413) | class Conversation(_BaseConversation): method prompt (line 417) | def prompt( method chain (line 451) | def chain( method from_row (line 493) | def from_row(cls, row): method __repr__ (line 502) | def __repr__(self): class AsyncConversation (line 509) | class AsyncConversation(_BaseConversation): method chain (line 513) | def chain( method prompt (line 554) | def prompt( method to_sync_conversation (line 588) | def to_sync_conversation(self): method from_row (line 599) | def from_row(cls, row): method __repr__ (line 608) | def __repr__(self): class _BaseResponse (line 634) | class _BaseResponse: method __init__ (line 645) | def __init__( method add_tool_call (line 679) | def add_tool_call(self, tool_call: ToolCall): method set_usage (line 682) | def set_usage( method set_resolved_model (line 693) | def set_resolved_model(self, model_id: str): method from_row (line 697) | def from_row(cls, db, row, _async=False): method token_usage (line 806) | def token_usage(self) -> str: method log_to_db (line 811) | def log_to_db(self, db): class Response (line 1003) | class Response(_BaseResponse): method on_done (line 1007) | def on_done(self, callback): method _on_done (line 1013) | def _on_done(self): method __str__ (line 1017) | def __str__(self) -> str: method _force (line 1020) | def _force(self): method text (line 1024) | def text(self) -> str: method text_or_raise (line 1028) | def text_or_raise(self) -> str: method execute_tool_calls (line 1031) | def execute_tool_calls( method tool_calls (line 1129) | def tool_calls(self) -> List[ToolCall]: method tool_calls_or_raise (line 1133) | def tool_calls_or_raise(self) -> List[ToolCall]: method json (line 1136) | def json(self) -> Optional[Dict[str, Any]]: method duration_ms (line 1140) | def duration_ms(self) -> int: method datetime_utc (line 1144) | def datetime_utc(self) -> str: method usage (line 1148) | def usage(self) -> Usage: method __iter__ (line 1156) | def __iter__(self) -> Iterator[str]: method __repr__ (line 1193) | def __repr__(self): class AsyncResponse (line 1200) | class AsyncResponse(_BaseResponse): method from_row (line 1205) | def from_row(cls, db, row, _async=False): method on_done (line 1208) | async def on_done(self, callback): method _on_done (line 1220) | async def _on_done(self): method execute_tool_calls (line 1229) | async def execute_tool_calls( method __aiter__ (line 1385) | def __aiter__(self): method __anext__ (line 1392) | async def __anext__(self) -> str: method _force (line 1432) | async def _force(self): method text_or_raise (line 1440) | def text_or_raise(self) -> str: method text (line 1445) | async def text(self) -> str: method tool_calls (line 1449) | async def tool_calls(self) -> List[ToolCall]: method tool_calls_or_raise (line 1453) | def tool_calls_or_raise(self) -> List[ToolCall]: method json (line 1458) | async def json(self) -> Optional[Dict[str, Any]]: method duration_ms (line 1462) | async def duration_ms(self) -> int: method datetime_utc (line 1466) | async def datetime_utc(self) -> str: method usage (line 1470) | async def usage(self) -> Usage: method __await__ (line 1478) | def __await__(self): method to_sync_response (line 1481) | async def to_sync_response(self) -> Response: method fake (line 1522) | def fake( method __repr__ (line 1545) | def __repr__(self): class _BaseChainResponse (line 1552) | class _BaseChainResponse: method __init__ (line 1558) | def __init__( method log_to_db (line 1579) | def log_to_db(self, db): class ChainResponse (line 1590) | class ChainResponse(_BaseChainResponse): method responses (line 1595) | def responses(self) -> Iterator[Response]: method __iter__ (line 1638) | def __iter__(self) -> Iterator[str]: method text (line 1642) | def text(self) -> str: class AsyncChainResponse (line 1646) | class AsyncChainResponse(_BaseChainResponse): method responses (line 1651) | async def responses(self) -> AsyncIterator[AsyncResponse]: method __aiter__ (line 1696) | async def __aiter__(self) -> AsyncIterator[str]: method text (line 1701) | async def text(self) -> str: class Options (line 1708) | class Options(BaseModel): class _get_key_mixin (line 1715) | class _get_key_mixin: method get_key (line 1720) | def get_key(self, explicit_key: Optional[str] = None) -> Optional[str]: class _BaseModel (line 1749) | class _BaseModel(ABC, _get_key_mixin): class Options (line 1757) | class Options(_Options): method _validate_attachments (line 1760) | def _validate_attachments( method __str__ (line 1773) | def __str__(self) -> str: method __repr__ (line 1780) | def __repr__(self) -> str: class _Model (line 1784) | class _Model(_BaseModel): method conversation (line 1785) | def conversation( method prompt (line 1800) | def prompt( method chain (line 1834) | def chain( class Model (line 1868) | class Model(_Model): method execute (line 1870) | def execute( class KeyModel (line 1880) | class KeyModel(_Model): method execute (line 1882) | def execute( class _AsyncModel (line 1893) | class _AsyncModel(_BaseModel): method conversation (line 1894) | def conversation( method prompt (line 1909) | def prompt( method chain (line 1943) | def chain( class AsyncModel (line 1977) | class AsyncModel(_AsyncModel): method execute (line 1979) | async def execute( class AsyncKeyModel (line 1991) | class AsyncKeyModel(_AsyncModel): method execute (line 1993) | async def execute( class EmbeddingModel (line 2006) | class EmbeddingModel(ABC, _get_key_mixin): method _check (line 2015) | def _check(self, item: Union[str, bytes]): method embed (line 2025) | def embed(self, item: Union[str, bytes]) -> List[float]: method embed_multi (line 2030) | def embed_multi( method embed_batch (line 2054) | def embed_batch(self, items: Iterable[Union[str, bytes]]) -> Iterator[... method __str__ (line 2060) | def __str__(self) -> str: method __repr__ (line 2063) | def __repr__(self) -> str: class ModelWithAliases (line 2068) | class ModelWithAliases: method matches (line 2073) | def matches(self, query: str) -> bool: class EmbeddingModelWithAliases (line 2085) | class EmbeddingModelWithAliases: method matches (line 2089) | def matches(self, query: str) -> bool: function _conversation_name (line 2097) | def _conversation_name(text): function _ensure_dict_schema (line 2105) | def _ensure_dict_schema(schema): function _remove_titles_recursively (line 2114) | def _remove_titles_recursively(obj): function _get_instance (line 2129) | def _get_instance(implementation): FILE: llm/plugins.py function load_plugins (line 21) | def load_plugins(): FILE: llm/templates.py class AttachmentType (line 6) | class AttachmentType(BaseModel): class Template (line 11) | class Template(BaseModel): class MissingVariables (line 30) | class MissingVariables(Exception): method __init__ (line 33) | def __init__(self, **data): method evaluate (line 39) | def evaluate( method vars (line 58) | def vars(self) -> set: method interpolate (line 67) | def interpolate(cls, text: Optional[str], params: Dict[str, Any]) -> O... method extract_vars (line 81) | def extract_vars(string_template: string.Template) -> List[str]: FILE: llm/tools.py function llm_version (line 6) | def llm_version() -> str: function llm_time (line 11) | def llm_time() -> dict: FILE: llm/utils.py class Fragment (line 24) | class Fragment(str): method __new__ (line 25) | def __new__(cls, content, *args, **kwargs): method __init__ (line 29) | def __init__(self, content, source=""): method id (line 33) | def id(self): function mimetype_from_string (line 37) | def mimetype_from_string(content) -> Optional[str]: function mimetype_from_path (line 45) | def mimetype_from_path(path) -> Optional[str]: function dicts_to_table_string (line 53) | def dicts_to_table_string( function remove_dict_none_values (line 77) | def remove_dict_none_values(d): class _LogResponse (line 97) | class _LogResponse(httpx.Response): method iter_bytes (line 98) | def iter_bytes(self, *args, **kwargs): class _LogTransport (line 104) | class _LogTransport(httpx.BaseTransport): method __init__ (line 105) | def __init__(self, transport: httpx.BaseTransport): method handle_request (line 108) | def handle_request(self, request: httpx.Request) -> httpx.Response: function _no_accept_encoding (line 118) | def _no_accept_encoding(request: httpx.Request): function _log_response (line 122) | def _log_response(response: httpx.Response): function logging_client (line 149) | def logging_client() -> httpx.Client: function simplify_usage_dict (line 156) | def simplify_usage_dict(d): function token_usage_string (line 171) | def token_usage_string(input_tokens, output_tokens, token_details) -> str: function extract_fenced_code_block (line 182) | def extract_fenced_code_block(text: str, last: bool = False) -> Optional... function make_schema_id (line 220) | def make_schema_id(schema: dict) -> Tuple[str, str]: function output_rows_as_json (line 226) | def output_rows_as_json(rows, nl=False, compact=False, json_cols=()): function resolve_schema_input (line 274) | def resolve_schema_input(db, schema_input, load_template): function schema_summary (line 312) | def schema_summary(schema: dict) -> str: function schema_dsl (line 354) | def schema_dsl(schema_dsl: str, multi: bool = False) -> Dict[str, Any]: function multi_schema (line 422) | def multi_schema(schema: dict) -> dict: function find_unused_key (line 431) | def find_unused_key(item: dict, key: str) -> str: function truncate_string (line 438) | def truncate_string( function ensure_fragment (line 478) | def ensure_fragment(db, content): function ensure_tool (line 495) | def ensure_tool(db, tool): function maybe_fenced_code (line 517) | def maybe_fenced_code(content: str) -> str: function has_plugin_prefix (line 549) | def has_plugin_prefix(value: str) -> bool: function _parse_kwargs (line 554) | def _parse_kwargs(arg_str: str) -> Dict[str, Any]: function instantiate_from_spec (line 608) | def instantiate_from_spec(class_map: Dict[str, Type], spec: str): function monotonic_ulid (line 688) | def monotonic_ulid() -> ULID: function _fresh (line 731) | def _fresh(ms: int) -> bytes: FILE: tests/conftest.py function pytest_configure (line 12) | def pytest_configure(config): function user_path (line 19) | def user_path(tmpdir): function logs_db (line 26) | def logs_db(user_path): function user_path_with_embeddings (line 31) | def user_path_with_embeddings(user_path): function templates_path (line 40) | def templates_path(user_path): function env_setup (line 47) | def env_setup(monkeypatch, user_path): class MockModel (line 51) | class MockModel(llm.Model): class Options (line 57) | class Options(llm.Options): method __init__ (line 62) | def __init__(self): method enqueue (line 67) | def enqueue(self, messages): method execute (line 71) | def execute(self, prompt, stream, response, conversation): class MockKeyModel (line 90) | class MockKeyModel(llm.KeyModel): method execute (line 94) | def execute(self, prompt, stream, response, conversation, key): class MockAsyncKeyModel (line 98) | class MockAsyncKeyModel(llm.AsyncKeyModel): method execute (line 102) | async def execute(self, prompt, stream, response, conversation, key): class AsyncMockModel (line 106) | class AsyncMockModel(llm.AsyncModel): method __init__ (line 110) | def __init__(self): method enqueue (line 115) | def enqueue(self, messages): method execute (line 119) | async def execute(self, prompt, stream, response, conversation): class EmbedDemo (line 138) | class EmbedDemo(llm.EmbeddingModel): method __init__ (line 143) | def __init__(self): method embed_batch (line 146) | def embed_batch(self, texts): class EmbedBinaryOnly (line 159) | class EmbedBinaryOnly(EmbedDemo): class EmbedTextOnly (line 165) | class EmbedTextOnly(EmbedDemo): function embed_demo (line 172) | def embed_demo(): function mock_model (line 177) | def mock_model(): function async_mock_model (line 182) | def async_mock_model(): function mock_key_model (line 187) | def mock_key_model(): function mock_async_key_model (line 192) | def mock_async_key_model(): function register_embed_demo_model (line 197) | def register_embed_demo_model(embed_demo, mock_model, async_mock_model): function register_echo_model (line 219) | def register_echo_model(): function mocked_openai_chat (line 235) | def mocked_openai_chat(httpx_mock): function mocked_openai_chat_returning_fenced_code (line 250) | def mocked_openai_chat_returning_fenced_code(httpx_mock): function stream_events (line 270) | def stream_events(): function mocked_openai_chat_stream (line 294) | def mocked_openai_chat_stream(httpx_mock): function mocked_openai_completion (line 304) | def mocked_openai_completion(httpx_mock): function stream_completion_events (line 328) | def stream_completion_events(): function mocked_openai_completion_logprobs_stream (line 400) | def mocked_openai_completion_logprobs_stream(httpx_mock): function mocked_openai_completion_logprobs (line 411) | def mocked_openai_completion_logprobs(httpx_mock): function mocked_localai (line 445) | def mocked_localai(httpx_mock): function collection (line 470) | def collection(): function vcr_config (line 478) | def vcr_config(): function extract_braces (line 482) | def extract_braces(s): FILE: tests/test_aliases.py function test_set_alias (line 10) | def test_set_alias(model_id_or_alias): function test_remove_alias (line 17) | def test_remove_alias(): function test_cli_aliases_list (line 28) | def test_cli_aliases_list(args): function test_cli_aliases_list_json (line 53) | def test_cli_aliases_list_json(args): function test_cli_aliases_set (line 82) | def test_cli_aliases_set(user_path, args, expected, expected_error): function test_cli_aliases_path (line 96) | def test_cli_aliases_path(user_path): function test_cli_aliases_remove (line 103) | def test_cli_aliases_remove(user_path): function test_cli_aliases_remove_invalid (line 111) | def test_cli_aliases_remove_invalid(user_path): function test_cli_aliases_are_registered (line 120) | def test_cli_aliases_are_registered(user_path, args): FILE: tests/test_async.py function test_async_model (line 6) | async def test_async_model(async_mock_model): function test_async_model_conversation (line 25) | async def test_async_model_conversation(async_mock_model): function test_async_on_done (line 38) | async def test_async_on_done(async_mock_model): function test_async_conversation (line 54) | async def test_async_conversation(async_mock_model): FILE: tests/test_attachments.py function test_prompt_attachment (line 29) | def test_prompt_attachment(mock_model, logs_db, attachment_type, attachm... function _count_open_fds (line 64) | def _count_open_fds(): function test_attachment_no_file_descriptor_leak (line 79) | def test_attachment_no_file_descriptor_leak(tmp_path): FILE: tests/test_chat.py function test_chat_basic (line 12) | def test_chat_basic(mock_model, logs_db): function test_chat_system (line 134) | def test_chat_system(mock_model, logs_db): function test_chat_options (line 178) | def test_chat_options(mock_model, logs_db, user_path): function test_chat_multi (line 269) | def test_chat_multi(mock_model, logs_db, input, expected): function test_llm_chat_creates_log_database (line 283) | def test_llm_chat_creates_log_database(tmpdir, monkeypatch, custom_datab... function test_chat_tools (line 309) | def test_chat_tools(logs_db): function test_chat_fragments (line 374) | def test_chat_fragments(tmpdir): FILE: tests/test_chat_templates.py function test_chat_template_system_only_no_duplicate_prompt (line 8) | def test_chat_template_system_only_no_duplicate_prompt( function test_chat_system_fragments_only_first_turn (line 34) | def test_chat_system_fragments_only_first_turn(tmpdir, mock_model, logs_... function test_chat_template_loads_tools_into_logs (line 66) | def test_chat_template_loads_tools_into_logs(logs_db, templates_path): FILE: tests/test_cli_openai_models.py function mocked_models (line 8) | def mocked_models(httpx_mock): function test_openai_models (line 33) | def test_openai_models(mocked_models): function test_openai_options_min_max (line 44) | def test_openai_options_min_max(): function test_only_gpt4_audio_preview_allows_mp3_or_wav (line 64) | def test_only_gpt4_audio_preview_allows_mp3_or_wav(httpx_mock, model, fi... function test_gpt4o_mini_sync_and_async (line 151) | def test_gpt4o_mini_sync_and_async(monkeypatch, tmpdir, httpx_mock, asyn... FILE: tests/test_cli_options.py function test_set_model_default_options (line 27) | def test_set_model_default_options(user_path, args, expected_options, ex... function test_model_options_list_and_show (line 42) | def test_model_options_list_and_show(user_path): function test_model_options_clear (line 61) | def test_model_options_clear(user_path): function test_prompt_uses_model_options (line 84) | def test_prompt_uses_model_options(user_path): FILE: tests/test_embed.py function test_demo_plugin (line 9) | def test_demo_plugin(): function test_embed_huge_list (line 21) | def test_embed_huge_list(batch_size, expected_batches): function test_embed_store (line 37) | def test_embed_store(collection): function test_embed_metadata (line 46) | def test_embed_metadata(collection): function test_collection (line 58) | def test_collection(collection): function test_similar (line 88) | def test_similar(collection): function test_similar_prefixed (line 96) | def test_similar_prefixed(collection): function test_similar_by_id (line 103) | def test_similar_by_id(collection): function test_embed_multi (line 118) | def test_embed_multi(with_metadata, batch_size, expected_batches): function test_collection_delete (line 149) | def test_collection_delete(collection): function test_binary_only_and_text_only_embedding_models (line 158) | def test_binary_only_and_text_only_embedding_models(): FILE: tests/test_embed_cli.py function test_embed_output_format (line 44) | def test_embed_output_format(tmpdir, format_, expected, scenario): function test_embed_errors (line 66) | def test_embed_errors(args, expected_error): function test_embed_store (line 83) | def test_embed_store(user_path, metadata, metadata_error): function test_embed_store_binary (line 151) | def test_embed_store_binary(user_path): function test_collection_delete_errors (line 177) | def test_collection_delete_errors(user_path): function test_similar_errors (line 200) | def test_similar_errors(args, expected_error, user_path_with_embeddings): function test_similar_by_id_cli (line 207) | def test_similar_by_id_cli(user_path_with_embeddings): function test_similar_by_id_cli_output_plain (line 220) | def test_similar_by_id_cli_output_plain(user_path_with_embeddings, option): function test_similar_by_content_cli (line 232) | def test_similar_by_content_cli(tmpdir, user_path_with_embeddings, scena... function test_similar_by_content_prefixed (line 286) | def test_similar_by_content_prefixed( function test_embed_multi_file_input (line 317) | def test_embed_multi_file_input(tmpdir, use_stdin, prefix, prepend, file... function test_embed_multi_files_binary_store (line 348) | def test_embed_multi_files_binary_store(tmpdir): function test_embed_multi_sql (line 380) | def test_embed_multi_sql(tmpdir, use_other_db, prefix, prepend): function test_embed_multi_batch_size (line 433) | def test_embed_multi_batch_size(embed_demo, tmpdir): function multi_files (line 468) | def multi_files(tmpdir): function test_embed_multi_files (line 489) | def test_embed_multi_files(multi_files, scenario, prepend): function test_embed_multi_files_errors (line 562) | def test_embed_multi_files_errors(multi_files, args, expected_error): function test_embed_multi_files_encoding (line 583) | def test_embed_multi_files_encoding(multi_files, extra_args, expected_er... function test_default_embedding_model (line 618) | def test_default_embedding_model(): function test_llm_embed_models_query (line 648) | def test_llm_embed_models_query(user_path, args, expected_model_id): function test_default_embed_model_errors (line 657) | def test_default_embed_model_errors(user_path, default_is_set, command): function test_duplicate_content_embedded_only_once (line 689) | def test_duplicate_content_embedded_only_once(embed_demo): FILE: tests/test_encode_decode.py function test_roundtrip (line 13) | def test_roundtrip(array): FILE: tests/test_fragments_cli.py function test_fragments_set_show_remove (line 11) | def test_fragments_set_show_remove(user_path): function test_fragments_list (line 70) | def test_fragments_list(user_path): function test_fragment_url_user_agent (line 130) | def test_fragment_url_user_agent(mocked_openai_chat, user_path): FILE: tests/test_keys.py function test_keys_in_user_path (line 11) | def test_keys_in_user_path(monkeypatch, env, user_path): function test_keys_set (line 25) | def test_keys_set(monkeypatch, tmpdir): function test_keys_get (line 44) | def test_keys_get(monkeypatch, tmpdir): function test_keys_list (line 56) | def test_keys_list(monkeypatch, tmpdir, args): function test_uses_correct_key (line 70) | def test_uses_correct_key(mocked_openai_chat, monkeypatch, tmpdir): FILE: tests/test_llm.py function test_version (line 14) | def test_version(): function test_llm_prompt_creates_log_database (line 23) | def test_llm_prompt_creates_log_database( function test_llm_default_prompt (line 59) | def test_llm_default_prompt( function test_llm_prompt_continue (line 157) | def test_llm_prompt_continue(httpx_mock, user_path, async_): function test_extract_fenced_code (line 217) | def test_extract_fenced_code( function test_openai_chat_stream (line 233) | def test_openai_chat_stream(mocked_openai_chat_stream, user_path): function test_openai_completion (line 240) | def test_openai_completion(mocked_openai_completion, user_path): function test_openai_completion_system_prompt_error (line 284) | def test_openai_completion_system_prompt_error(): function test_openai_completion_logprobs_stream (line 305) | def test_openai_completion_logprobs_stream( function test_openai_completion_logprobs_nostream (line 343) | def test_openai_completion_logprobs_nostream( function test_openai_localai_configuration (line 404) | def test_openai_localai_configuration(mocked_localai, user_path): function test_prompt_select_model_with_queries (line 443) | def test_prompt_select_model_with_queries(mock_model, user_path, args, e... function test_llm_models_options (line 493) | def test_llm_models_options(user_path): function test_llm_models_async (line 507) | def test_llm_models_async(user_path): function test_llm_models_filter (line 532) | def test_llm_models_filter(user_path, args, expected_model_ids, unexpect... function test_llm_user_dir (line 544) | def test_llm_user_dir(tmpdir, monkeypatch): function test_model_defaults (line 553) | def test_model_defaults(tmpdir, monkeypatch): function test_get_models (line 566) | def test_get_models(): function test_get_async_models (line 578) | def test_get_async_models(): function test_mock_model (line 589) | def test_mock_model(mock_model): class Dog (line 603) | class Dog(BaseModel): function test_schema (line 621) | def test_schema(mock_model, use_pydantic): function test_model_environment_variable (line 631) | def test_model_environment_variable(monkeypatch): function test_schema_via_cli (line 650) | def test_schema_via_cli(mock_model, tmpdir, monkeypatch, use_filename): function test_schema_using_dsl (line 717) | def test_schema_using_dsl(mock_model, tmpdir, monkeypatch, args, expected): function test_schema_async (line 735) | async def test_schema_async(async_mock_model, use_pydantic): function test_mock_key_model (line 744) | def test_mock_key_model(mock_key_model): function test_mock_async_key_model (line 750) | async def test_mock_async_key_model(mock_async_key_model): function test_sync_on_done (line 756) | def test_sync_on_done(mock_model): function test_schemas_dsl (line 771) | def test_schemas_dsl(): function test_llm_prompt_continue_with_database (line 807) | def test_llm_prompt_continue_with_database( function test_default_exports (line 861) | def test_default_exports(): FILE: tests/test_llm_logs.py function log_path (line 23) | def log_path(user_path): function schema_log_path (line 46) | def schema_log_path(user_path): function test_logs_text (line 92) | def test_logs_text(log_path, usage): function test_logs_text_with_options (line 138) | def test_logs_text_with_options(user_path): function test_logs_json (line 175) | def test_logs_json(n, log_path): function test_logs_response_only (line 196) | def test_logs_response_only(args, log_path): function test_logs_extract_first_code (line 217) | def test_logs_extract_first_code(args, log_path): function test_logs_extract_last_code (line 236) | def test_logs_extract_last_code(args, log_path): function test_logs_short (line 246) | def test_logs_short(log_path, arg, usage): function test_logs_path (line 285) | def test_logs_path(monkeypatch, env, user_path): function test_logs_filtered (line 300) | def test_logs_filtered(user_path, model, path_option): function test_logs_search (line 344) | def test_logs_search(user_path, query, extra_args, expected): function test_logs_schema (line 407) | def test_logs_schema(schema_log_path, args, expected): function test_logs_schema_data_ids (line 418) | def test_logs_schema_data_ids(schema_log_path): function test_schemas_list_yaml (line 492) | def test_schemas_list_yaml(schema_log_path, args, expected): function test_schemas_list_json (line 499) | def test_schemas_list_json(schema_log_path, is_nl): function fragments_fixture (line 520) | def fragments_fixture(user_path): function test_logs_fragments (line 664) | def test_logs_fragments(fragments_fixture, fragment_refs, expected): function test_logs_fragments_markdown (line 713) | def test_logs_fragments_markdown(fragments_fixture): function test_expand_fragment_json (line 896) | def test_expand_fragment_json(fragments_fixture, arg): function test_expand_fragment_markdown (line 916) | def test_expand_fragment_markdown(fragments_fixture): function test_logs_tools (line 935) | def test_logs_tools(logs_db): function test_logs_backup (line 970) | def test_logs_backup(logs_db): function test_logs_resolved_model (line 987) | def test_logs_resolved_model(logs_db, mock_model, async_mock_model, asyn... FILE: tests/test_migrate.py function test_migrate_blank (line 27) | def test_migrate_blank(): function test_migrate_from_original_schema (line 55) | def test_migrate_from_original_schema(has_record): function test_migrations_with_legacy_alter_table (line 94) | def test_migrations_with_legacy_alter_table(): function test_migrations_for_embeddings (line 101) | def test_migrations_for_embeddings(): function test_backfill_content_hash (line 119) | def test_backfill_content_hash(): FILE: tests/test_plugins.py function test_register_commands (line 13) | def test_register_commands(): function test_register_template_loaders (line 48) | def test_register_template_loaders(): function test_register_fragment_loaders (line 98) | def test_register_fragment_loaders(logs_db, httpx_mock): function test_register_tools (line 200) | def test_register_tools(tmpdir, logs_db): class Memory (line 508) | class Memory(llm.Toolbox): method _get_memory (line 511) | def _get_memory(self): method set (line 516) | def set(self, key: str, value: str): method get (line 520) | def get(self, key: str): method append (line 524) | def append(self, key: str, value: str): method keys (line 529) | def keys(self): class Filesystem (line 534) | class Filesystem(llm.Toolbox): method __init__ (line 535) | def __init__(self, path: str): method list_files (line 538) | async def list_files(self): class ToolboxPlugin (line 543) | class ToolboxPlugin: method register_tools (line 547) | def register_tools(self, register): function test_register_toolbox (line 552) | def test_register_toolbox(tmpdir, logs_db): function test_register_toolbox_fails_on_bad_class (line 853) | def test_register_toolbox_fails_on_bad_class(): function test_toolbox_logging_async (line 874) | def test_toolbox_logging_async(logs_db, tmpdir): function test_plugins_command (line 971) | def test_plugins_command(): FILE: tests/test_templates.py function test_template_evaluate (line 36) | def test_template_evaluate( function test_templates_list_no_templates_found (line 50) | def test_templates_list_no_templates_found(): function test_templates_list (line 58) | def test_templates_list(templates_path, args): function test_templates_prompt_save (line 154) | def test_templates_prompt_save(templates_path, args, expected, expected_... function test_templates_error_on_missing_schema (line 178) | def test_templates_error_on_missing_schema(templates_path): function test_execute_prompt_with_a_template (line 304) | def test_execute_prompt_with_a_template( function test_execute_prompt_from_template_url (line 376) | def test_execute_prompt_from_template_url(httpx_mock, template, expected): function test_execute_prompt_from_template_path (line 396) | def test_execute_prompt_from_template_path(): function test_template_respects_cli_extract_flag (line 416) | def test_template_respects_cli_extract_flag( class Greeting (line 437) | class Greeting(Toolbox): method __init__ (line 438) | def __init__(self, greeting: str): method greet (line 441) | def greet(self, name: str) -> str: class GreetingsPlugin (line 446) | class GreetingsPlugin: method register_tools (line 450) | def register_tools(self, register): function test_tools_in_templates (line 464) | def test_tools_in_templates( FILE: tests/test_tools.py function test_tool_use_basic (line 18) | def test_tool_use_basic(vcr): function test_tool_use_chain_of_two_calls (line 73) | def test_tool_use_chain_of_two_calls(vcr): function test_tool_use_async_tool_function (line 104) | def test_tool_use_async_tool_function(): function test_async_tools_run_tools_in_parallel (line 133) | async def test_async_tools_run_tools_in_parallel(): function test_async_toolbox (line 180) | async def test_async_toolbox(): function test_toolbox_add_tool (line 206) | def test_toolbox_add_tool(): function test_toolbox_add_tool_with_pass_self (line 235) | def test_toolbox_add_tool_with_pass_self(): function test_conversation_with_tools (line 260) | def test_conversation_with_tools(vcr): function test_default_tool_llm_version (line 290) | def test_default_tool_llm_version(): function test_cli_tools_with_options (line 306) | def test_cli_tools_with_options(): function test_functions_tool_locals (line 327) | def test_functions_tool_locals(): function test_default_tool_llm_time (line 345) | def test_default_tool_llm_time(): function test_incorrect_tool_usage (line 372) | def test_incorrect_tool_usage(): function test_tool_returning_attachment (line 386) | def test_tool_returning_attachment(): function test_async_tool_returning_attachment (line 410) | async def test_async_tool_returning_attachment(): function test_tool_conversation_settings (line 433) | def test_tool_conversation_settings(): function test_tool_conversation_settings_async (line 455) | async def test_tool_conversation_settings_async(): function test_tool_errors (line 482) | def test_tool_errors(async_): function test_chain_sync_cancel_only_first_of_two (line 522) | def test_chain_sync_cancel_only_first_of_two(): function test_chain_async_cancel_only_first_of_two (line 562) | async def test_chain_async_cancel_only_first_of_two(): FILE: tests/test_tools_streaming.py function test_tools_streaming_variant_a (line 11) | def test_tools_streaming_variant_a(): function test_tools_streaming_variant_b (line 21) | def test_tools_streaming_variant_b(): function test_tools_streaming_variant_c (line 31) | def test_tools_streaming_variant_c(): FILE: tests/test_utils.py function test_simplify_usage_dict (line 51) | def test_simplify_usage_dict(input_data, expected_output): function test_extract_fenced_code_block (line 112) | def test_extract_fenced_code_block(input, last, expected): function test_schema_dsl (line 223) | def test_schema_dsl(schema, expected): function test_schema_dsl_multi (line 228) | def test_schema_dsl_multi(): function test_truncate_string (line 293) | def test_truncate_string(text, max_length, normalize_whitespace, keep_en... function test_test_truncate_string_keep_end (line 318) | def test_test_truncate_string_keep_end( function test_maybe_fenced_code (line 361) | def test_maybe_fenced_code(content: str, expected_fenced: bool): function test_backtick_count_adjustment (line 386) | def test_backtick_count_adjustment(content: str, backtick_count: int): class Files (line 400) | class Files: method __init__ (line 401) | def __init__(self, dir="."): class ValueFlag (line 405) | class ValueFlag: method __init__ (line 406) | def __init__(self, value=None, flag=False): function test_instantiate_valid (line 428) | def test_instantiate_valid(spec, expected_cls, expected_attrs): function test_instantiate_invalid (line 447) | def test_instantiate_invalid(spec): function test_get_key (line 452) | def test_get_key(user_path, monkeypatch): function test_monotonic_ulids (line 466) | def test_monotonic_ulids(): function test_toolbox_config_capture (line 471) | def test_toolbox_config_capture():