{"id":29718246,"url":"https://github.com/aygp-dr/llm-function-actors","last_synced_at":"2026-02-07T03:02:00.603Z","repository":{"id":305873790,"uuid":"1024223094","full_name":"aygp-dr/llm-function-actors","owner":"aygp-dr","description":"Two-actor pattern implementation for LLM function calling in Guile Scheme. Demonstrates message passing, async actors, and extensible function registry for AI tool use.","archived":false,"fork":false,"pushed_at":"2025-07-24T09:07:13.000Z","size":141,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-31T00:40:23.512Z","etag":null,"topics":["actor-model","ai-agents","function-calling","guile","llm","scheme"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aygp-dr.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-07-22T11:15:15.000Z","updated_at":"2025-08-02T21:07:06.000Z","dependencies_parsed_at":"2025-07-22T13:18:21.641Z","dependency_job_id":"243ab123-84b5-45b0-81c1-8fe0a9af002f","html_url":"https://github.com/aygp-dr/llm-function-actors","commit_stats":null,"previous_names":["aygp-dr/llm-function-actors"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aygp-dr/llm-function-actors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fllm-function-actors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fllm-function-actors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fllm-function-actors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fllm-function-actors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aygp-dr","download_url":"https://codeload.github.com/aygp-dr/llm-function-actors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aygp-dr%2Fllm-function-actors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29185112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"online","status_checked_at":"2026-02-07T02:00:07.217Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["actor-model","ai-agents","function-calling","guile","llm","scheme"],"created_at":"2025-07-24T09:40:18.470Z","updated_at":"2026-02-07T03:02:00.596Z","avatar_url":"https://github.com/aygp-dr.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: LLM Function Calling Pattern - Two Actor System\n#+PROPERTY: header-args :mkdirp yes :comments both\n\n[[https://img.shields.io/badge/language-Guile%20Scheme-blue.svg]]\n[[https://img.shields.io/badge/license-MIT-green.svg]]\n[[https://img.shields.io/badge/platform-FreeBSD%20%7C%20Linux-lightgrey.svg]]\n\nA Guile Scheme implementation demonstrating the interaction between an Application (Actor 1) and an LLM Provider (Actor 2) for function calling capabilities.\n\n#+begin_src ditaa :file llm-function-arch.png :exports results\n    +---------------+       +---------------+\n    |  Application  |\u003c-----\u003e|      LLM      |\n    |     Actor     |       |     Actor     |\n    +-------+-------+       +-------+-------+\n            |                       |\n            v                       v\n    +-------+-------+       +-------+-------+\n    |   Function    |       |   Decision    |\n    |   Registry    |       |    Engine     |\n    +---------------+       +---------------+\n#+end_src\n\n#+begin_src mermaid :file llm-function-calling-flow.png :exports results\ngraph TD\n    A[User Prompt] --\u003e B{Analyze Intent}\n    B --\u003e C{Tool Relevant?}\n    \n    C --\u003e|Yes| D[Select Tool]\n    C --\u003e|No| E[Direct Response]\n    \n    D --\u003e F{Parameters Clear?}\n    F --\u003e|Yes| G[Call Function]\n    F --\u003e|No| H[Ask Clarification]\n    \n    G --\u003e I{Need More Tools?}\n    I --\u003e|Yes| D\n    I --\u003e|No| J[Generate Response]\n    \n    H --\u003e K[User Clarifies]\n    K --\u003e F\n    \n    E --\u003e L[Return Answer]\n    J --\u003e L\n    \n    style A fill:#f9f,stroke:#333,stroke-width:2px\n    style L fill:#9f9,stroke:#333,stroke-width:2px\n    style C fill:#ff9,stroke:#333,stroke-width:2px\n    style I fill:#ff9,stroke:#333,stroke-width:2px\n#+end_src\n\n[[./docs/llm-function-calling-sequence.mmd][View detailed sequence diagram]]\n\n#+begin_src dot :file llm-function-states.png :cmd dot :cmdline -Tpng :exports results\ndigraph G {\n    rankdir=TB;\n    node [shape=box, style=rounded];\n    \n    Start [shape=circle, label=\"\"];\n    Idle [label=\"Idle\"];\n    Prompt [label=\"Prompt\\nReceived\"];\n    Request [label=\"Preparing\\nRequest\"];\n    Waiting [label=\"Waiting\\nfor LLM\"];\n    Processing [label=\"Processing\\nResponse\"];\n    FunctionCall [label=\"Function Call\\nDetected\"];\n    Execute [label=\"Executing\\nFunction\"];\n    Final [label=\"Final\\nAnswer\"];\n    End [shape=doublecircle, label=\"\"];\n    \n    Start -\u003e Idle;\n    Idle -\u003e Prompt [label=\"User Input\"];\n    Prompt -\u003e Request;\n    Request -\u003e Waiting [label=\"Send Request\"];\n    Waiting -\u003e Processing;\n    Processing -\u003e FunctionCall [label=\"Has Tool Call\"];\n    Processing -\u003e Final [label=\"Direct Response\"];\n    FunctionCall -\u003e Execute;\n    Execute -\u003e Waiting [label=\"Send Result\"];\n    Final -\u003e End;\n}\n#+end_src\n\n** Overview\n\nThis project implements a two-actor pattern for LLM function calling, providing:\n- Clear separation between application logic and LLM reasoning\n- Asynchronous message passing between actors\n- Extensible function registry\n- Thread-safe communication channels\n\n** Architecture\n\nThe system consists of two main actors:\n\n1. *Application Actor*: Manages function definitions, executes requested functions, and handles results\n2. *LLM Actor*: Processes prompts, decides whether to call functions or respond directly, and generates final answers\n\nCommunication happens through message queues with defined message types for each phase of interaction.\n\n** Requirements\n\n- GNU Guile 3.0 or later\n- SRFI modules (srfi-1, srfi-9)\n- ice-9 modules (match, format, threads)\n\n** Installation\n\n#+begin_src bash\ngit clone https://github.com/aygp-dr/llm-function-actors\ncd llm-function-actors\n#+end_src\n\n** Usage\n\n*** Run the simulator\n#+begin_src bash\ngmake run\n#+end_src\n\n*** Run demo examples\n#+begin_src bash\ngmake demo\n# or directly:\n./examples/function-calling-demo.scm\n#+end_src\n\n*** Available Functions\n\nThe simulator comes with two built-in functions:\n- ~calculate~: Adds two numbers\n- ~get-time~: Returns current timestamp\n\nAdditional functions can be registered:\n#+begin_src scheme\n(register-function! 'my-function\n                    (lambda (arg1 arg2)\n                      ;; function implementation\n                      result))\n#+end_src\n\n** Project Structure\n\n#+begin_example\n.\n├── SETUP.org           # Original design document\n├── README.org          # This file\n├── Makefile            # Build automation\n├── src/\n│   └── function-calling-simulator.scm  # Main simulator\n├── examples/\n│   └── function-calling-demo.scm       # Usage examples\n└── docs/\n    ├── function-flow.org               # Sequence diagrams\n    └── pattern-analysis.org            # Architecture analysis\n#+end_example\n\n** Message Flow\n\n1. Application sends initial prompt with function definitions\n2. LLM analyzes prompt and decides action\n3. If function needed: LLM requests function execution\n4. Application executes function and returns result\n5. LLM incorporates result and generates final answer\n\n** Extending the System\n\nTo add new capabilities:\n\n1. Register new functions using ~register-function!~\n2. Extend message types for new interaction patterns\n3. Add error handling for production use\n4. Implement timeout mechanisms for long-running functions\n\n** License\n\nThis project is part of the aygp-dr repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fllm-function-actors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faygp-dr%2Fllm-function-actors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faygp-dr%2Fllm-function-actors/lists"}