blob: 84b44d4d72c5a88cad0964e36b5a7089cb52fd23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# tools.py
import json
def check_username(username):
"""
Check if a username is available.
:param username: The username to check.
:return: True if the username is available, False otherwise.
"""
# In a real application, this would check a database or an API.
# For this example, we'll just pretend all usernames are available.
return True
tools = [
{
"type": "function",
"function": {
"name": "check_username",
"description": "Check if a username is available.",
"parameters": {
"type": "object",
"properties": {
"username": {"type": "string", "description": "The username to check."},
},
"required": ["username"],
},
}
}
]
available_functions = {
"check_username": check_username
}
|