Skip to content

Commit 331f5c2

Browse files
Update for v0.1.3
1 parent 439d099 commit 331f5c2

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

examples/test_json_database.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,14 @@
4141
}
4242
}
4343

44-
# Tool definition - describes the get_user_info function available to the model
45-
tools = [{
46-
"type": "function",
47-
"function": {
48-
"name": "get_user_info",
49-
"description": "Access the employee database",
50-
"parameters": {
51-
"type": "object",
52-
"properties": {
53-
"name": {"type": "string", "description": "Full name of the employee to look up"}
54-
},
55-
"required": ["name"]
56-
}
57-
}
58-
}]
59-
6044
# Function implementation - retrieves user data from our database
6145
def get_user_info(name):
6246
"""Fetch user information from the database by name (case-insensitive)"""
6347
return user_database.get(name.strip().lower(), "User not found in database")
6448

49+
# Tool definition - describes the get_user_info function available to the model
50+
tools = T.functions_to_tools([get_user_info])
51+
6552
client = T.clients.openrouter("API_KEY")
6653
prompt = """Give me the information you have access to on the following users :
6754
- jean dupont

0 commit comments

Comments
 (0)