Spaces:
Sleeping
Sleeping
'changes'
Browse files- OpenAIResponse.py +24 -0
- app.py +5 -22
OpenAIResponse.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from openai import OpenAI
|
2 |
+
class OpenAIText:
|
3 |
+
def OpenAITextResponse(query:str, content:str):
|
4 |
+
client = OpenAI(api_key='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')
|
5 |
+
|
6 |
+
response = client.chat.completions.create(
|
7 |
+
model="gpt-3.5-turbo",
|
8 |
+
messages=[
|
9 |
+
{
|
10 |
+
"role": "system",
|
11 |
+
"content": query
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"role": "user",
|
15 |
+
"content": content
|
16 |
+
}
|
17 |
+
],
|
18 |
+
temperature=0.7,
|
19 |
+
max_tokens=64,
|
20 |
+
top_p=1
|
21 |
+
)
|
22 |
+
print(response.choices[0].message.content)
|
23 |
+
return response.choices[0].message.content
|
24 |
+
|
app.py
CHANGED
@@ -27,6 +27,7 @@ from ExtractContentsFromFile import ExtractContentFromFile
|
|
27 |
from RemoveSkills import RemoveSkill
|
28 |
from AddSkillDetails import AddSkill
|
29 |
from SkillMatcher import SkillMatch
|
|
|
30 |
import ClassModals
|
31 |
import os
|
32 |
os.environ['HF_HOME'] = '/hug/cache/'
|
@@ -129,28 +130,10 @@ def GetMatchProfileByJobId(JobId : int):
|
|
129 |
df = pd.DataFrame(dataJson)
|
130 |
return parse_csv(df)
|
131 |
|
132 |
-
|
133 |
@app.get("/GetOpenAPIResponse/")
|
134 |
-
def GetOpenAPIResponse():
|
135 |
-
|
136 |
-
|
137 |
-
response = client.chat.completions.create(
|
138 |
-
model="gpt-3.5-turbo",
|
139 |
-
messages=[
|
140 |
-
{
|
141 |
-
"role": "system",
|
142 |
-
"content": "Summarize content you are provided in a single paragraph."
|
143 |
-
},
|
144 |
-
{
|
145 |
-
"role": "user",
|
146 |
-
"content": "Working as a secondary application owner with the Development team, on troubleshooting, analyzing data stored, its inbound and outbound core functionality using SQL Scripts and commands. Synchronized various records in the static Data Source (SSSDR), and solving issues related to the running SQL Server Instance and infrastructure. • Worked as a Database Integration Specialist with experience in Autosys Job Automation, worked towards Jil file management and troubleshooting issues related to the data administration, created end to end application flow PARP and DIRP Cutover with all server specifications, database nodes and overseeing the entire infra level application flow.• Worked as a Support application developer, analyzing issues and performing"
|
147 |
-
+"troubleshooting steps and handled exceptions through exception handling mechanism in Java."
|
148 |
-
}
|
149 |
-
],
|
150 |
-
temperature=0.7,
|
151 |
-
max_tokens=64,
|
152 |
-
top_p=1
|
153 |
-
)
|
154 |
-
print(response.choices[0].message.content)
|
155 |
#return JSONResponse(content={"message": "Here's your interdimensional portal." , "mes1":"data2"})
|
156 |
#https://vaibhav84-resumeapi.hf.space/docs
|
|
|
27 |
from RemoveSkills import RemoveSkill
|
28 |
from AddSkillDetails import AddSkill
|
29 |
from SkillMatcher import SkillMatch
|
30 |
+
from OpenAIResponse import OpenAIText
|
31 |
import ClassModals
|
32 |
import os
|
33 |
os.environ['HF_HOME'] = '/hug/cache/'
|
|
|
130 |
df = pd.DataFrame(dataJson)
|
131 |
return parse_csv(df)
|
132 |
|
133 |
+
|
134 |
@app.get("/GetOpenAPIResponse/")
|
135 |
+
def GetOpenAPIResponse(query:str, content:str):
|
136 |
+
return OpenAIText.OpenAITextResponse(query,content)
|
137 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
#return JSONResponse(content={"message": "Here's your interdimensional portal." , "mes1":"data2"})
|
139 |
#https://vaibhav84-resumeapi.hf.space/docs
|