qingjun
commited on
Commit
·
512f1d2
1
Parent(s):
a042771
delete
Browse filesSigned-off-by: qingjun <[email protected]>
test.py
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
from openai import OpenAI
|
2 |
-
|
3 |
-
client = OpenAI(api_key="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJHcm91cE5hbWUiOiJtbyBuaSIsIlVzZXJOYW1lIjoibW8gbmkiLCJBY2NvdW50IjoiIiwiU3ViamVjdElEIjoiMTg3NjIwMDY0ODA2NDYzNTI0MiIsIlBob25lIjoiIiwiR3JvdXBJRCI6IjE4NzYyMDA2NDgwNjA0NDA5MzgiLCJQYWdlTmFtZSI6IiIsIk1haWwiOiJuaW1vQHN1YnN1cC52aXAiLCJDcmVhdGVUaW1lIjoiMjAyNS0wMS0wNyAxMToyNzowNyIsIlRva2VuVHlwZSI6MSwiaXNzIjoibWluaW1heCJ9.Ge1ZnpFPUfXVdMini0P_qXbP_9VYwzXiffG9DsNQck4GtYEOs33LDeAiwrVsrrLZfvJ2icQZ4sRZS54wmPuWua_Dav6pYJty8ZtahmUX1IuhlUX5YErhhCRAIy3J1xB8FkLHLyylChuBHpkNz6O6BQLmPqmoa-cOYK9Qrc6IDeu8SX1iMzO9-MSkcWNvkvpCF2Pf9tekBVWNKMDK6IZoMEPbtkaPXdDyP6l0M0e2AlL_E0oM9exg3V-ohAi8OTPFyqM6dcd4TwF-b9DULxfIsRFw401mvIxcTDWa42u2LULewdATVRD2BthU65tuRqEiWeFWMvFlPj2soMze_QIiUA", base_url="https://api.minimaxi.chat/v1/text/chatcompletion_v2")
|
4 |
-
|
5 |
-
tools = [{
|
6 |
-
"type": "function",
|
7 |
-
"name": "get_weather",
|
8 |
-
"description": "Get current temperature for a given location.",
|
9 |
-
"parameters": {
|
10 |
-
"type": "object",
|
11 |
-
"properties": {
|
12 |
-
"location": {
|
13 |
-
"type": "string",
|
14 |
-
"description": "City and country e.g. Bogotá, Colombia"
|
15 |
-
}
|
16 |
-
},
|
17 |
-
"required": [
|
18 |
-
"location"
|
19 |
-
],
|
20 |
-
"additionalProperties": False
|
21 |
-
}
|
22 |
-
}]
|
23 |
-
|
24 |
-
response = client.chat.completions.create(
|
25 |
-
model="MiniMax-Text-01",
|
26 |
-
messages=[{"role": "user", "content": "What is the weather like in Paris today?"}],
|
27 |
-
)
|
28 |
-
|
29 |
-
print(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|