llm-function 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. llm_function/.paa.tracking/.paa.config +12 -0
  2. llm_function/.paa.tracking/.paa.version +1 -0
  3. llm_function/.paa.tracking/git/dependencies/llm_func_deps/llm_function_config.py +35 -0
  4. llm_function/.paa.tracking/git/dependencies/llm_func_deps/tool_registry.py +250 -0
  5. llm_function/.paa.tracking/git/docs_cache/llm_function.md +0 -0
  6. llm_function/.paa.tracking/git/module/llm_function.py +250 -0
  7. llm_function/.paa.tracking/git/tracking/release_notes.md +5 -0
  8. llm_function/.paa.tracking/git_repo/COMMIT_EDITMSG +1 -0
  9. llm_function/.paa.tracking/git_repo/HEAD +1 -0
  10. llm_function/.paa.tracking/git_repo/config +8 -0
  11. llm_function/.paa.tracking/git_repo/description +1 -0
  12. llm_function/.paa.tracking/git_repo/hooks/applypatch-msg.sample +15 -0
  13. llm_function/.paa.tracking/git_repo/hooks/commit-msg.sample +24 -0
  14. llm_function/.paa.tracking/git_repo/hooks/fsmonitor-watchman.sample +174 -0
  15. llm_function/.paa.tracking/git_repo/hooks/post-update.sample +8 -0
  16. llm_function/.paa.tracking/git_repo/hooks/pre-applypatch.sample +14 -0
  17. llm_function/.paa.tracking/git_repo/hooks/pre-commit.sample +49 -0
  18. llm_function/.paa.tracking/git_repo/hooks/pre-merge-commit.sample +13 -0
  19. llm_function/.paa.tracking/git_repo/hooks/pre-push.sample +53 -0
  20. llm_function/.paa.tracking/git_repo/hooks/pre-rebase.sample +169 -0
  21. llm_function/.paa.tracking/git_repo/hooks/pre-receive.sample +24 -0
  22. llm_function/.paa.tracking/git_repo/hooks/prepare-commit-msg.sample +42 -0
  23. llm_function/.paa.tracking/git_repo/hooks/push-to-checkout.sample +78 -0
  24. llm_function/.paa.tracking/git_repo/hooks/sendemail-validate.sample +77 -0
  25. llm_function/.paa.tracking/git_repo/hooks/update.sample +128 -0
  26. llm_function/.paa.tracking/git_repo/index +0 -0
  27. llm_function/.paa.tracking/git_repo/info/exclude +6 -0
  28. llm_function/.paa.tracking/git_repo/logs/HEAD +1 -0
  29. llm_function/.paa.tracking/git_repo/logs/refs/heads/master +1 -0
  30. llm_function/.paa.tracking/git_repo/objects/13/9201e8ffeb4e42262e90eeaefd5267debb6e1d +1 -0
  31. llm_function/.paa.tracking/git_repo/objects/23/d10b479e3102724a6eb510225cc24bb2ce9d78 +0 -0
  32. llm_function/.paa.tracking/git_repo/objects/2d/fa3abff2848ff521ead3abb4364bd2c3ca01a6 +0 -0
  33. llm_function/.paa.tracking/git_repo/objects/45/6fc88abc846d76e0f82a3ef180425e497f8281 +0 -0
  34. llm_function/.paa.tracking/git_repo/objects/55/d196aad68e2cc20a2ea496529d9dabeb75bb0e +0 -0
  35. llm_function/.paa.tracking/git_repo/objects/63/9282ebc80b9db9b677374a7c16bc7472d5e71c +0 -0
  36. llm_function/.paa.tracking/git_repo/objects/91/f1d4c0830abe4ebb0902dc052f5dfe9e8fade7 +0 -0
  37. llm_function/.paa.tracking/git_repo/objects/9d/2a8151dd42e6abfffbbbd674b850a7066daa1a +0 -0
  38. llm_function/.paa.tracking/git_repo/objects/aa/0b3847c3f0683eed107a405b9443ec040c3eec +0 -0
  39. llm_function/.paa.tracking/git_repo/objects/cf/024b71ae427969a985d86a267adf154f526cd8 +0 -0
  40. llm_function/.paa.tracking/git_repo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  41. llm_function/.paa.tracking/git_repo/objects/fb/834f2f59b432c0688699b91926899c0e0f2a5d +0 -0
  42. llm_function/.paa.tracking/git_repo/refs/heads/master +1 -0
  43. llm_function/.paa.tracking/git_repo/refs/tags/v0.0.1 +1 -0
  44. llm_function/.paa.tracking/lsts_package_versions.yml +3 -0
  45. llm_function/.paa.tracking/package_licenses.json +1 -0
  46. llm_function/.paa.tracking/package_mapping.json +1 -0
  47. llm_function/.paa.tracking/python_modules/components/llm_func_deps/llm_function_config.py +35 -0
  48. llm_function/.paa.tracking/python_modules/components/llm_func_deps/tool_registry.py +250 -0
  49. llm_function/.paa.tracking/python_modules/llm_function.py +250 -0
  50. llm_function/.paa.tracking/release_notes.md +5 -0
  51. llm_function/.paa.tracking/version_logs.csv +5 -0
  52. llm_function/__init__.py +17 -0
  53. llm_function/artifacts/.paa.tracking/git/dependencies/llm_func_deps/llm_function_config.py +35 -0
  54. llm_function/artifacts/.paa.tracking/git/dependencies/llm_func_deps/tool_registry.py +250 -0
  55. llm_function/artifacts/.paa.tracking/git/docs_cache/llm_function.md +0 -0
  56. llm_function/artifacts/.paa.tracking/git/module/llm_function.py +250 -0
  57. llm_function/artifacts/.paa.tracking/git/tracking/release_notes.md +5 -0
  58. llm_function/artifacts/.paa.tracking/git_repo/COMMIT_EDITMSG +1 -0
  59. llm_function/artifacts/.paa.tracking/git_repo/HEAD +1 -0
  60. llm_function/artifacts/.paa.tracking/git_repo/config +8 -0
  61. llm_function/artifacts/.paa.tracking/git_repo/description +1 -0
  62. llm_function/artifacts/.paa.tracking/git_repo/hooks/applypatch-msg.sample +15 -0
  63. llm_function/artifacts/.paa.tracking/git_repo/hooks/commit-msg.sample +24 -0
  64. llm_function/artifacts/.paa.tracking/git_repo/hooks/fsmonitor-watchman.sample +174 -0
  65. llm_function/artifacts/.paa.tracking/git_repo/hooks/post-update.sample +8 -0
  66. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-applypatch.sample +14 -0
  67. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-commit.sample +49 -0
  68. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-merge-commit.sample +13 -0
  69. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-push.sample +53 -0
  70. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-rebase.sample +169 -0
  71. llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-receive.sample +24 -0
  72. llm_function/artifacts/.paa.tracking/git_repo/hooks/prepare-commit-msg.sample +42 -0
  73. llm_function/artifacts/.paa.tracking/git_repo/hooks/push-to-checkout.sample +78 -0
  74. llm_function/artifacts/.paa.tracking/git_repo/hooks/sendemail-validate.sample +77 -0
  75. llm_function/artifacts/.paa.tracking/git_repo/hooks/update.sample +128 -0
  76. llm_function/artifacts/.paa.tracking/git_repo/index +0 -0
  77. llm_function/artifacts/.paa.tracking/git_repo/info/exclude +6 -0
  78. llm_function/artifacts/.paa.tracking/git_repo/logs/HEAD +1 -0
  79. llm_function/artifacts/.paa.tracking/git_repo/logs/refs/heads/master +1 -0
  80. llm_function/artifacts/.paa.tracking/git_repo/objects/13/9201e8ffeb4e42262e90eeaefd5267debb6e1d +1 -0
  81. llm_function/artifacts/.paa.tracking/git_repo/objects/23/d10b479e3102724a6eb510225cc24bb2ce9d78 +0 -0
  82. llm_function/artifacts/.paa.tracking/git_repo/objects/2d/fa3abff2848ff521ead3abb4364bd2c3ca01a6 +0 -0
  83. llm_function/artifacts/.paa.tracking/git_repo/objects/45/6fc88abc846d76e0f82a3ef180425e497f8281 +0 -0
  84. llm_function/artifacts/.paa.tracking/git_repo/objects/55/d196aad68e2cc20a2ea496529d9dabeb75bb0e +0 -0
  85. llm_function/artifacts/.paa.tracking/git_repo/objects/63/9282ebc80b9db9b677374a7c16bc7472d5e71c +0 -0
  86. llm_function/artifacts/.paa.tracking/git_repo/objects/91/f1d4c0830abe4ebb0902dc052f5dfe9e8fade7 +0 -0
  87. llm_function/artifacts/.paa.tracking/git_repo/objects/9d/2a8151dd42e6abfffbbbd674b850a7066daa1a +0 -0
  88. llm_function/artifacts/.paa.tracking/git_repo/objects/aa/0b3847c3f0683eed107a405b9443ec040c3eec +0 -0
  89. llm_function/artifacts/.paa.tracking/git_repo/objects/cf/024b71ae427969a985d86a267adf154f526cd8 +0 -0
  90. llm_function/artifacts/.paa.tracking/git_repo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  91. llm_function/artifacts/.paa.tracking/git_repo/objects/fb/834f2f59b432c0688699b91926899c0e0f2a5d +0 -0
  92. llm_function/artifacts/.paa.tracking/git_repo/refs/heads/master +1 -0
  93. llm_function/artifacts/.paa.tracking/git_repo/refs/tags/v0.0.1 +1 -0
  94. llm_function/llm_function.py +518 -0
  95. llm_function/mkdocs/docs/css/extra.css +38 -0
  96. llm_function/mkdocs/docs/index.md +24 -0
  97. llm_function/mkdocs/docs/llm_function_tools.md +168 -0
  98. llm_function/mkdocs/docs/release-notes.md +5 -0
  99. llm_function/mkdocs/mkdocs.yml +37 -0
  100. llm_function/mkdocs/site/404.html +370 -0
  101. llm_function/mkdocs/site/assets/images/favicon.png +0 -0
  102. llm_function/mkdocs/site/assets/javascripts/bundle.fe8b6f2b.min.js +29 -0
  103. llm_function/mkdocs/site/assets/javascripts/bundle.fe8b6f2b.min.js.map +7 -0
  104. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
  105. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
  106. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
  107. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
  108. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
  109. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
  110. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
  111. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
  112. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
  113. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
  114. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
  115. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
  116. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
  117. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
  118. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
  119. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
  120. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
  121. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
  122. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
  123. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
  124. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
  125. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
  126. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
  127. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
  128. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
  129. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
  130. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
  131. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
  132. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
  133. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
  134. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
  135. llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
  136. llm_function/mkdocs/site/assets/javascripts/lunr/tinyseg.js +206 -0
  137. llm_function/mkdocs/site/assets/javascripts/lunr/wordcut.js +6708 -0
  138. llm_function/mkdocs/site/assets/javascripts/workers/search.b8dbb3d2.min.js +42 -0
  139. llm_function/mkdocs/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map +7 -0
  140. llm_function/mkdocs/site/assets/stylesheets/main.3cba04c6.min.css +1 -0
  141. llm_function/mkdocs/site/assets/stylesheets/main.3cba04c6.min.css.map +1 -0
  142. llm_function/mkdocs/site/assets/stylesheets/palette.06af60db.min.css +1 -0
  143. llm_function/mkdocs/site/assets/stylesheets/palette.06af60db.min.css.map +1 -0
  144. llm_function/mkdocs/site/css/extra.css +38 -0
  145. llm_function/mkdocs/site/index.html +476 -0
  146. llm_function/mkdocs/site/llm_function_tools/index.html +622 -0
  147. llm_function/mkdocs/site/release-notes/index.html +468 -0
  148. llm_function/mkdocs/site/search/search_index.json +1 -0
  149. llm_function/mkdocs/site/sitemap.xml +3 -0
  150. llm_function/mkdocs/site/sitemap.xml.gz +0 -0
  151. llm_function/setup.py +47 -0
  152. llm_function-0.0.1.dist-info/METADATA +44 -0
  153. llm_function-0.0.1.dist-info/RECORD +157 -0
  154. llm_function-0.0.1.dist-info/WHEEL +5 -0
  155. llm_function-0.0.1.dist-info/licenses/LICENSE +201 -0
  156. llm_function-0.0.1.dist-info/licenses/NOTICE +4 -0
  157. llm_function-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,622 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en" class="no-js">
