Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -953,9 +953,34 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
| 953 |
# "model": model_llm
|
| 954 |
# }).json()
|
| 955 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 956 |
completion = openai.ChatCompletion.create(
|
| 957 |
model="gpt-3.5-turbo",
|
| 958 |
-
messages=messages
|
|
|
|
|
|
|
|
|
|
|
|
|
| 959 |
)
|
| 960 |
|
| 961 |
|
|
|
|
| 953 |
# "model": model_llm
|
| 954 |
# }).json()
|
| 955 |
|
| 956 |
+
functions = [
|
| 957 |
+
{
|
| 958 |
+
"name": "getRandomInt",
|
| 959 |
+
"description": "Returns a random integer between min (included) and max (included)",
|
| 960 |
+
"parameters": {
|
| 961 |
+
"type": "object",
|
| 962 |
+
"properties": {
|
| 963 |
+
"min": {
|
| 964 |
+
"type": "number",
|
| 965 |
+
"description": "Minimum value"
|
| 966 |
+
},
|
| 967 |
+
"max": {
|
| 968 |
+
"type": "number",
|
| 969 |
+
"description": "Maximum value"
|
| 970 |
+
},
|
| 971 |
+
},
|
| 972 |
+
"required": ["min", "max"],
|
| 973 |
+
}
|
| 974 |
+
}
|
| 975 |
+
]
|
| 976 |
+
|
| 977 |
completion = openai.ChatCompletion.create(
|
| 978 |
model="gpt-3.5-turbo",
|
| 979 |
+
messages=messages,
|
| 980 |
+
functions = functions,
|
| 981 |
+
function_call = {
|
| 982 |
+
"name": "getRandomInt"
|
| 983 |
+
}
|
| 984 |
)
|
| 985 |
|
| 986 |
|