Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -6,10 +6,8 @@ from pydantic import BaseModel
|
|
| 6 |
from datetime import datetime
|
| 7 |
import uuid
|
| 8 |
import os
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
client = OpenAI() # Automatically picks up your Hugging Face secret OPENAI_API_KEY
|
| 12 |
-
|
| 13 |
from transformers import pipeline
|
| 14 |
import logging, traceback
|
| 15 |
from typing import Optional, List, Union
|
|
@@ -280,7 +278,7 @@ async def root_cause_analysis(payload: dict, x_api_key: str = Header(None)):
|
|
| 280 |
Suggestion: ...
|
| 281 |
"""
|
| 282 |
|
| 283 |
-
response =
|
| 284 |
model="gpt-4",
|
| 285 |
messages=[{"role": "user", "content": prompt}]
|
| 286 |
)
|
|
|
|
| 6 |
from datetime import datetime
|
| 7 |
import uuid
|
| 8 |
import os
|
| 9 |
+
import openai
|
| 10 |
+
|
|
|
|
|
|
|
| 11 |
from transformers import pipeline
|
| 12 |
import logging, traceback
|
| 13 |
from typing import Optional, List, Union
|
|
|
|
| 278 |
Suggestion: ...
|
| 279 |
"""
|
| 280 |
|
| 281 |
+
response = openai.chat.completions.create(
|
| 282 |
model="gpt-4",
|
| 283 |
messages=[{"role": "user", "content": prompt}]
|
| 284 |
)
|