4
+ <head>
5
+
6
+ <meta charset="utf-8">
7
+ <meta name="viewport" content="width=device-width,initial-scale=1">
8
+
9
+
10
+
11
+
12
+ <link rel="prev" href="../release-notes/">
13
+
14
+
15
+
16
+ <link rel="icon" href="../assets/images/favicon.png">
17
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.30">
18
+
19
+
20
+
21
+ <title>Llm function tools - Llm function</title>
22
+
23
+
24
+
25
+ <link rel="stylesheet" href="../assets/stylesheets/main.3cba04c6.min.css">
26
+
27
+
28
+ <link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
42
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
43
+ <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
44
+
45
+
46
+
47
+ <link rel="stylesheet" href="../css/extra.css">
48
+
49
+ <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
50
+
51
+
52
+
53
+
54
+
55
+
56
+ </head>
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="green" data-md-color-accent="green">
67
+
68
+
69
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
70
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
71
+ <label class="md-overlay" for="__drawer"></label>
72
+ <div data-md-component="skip">
73
+
74
+
75
+ <a href="#define-typed-tools" class="md-skip">
76
+ Skip to content
77
+ </a>
78
+
79
+ </div>
80
+ <div data-md-component="announce">
81
+
82
+ </div>
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <header class="md-header md-header--shadow" data-md-component="header">
90
+ <nav class="md-header__inner md-grid" aria-label="Header">
91
+ <a href=".." title="Llm function" class="md-header__button md-logo" aria-label="Llm function" data-md-component="logo">
92
+
93
+
94
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
95
+
96
+ </a>
97
+ <label class="md-header__button md-icon" for="__drawer">
98
+
99
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
100
+ </label>
101
+ <div class="md-header__title" data-md-component="header-title">
102
+ <div class="md-header__ellipsis">
103
+ <div class="md-header__topic">
104
+ <span class="md-ellipsis">
105
+ Llm function
106
+ </span>
107
+ </div>
108
+ <div class="md-header__topic" data-md-component="header-topic">
109
+ <span class="md-ellipsis">
110
+
111
+ Llm function tools
112
+
113
+ </span>
114
+ </div>
115
+ </div>
116
+ </div>
117
+
118
+
119
+ <form class="md-header__option" data-md-component="palette">
120
+
121
+
122
+
123
+
124
+ <input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="green" data-md-color-accent="green" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
125
+
126
+ <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
127
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 0-7 7c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.26c1.81-1.27 3-3.36 3-5.74a7 7 0 0 0-7-7M9 21a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1H9v1Z"/></svg>
128
+ </label>
129
+
130
+
131
+
132
+
133
+
134
+ <input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="green" data-md-color-accent="green" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
135
+
136
+ <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
137
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7M9 21v-1h6v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1m3-17a5 5 0 0 0-5 5c0 2.05 1.23 3.81 3 4.58V16h4v-2.42c1.77-.77 3-2.53 3-4.58a5 5 0 0 0-5-5Z"/></svg>
138
+ </label>
139
+
140
+
141
+ </form>
142
+
143
+
144
+
145
+ <script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
146
+
147
+
148
+
149
+ <label class="md-header__button md-icon" for="__search">
150
+
151
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
152
+ </label>
153
+ <div class="md-search" data-md-component="search" role="dialog">
154
+ <label class="md-search__overlay" for="__search"></label>
155
+ <div class="md-search__inner" role="search">
156
+ <form class="md-search__form" name="search">
157
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
158
+ <label class="md-search__icon md-icon" for="__search">
159
+
160
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
161
+
162
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
163
+ </label>
164
+ <nav class="md-search__options" aria-label="Search">
165
+
166
+ <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
167
+
168
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
169
+ </button>
170
+ </nav>
171
+
172
+ </form>
173
+ <div class="md-search__output">
174
+ <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
175
+ <div class="md-search-result" data-md-component="search-result">
176
+ <div class="md-search-result__meta">
177
+ Initializing search
178
+ </div>
179
+ <ol class="md-search-result__list" role="presentation"></ol>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+
187
+ <div class="md-header__source">
188
+ <a href="https://github.com/Kiril-Mordan/adaptive-reusables" title="Go to repository" class="md-source" data-md-component="source">
189
+ <div class="md-source__icon md-icon">
190
+
191
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
192
+ </div>
193
+ <div class="md-source__repository">
194
+ adaptive-reusables
195
+ </div>
196
+ </a>
197
+ </div>
198
+
199
+ </nav>
200
+
201
+ </header>
202
+
203
+ <div class="md-container" data-md-component="container">
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <main class="md-main" data-md-component="main">
211
+ <div class="md-main__inner md-grid">
212
+
213
+
214
+
215
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
216
+ <div class="md-sidebar__scrollwrap">
217
+ <div class="md-sidebar__inner">
218
+
219
+
220
+
221
+
222
+ <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
223
+ <label class="md-nav__title" for="__drawer">
224
+ <a href=".." title="Llm function" class="md-nav__button md-logo" aria-label="Llm function" data-md-component="logo">
225
+
226
+
227
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
228
+
229
+ </a>
230
+ Llm function
231
+ </label>
232
+
233
+ <div class="md-nav__source">
234
+ <a href="https://github.com/Kiril-Mordan/adaptive-reusables" title="Go to repository" class="md-source" data-md-component="source">
235
+ <div class="md-source__icon md-icon">
236
+
237
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
238
+ </div>
239
+ <div class="md-source__repository">
240
+ adaptive-reusables
241
+ </div>
242
+ </a>
243
+ </div>
244
+
245
+ <ul class="md-nav__list" data-md-scrollfix>
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+ <li class="md-nav__item">
254
+ <a href=".." class="md-nav__link">
255
+
256
+
257
+ <span class="md-ellipsis">
258
+ Intro
259
+ </span>
260
+
261
+
262
+ </a>
263
+ </li>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <li class="md-nav__item">
274
+ <a href="../release-notes/" class="md-nav__link">
275
+
276
+
277
+ <span class="md-ellipsis">
278
+ Release notes
279
+ </span>
280
+
281
+
282
+ </a>
283
+ </li>
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+ <li class="md-nav__item md-nav__item--active">
296
+
297
+ <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
298
+
299
+
300
+
301
+ <label class="md-nav__link md-nav__link--active" for="__toc">
302
+
303
+
304
+ <span class="md-ellipsis">
305
+ Llm function tools
306
+ </span>
307
+
308
+
309
+ <span class="md-nav__icon md-icon"></span>
310
+ </label>
311
+
312
+ <a href="./" class="md-nav__link md-nav__link--active">
313
+
314
+
315
+ <span class="md-ellipsis">
316
+ Llm function tools
317
+ </span>
318
+
319
+
320
+ </a>
321
+
322
+
323
+
324
+ <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
325
+
326
+
327
+
328
+
329
+ <label class="md-nav__title" for="__toc">
330
+ <span class="md-nav__icon md-icon"></span>
331
+ Table of contents
332
+ </label>
333
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
334
+
335
+ <li class="md-nav__item">
336
+ <a href="#define-typed-tools" class="md-nav__link">
337
+ <span class="md-ellipsis">
338
+ Define typed tools
339
+ </span>
340
+ </a>
341
+
342
+ </li>
343
+
344
+ <li class="md-nav__item">
345
+ <a href="#create-a-toolspec-from-a-plain-callable" class="md-nav__link">
346
+ <span class="md-ellipsis">
347
+ Create a ToolSpec from a plain callable
348
+ </span>
349
+ </a>
350
+
351
+ </li>
352
+
353
+ <li class="md-nav__item">
354
+ <a href="#discover-tools-from-a-module" class="md-nav__link">
355
+ <span class="md-ellipsis">
356
+ Discover tools from a module
357
+ </span>
358
+ </a>
359
+
360
+ </li>
361
+
362
+ <li class="md-nav__item">
363
+ <a href="#load-tools-from-a-standalone-py-file" class="md-nav__link">
364
+ <span class="md-ellipsis">
365
+ Load tools from a standalone .py file
366
+ </span>
367
+ </a>
368
+
369
+ </li>
370
+
371
+ </ul>
372
+
373
+ </nav>
374
+
375
+ </li>
376
+
377
+
378
+
379
+ </ul>
380
+ </nav>
381
+ </div>
382
+ </div>
383
+ </div>
384
+
385
+
386
+
387
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
388
+ <div class="md-sidebar__scrollwrap">
389
+ <div class="md-sidebar__inner">
390
+
391
+
392
+ <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
393
+
394
+
395
+
396
+
397
+ <label class="md-nav__title" for="__toc">
398
+ <span class="md-nav__icon md-icon"></span>
399
+ Table of contents
400
+ </label>
401
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
402
+
403
+ <li class="md-nav__item">
404
+ <a href="#define-typed-tools" class="md-nav__link">
405
+ <span class="md-ellipsis">
406
+ Define typed tools
407
+ </span>
408
+ </a>
409
+
410
+ </li>
411
+
412
+ <li class="md-nav__item">
413
+ <a href="#create-a-toolspec-from-a-plain-callable" class="md-nav__link">
414
+ <span class="md-ellipsis">
415
+ Create a ToolSpec from a plain callable
416
+ </span>
417
+ </a>
418
+
419
+ </li>
420
+
421
+ <li class="md-nav__item">
422
+ <a href="#discover-tools-from-a-module" class="md-nav__link">
423
+ <span class="md-ellipsis">
424
+ Discover tools from a module
425
+ </span>
426
+ </a>
427
+
428
+ </li>
429
+
430
+ <li class="md-nav__item">
431
+ <a href="#load-tools-from-a-standalone-py-file" class="md-nav__link">
432
+ <span class="md-ellipsis">
433
+ Load tools from a standalone .py file
434
+ </span>
435
+ </a>
436
+
437
+ </li>
438
+
439
+ </ul>
440
+
441
+ </nav>
442
+ </div>
443
+ </div>
444
+ </div>
445
+
446
+
447
+
448
+ <div class="md-content" data-md-component="content">
449
+ <article class="md-content__inner md-typeset">
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+ <h1>Llm function tools</h1>
458
+
459
+ <p>Currently intended usage pattern for <code>llm_function_tools</code>:</p>
460
+ <ul>
461
+ <li>define typed tools with <code>@llm_tool</code></li>
462
+ <li>inspect the attached <code>ToolSpec</code></li>
463
+ <li>discover tools from a Python module</li>
464
+ <li>load tools from a standalone <code>.py</code> file</li>
465
+ </ul>
466
+ <pre><code class="language-python">from pathlib import Path
467
+ from tempfile import TemporaryDirectory
468
+
469
+ from pydantic import BaseModel, Field
470
+
471
+ from llm_function_tools import (
472
+ discover_tools_in_module,
473
+ get_tool_spec,
474
+ llm_tool,
475
+ load_tools_from_python_file,
476
+ tool_from_callable,
477
+ )
478
+
479
+ </code></pre>
480
+ <h2 id="define-typed-tools">Define typed tools</h2>
481
+ <p>A tool is just a function with one <code>BaseModel</code> input and one <code>BaseModel</code> output. <code>@llm_tool</code> attaches a normalized <code>ToolSpec</code> to the function.</p>
482
+ <pre><code class="language-python">class WeatherInput(BaseModel):
483
+ city: str = Field(..., description=&quot;City name.&quot;)
484
+
485
+
486
+ class WeatherOutput(BaseModel):
487
+ forecast: str = Field(..., description=&quot;Weather forecast.&quot;)
488
+
489
+
490
+ @llm_tool(tags=[&quot;weather&quot;], metadata={&quot;scope&quot;: &quot;demo&quot;})
491
+ def get_weather(inputs: WeatherInput) -&gt; WeatherOutput:
492
+ &quot;&quot;&quot;Get current weather for a city.&quot;&quot;&quot;
493
+ return WeatherOutput(forecast=f&quot;Sunny in {inputs.city}&quot;)
494
+
495
+
496
+ tool_spec = get_tool_spec(get_weather)
497
+ tool_spec
498
+
499
+ </code></pre>
500
+ <pre><code>ToolSpec(func=&lt;function get_weather at 0x7e0640de5360&gt;, name='get_weather', description='Get current weather for a city.', input_model=&lt;class '__main__.WeatherInput'&gt;, output_model=&lt;class '__main__.WeatherOutput'&gt;, metadata={'scope': 'demo'}, tags=['weather'])
501
+ </code></pre>
502
+ <h2 id="create-a-toolspec-from-a-plain-callable">Create a <code>ToolSpec</code> from a plain callable</h2>
503
+ <p>You can also build <code>ToolSpec</code> directly without decorating the function.</p>
504
+ <pre><code class="language-python">class SearchInput(BaseModel):
505
+ query: str
506
+
507
+
508
+ class SearchOutput(BaseModel):
509
+ result: str
510
+
511
+
512
+ def search_notes(inputs: SearchInput) -&gt; SearchOutput:
513
+ &quot;&quot;&quot;Search local notes.&quot;&quot;&quot;
514
+ return SearchOutput(result=f&quot;Found: {inputs.query}&quot;)
515
+
516
+
517
+ tool_from_callable(search_notes)
518
+
519
+ </code></pre>
520
+ <pre><code>ToolSpec(func=&lt;function search_notes at 0x7e0640de5090&gt;, name='search_notes', description='Search local notes.', input_model=&lt;class '__main__.SearchInput'&gt;, output_model=&lt;class '__main__.SearchOutput'&gt;, metadata={}, tags=[])
521
+ </code></pre>
522
+ <h2 id="discover-tools-from-a-module">Discover tools from a module</h2>
523
+ <p>In normal usage, loaders will inspect a Python module or file and collect decorated tools from it.</p>
524
+ <p>In a notebook, <code>__main__</code> behaves as the current module, so we can demonstrate the same discovery flow here.</p>
525
+ <pre><code class="language-python">import __main__
526
+
527
+ discovered = discover_tools_in_module(__main__)
528
+ [(tool.name, tool.tags, tool.metadata) for tool in discovered]
529
+
530
+ </code></pre>
531
+ <pre><code>[('get_weather', ['weather'], {'scope': 'demo'})]
532
+ </code></pre>
533
+ <h2 id="load-tools-from-a-standalone-py-file">Load tools from a standalone <code>.py</code> file</h2>
534
+ <p>This is closer to the future <code>llm_function</code> use case where tools live outside the runtime module.</p>
535
+ <pre><code class="language-python">tmp_dir = TemporaryDirectory()
536
+ tool_file = Path(tmp_dir.name) / &quot;sample_tools.py&quot;
537
+ tool_file.write_text(
538
+ &quot;&quot;&quot;
539
+ from pydantic import BaseModel
540
+ from llm_function_tools import llm_tool
541
+
542
+
543
+ class MathInput(BaseModel):
544
+ x: int
545
+
546
+
547
+ class MathOutput(BaseModel):
548
+ y: int
549
+
550
+
551
+ @llm_tool(tags=['math'])
552
+ def add_one(inputs: MathInput) -&gt; MathOutput:
553
+ '''Add one to the input value.'''
554
+ return MathOutput(y=inputs.x + 1)
555
+ &quot;&quot;&quot;.strip()
556
+ )
557
+
558
+ file_tools = load_tools_from_python_file(str(tool_file))
559
+ [(tool.name, tool.description, tool.tags) for tool in file_tools]
560
+
561
+ </code></pre>
562
+ <pre><code>[('add_one', 'Add one to the input value.', ['math'])]
563
+ </code></pre>
564
+ <pre><code class="language-python">file_tools
565
+ </code></pre>
566
+ <pre><code>[ToolSpec(func=&lt;function add_one at 0x7e06361ae830&gt;, name='add_one', description='Add one to the input value.', input_model=&lt;class '_llm_function_tools_sample_tools_8306dd8f7421.MathInput'&gt;, output_model=&lt;class '_llm_function_tools_sample_tools_8306dd8f7421.MathOutput'&gt;, metadata={}, tags=['math'])]
567
+ </code></pre>
568
+ <p>The resulting <code>ToolSpec</code> objects are the input that a higher-level runtime such as <code>llm_function</code> can later resolve into runnable tool registries with provenance metadata.</p>
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+ </article>
583
+ </div>
584
+
585
+
586
+ <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
587
+ </div>
588
+
589
+ </main>
590
+
591
+ <footer class="md-footer">
592
+
593
+ <div class="md-footer-meta md-typeset">
594
+ <div class="md-footer-meta__inner md-grid">
595
+ <div class="md-copyright">
596
+
597
+
598
+ Made with
599
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
600
+ Material for MkDocs
601
+ </a>
602
+
603
+ </div>
604
+
605
+ </div>
606
+ </div>
607
+ </footer>
608
+
609
+ </div>
610
+ <div class="md-dialog" data-md-component="dialog">
611
+ <div class="md-dialog__inner md-typeset"></div>
612
+ </div>
613
+
614
+
615
+ <script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
616
+
617
+
618
+ <script src="../assets/javascripts/bundle.fe8b6f2b.min.js"></script>
619
+
620
+
621
+ </body>
622
+ </html>