Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +4 -12
assistants.py
CHANGED
@@ -41,30 +41,22 @@ tools = {
|
|
41 |
"tavily_search_tool": tavily_search_tool,
|
42 |
}
|
43 |
|
44 |
-
def get_openai_client():
|
45 |
-
global openai_client
|
46 |
-
return openai_client
|
47 |
-
|
48 |
def set_openai_client(openai_api_key):
|
49 |
global openai_client
|
50 |
openai_client = OpenAI(api_key=openai_api_key)
|
51 |
|
52 |
-
def get_assistant():
|
53 |
-
global assistant
|
54 |
-
return assistant
|
55 |
-
|
56 |
def set_assistant(a):
|
57 |
global assistant
|
58 |
assistant = a
|
59 |
|
60 |
-
def get_thread():
|
61 |
-
global thread
|
62 |
-
return thread
|
63 |
-
|
64 |
def set_thread(t):
|
65 |
global thread
|
66 |
thread = t
|
67 |
|
|
|
|
|
|
|
|
|
68 |
def create_assistant():
|
69 |
assistant = openai_client.beta.assistants.create(
|
70 |
name="Python Coding Assistant",
|
|
|
41 |
"tavily_search_tool": tavily_search_tool,
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
44 |
def set_openai_client(openai_api_key):
|
45 |
global openai_client
|
46 |
openai_client = OpenAI(api_key=openai_api_key)
|
47 |
|
|
|
|
|
|
|
|
|
48 |
def set_assistant(a):
|
49 |
global assistant
|
50 |
assistant = a
|
51 |
|
|
|
|
|
|
|
|
|
52 |
def set_thread(t):
|
53 |
global thread
|
54 |
thread = t
|
55 |
|
56 |
+
def get_thread():
|
57 |
+
global thread
|
58 |
+
return thread
|
59 |
+
|
60 |
def create_assistant():
|
61 |
assistant = openai_client.beta.assistants.create(
|
62 |
name="Python Coding Assistant",
|