Spaces:
Running
Running
SURIAPRAKASH1
commited on
Commit
·
5775dc6
1
Parent(s):
6924d23
registry to register primitives automatically
Browse files- registry.py +11 -0
registry.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import inspect
|
2 |
+
from primitives import tools
|
3 |
+
|
4 |
+
def get_tool_functions():
|
5 |
+
"Only get async function and function is tool from tools.py"
|
6 |
+
|
7 |
+
return {
|
8 |
+
name: func
|
9 |
+
for name, func in inspect.getmembers(tools, inspect.iscoroutinefunction)
|
10 |
+
if not name.startswith("_")
|
11 |
+
}
|