Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -709,8 +709,6 @@ import os
|
|
| 709 |
import tensorflow as tf
|
| 710 |
import random
|
| 711 |
import openai
|
| 712 |
-
# from openai_decorator.openai_decorator import openaifunc, get_openai_funcs
|
| 713 |
-
from openai_decorator import openai_func, main
|
| 714 |
|
| 715 |
host = os.environ.get("host")
|
| 716 |
code = os.environ.get("code")
|
|
@@ -1002,10 +1000,28 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
| 1002 |
# }
|
| 1003 |
# ]
|
| 1004 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1005 |
completion = openai.ChatCompletion.create(
|
| 1006 |
model="gpt-3.5-turbo",
|
| 1007 |
messages=messages,
|
| 1008 |
-
functions =
|
| 1009 |
function_call = "auto",
|
| 1010 |
)
|
| 1011 |
|
|
|
|
| 709 |
import tensorflow as tf
|
| 710 |
import random
|
| 711 |
import openai
|
|
|
|
|
|
|
| 712 |
|
| 713 |
host = os.environ.get("host")
|
| 714 |
code = os.environ.get("code")
|
|
|
|
| 1000 |
# }
|
| 1001 |
# ]
|
| 1002 |
|
| 1003 |
+
functions = [
|
| 1004 |
+
{
|
| 1005 |
+
"name": "testing_this",
|
| 1006 |
+
"description": "This function ask user for their name and a random integer and returns it",
|
| 1007 |
+
"parameters": {
|
| 1008 |
+
"type": "object",
|
| 1009 |
+
"properties": {
|
| 1010 |
+
"name": {
|
| 1011 |
+
"type": "string",
|
| 1012 |
+
"description": "Name of the user",
|
| 1013 |
+
},
|
| 1014 |
+
"number": {"type": "string", "description": "A random number"},
|
| 1015 |
+
},
|
| 1016 |
+
"required": ["name", "number"],
|
| 1017 |
+
},
|
| 1018 |
+
}
|
| 1019 |
+
]
|
| 1020 |
+
|
| 1021 |
completion = openai.ChatCompletion.create(
|
| 1022 |
model="gpt-3.5-turbo",
|
| 1023 |
messages=messages,
|
| 1024 |
+
functions = functions,
|
| 1025 |
function_call = "auto",
|
| 1026 |
)
|
| 1027 |
|