Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +12 -1
src/streamlit_app.py
CHANGED
|
@@ -94,10 +94,21 @@ def respond_default_model(user_prompt):
|
|
| 94 |
full_response = response.json()['output'][0]
|
| 95 |
|
| 96 |
def respond_gpt5(user_prompt):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
chat_engine=openai.OpenAI()
|
| 98 |
response = chat_engine.chat.completions.create(
|
| 99 |
model='gpt-5-mini',
|
| 100 |
-
messages=[
|
|
|
|
|
|
|
| 101 |
)
|
| 102 |
return response.choices[0].message.content.strip()
|
| 103 |
|
|
|
|
| 94 |
full_response = response.json()['output'][0]
|
| 95 |
|
| 96 |
def respond_gpt5(user_prompt):
|
| 97 |
+
systems_prompt="""
|
| 98 |
+
I want you to act as a software developer with solid skill in Python .The user provide you information and you should write
|
| 99 |
+
Python program based on given instruction.
|
| 100 |
+
The output format must be in following format.
|
| 101 |
+
|
| 102 |
+
```python
|
| 103 |
+
code syntax
|
| 104 |
+
```
|
| 105 |
+
"""
|
| 106 |
chat_engine=openai.OpenAI()
|
| 107 |
response = chat_engine.chat.completions.create(
|
| 108 |
model='gpt-5-mini',
|
| 109 |
+
messages=[
|
| 110 |
+
{'role':'system','content':system_prompt},
|
| 111 |
+
{'role':'user','content':user_prompt}]
|
| 112 |
)
|
| 113 |
return response.choices[0].message.content.strip()
|
| 114 |
|