{"id":28469824,"url":"https://github.com/answerdotai/dialoghelper","last_synced_at":"2026-04-14T00:11:34.827Z","repository":{"id":292620937,"uuid":"980963080","full_name":"AnswerDotAI/dialoghelper","owner":"AnswerDotAI","description":"Helper functions for solveit dialogs","archived":false,"fork":false,"pushed_at":"2026-03-06T10:49:01.000Z","size":2245,"stargazers_count":21,"open_issues_count":4,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-06T14:47:47.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://answerdotai.github.io/dialoghelper/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnswerDotAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-10T03:32:36.000Z","updated_at":"2026-03-06T10:47:51.000Z","dependencies_parsed_at":"2025-06-05T00:49:07.529Z","dependency_job_id":"a827f1a2-aa54-4ba3-ab82-2aaf8986f435","html_url":"https://github.com/AnswerDotAI/dialoghelper","commit_stats":null,"previous_names":["answerdotai/dialoghelper"],"tags_count":103,"template":false,"template_full_name":null,"purl":"pkg:github/AnswerDotAI/dialoghelper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fdialoghelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fdialoghelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fdialoghelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fdialoghelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnswerDotAI","download_url":"https://codeload.github.com/AnswerDotAI/dialoghelper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fdialoghelper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30460818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T09:08:47.789Z","updated_at":"2026-03-13T07:02:16.631Z","avatar_url":"https://github.com/AnswerDotAI.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dialoghelper\n\nA Python library for programmatic dialog manipulation in [Solveit](https://solve.it.com), fast.ai's Dialog Engineering web application. It provides both user-callable functions and AI-accessible tools for creating, reading, updating, and managing dialog messages.\n\n## What is Solveit?\n\n**Solveit** is a \"Dialog Engineering\" web application that combines interactive code execution with AI assistance. Unlike ChatGPT (pure chat) or Jupyter (pure code), Solveit merges both paradigms into a single workspace.\n\n### Core Concepts\n\n- **Instance**: A persistent Linux container with your files and running kernels. Each user can have multiple instances.\n- **Dialog**: An `.ipynb` file containing messages. Like a Jupyter notebook, but with AI integration. Each open dialog runs its own Python kernel.\n- **Message**: The fundamental unit—similar to a Jupyter cell, but with three types:\n\n| Type | Purpose | Example |\n|------|---------|---------|\n| `code` | Python execution | `print(\"hello\")` |\n| `note` | Markdown documentation | `# My Notes` |\n| `prompt` | AI interaction | \"Explain this function\" |\n\n### How AI Context Works\n\nWhen you send a prompt to the AI:\n\n1. **All messages above** the current prompt are collected\n2. Messages marked as \"hidden\" (`skipped=True`) are excluded\n3. If context exceeds the model limit, oldest non-pinned messages are dropped\n4. The AI sees code, outputs, notes, and previous prompts/responses\n\nKey implications:\n- Working at the **bottom** of a dialog = **more context** (all messages above)\n- Working **higher up** = less context\n- **Pinning** a message (`p` key) keeps it in context even when truncation occurs\n\n### Tools: AI-Callable Functions\n\nSolveit lets the AI call Python functions directly. Users declare tools in messages using `\u0026` followed by backticks:\n\n```\n\u0026`my_function`                    # Expose single tool\n\u0026`[func1, func2, func3]`          # Expose multiple tools\n```\n\nWhen the AI needs to use a tool, Solveit executes it in the kernel and returns the result.\n\n## Installation\n\nThe latest version is always pre-installed in Solveit. To manually install (not recommended):\n\n```bash\npip install dialoghelper\n```\n\n## What is dialoghelper?\n\ndialoghelper is a programmatic interface to Solveit dialogs. It enables:\n\n- **Dialog manipulation**: Add, update, delete, and search messages\n- **AI tool integration**: Expose functions as tools the AI can call\n- **Context generation**: Convert folders, repos, and symbols into AI context\n- **Screen capture**: Capture browser screenshots for AI analysis\n- **Tmux integration**: Read terminal buffers from tmux sessions\n\n## Modules\n\n| Module | Source Notebook | Description |\n|--------|-----------------|-------------|\n| `core` | `nbs/00_core.ipynb` | Core dialog manipulation (add/update/delete messages, search, context helpers) |\n| `capture` | `nbs/01_capture.ipynb` | Screen capture functionality for AI vision |\n| `inspecttools` | `nbs/02_inspecttools.ipynb` | Symbol inspection (`symsrc`, `getval`, `getdir`, etc.) |\n| `tmux` | `nbs/03_tmux.ipynb` | Tmux buffer reading tools |\n| `stdtools` | — | Re-exports all tools from dialoghelper + fastcore.tools |\n\n## Solveit Tools\n\n**Tools** are functions the AI can call directly during a conversation. A function is usable as a tool if it has:\n\n1. **Type annotations** for ALL parameters\n2. **A docstring** describing what it does\n\n```python\n# Valid tool\ndef greet(name: str) -\u003e str:\n    \"Greet someone by name\"\n    return f\"Hello, {name}!\"\n\n# Not a tool (missing type annotation)\ndef greet(name):\n    \"Greet someone by name\"\n    return f\"Hello, {name}!\"\n\n# Not a tool (missing docstring)\ndef greet(name: str) -\u003e str: return f\"Hello, {name}!\"\n```\n\n### Exposing Tools to the AI\n\nIn a Solveit dialog, reference tools using `\u0026` followed by backticks:\n\n```\n\u0026`greet`                           # Single tool\n\u0026`[add_msg, update_msg, del_msg]`  # Multiple tools\n```\n\n### Tool Info Functions\n\nThese functions add notes to your dialog listing available tools:\n\n| Function | Lists tools from |\n|----------|------------------|\n| `tool_info()` | `dialoghelper.core` |\n| `fc_tool_info()` | `fastcore.tools` (rg, sed, view, create, etc.) |\n| `inspect_tool_info()` | `dialoghelper.inspecttools` |\n| `tmux_tool_info()` | `dialoghelper.tmux` |\n\n### Tools vs Programmatic Functions\n\nSome functions are designed for AI tool use; others are meant to be called directly from code:\n\n| AI Tools | Programmatic Use |\n|----------|------------------|\n| `add_msg`, `update_msg`, `del_msg` |  |\n| `find_msgs`, `read_msg`, `view_dlg` | `call_endp` (raw endpoint access) |\n| `symsrc`, `getval`, `getdir` | `resolve` (returns actual Python object) |\n\n## Usage Examples\n\n```python\nfrom dialoghelper import *\n\n# Add a note message\nadd_msg(\"Hello from code!\", msg_type='note')\n\n# Add a code message\nadd_msg(\"print('Hello')\", msg_type='code')\n\n# Search for messages\nresults = find_msgs(\"pattern\", msg_type='code')\n\n# View entire dialog structure\nprint(view_dlg())\n\n# Generate context from a folder\nctx_folder('.', types='py', max_total=5000)\n```\n\n## Development: nbdev Project Structure\n\ndialoghelper is an [nbdev](https://nbdev.fast.ai) project. **Notebooks are the source of truth**—the `.py` files are auto-generated.\n\n### Notebook ↔ Python File Mapping\n\n| Notebook | Generated File |\n|----------|----------------|\n| `nbs/00_core.ipynb` | `dialoghelper/core.py` |\n| `nbs/01_capture.ipynb` | `dialoghelper/capture.py` |\n| `nbs/02_inspecttools.ipynb` | `dialoghelper/inspecttools.py` |\n| `nbs/03_tmux.ipynb` | `dialoghelper/tmux.py` |\n\n### Workflow\n\n1. Edit notebooks in `nbs/`\n2. Run `nbdev_export()` to generate `.py` files\n3. Never edit `.py` files directly—they'll be overwritten\n\n## License\n\nApache 2.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Fdialoghelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanswerdotai%2Fdialoghelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Fdialoghelper/lists"}