Spaces:
Sleeping
Sleeping
IngoTB303
commited on
Commit
·
3c79524
1
Parent(s):
58d65f1
Refactor app.py: comment out AzureOpenAIServerModel instantiation and replace agent call with placeholder for app-test.py integration
Browse files
app.py
CHANGED
|
@@ -15,12 +15,12 @@ load_dotenv() # take environment variables
|
|
| 15 |
# --- Constants ---
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
| 18 |
-
model = AzureOpenAIServerModel(
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
|
| 25 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 26 |
"""
|
|
@@ -44,7 +44,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 44 |
|
| 45 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 46 |
try:
|
| 47 |
-
|
|
|
|
| 48 |
except Exception as e:
|
| 49 |
print(f"Error instantiating agent: {e}")
|
| 50 |
return f"Error initializing agent: {e}", None
|
|
@@ -100,7 +101,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 100 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 101 |
continue
|
| 102 |
try:
|
| 103 |
-
submitted_answer =
|
|
|
|
| 104 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 105 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 106 |
except Exception as e:
|
|
|
|
| 15 |
# --- Constants ---
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
| 18 |
+
# model = AzureOpenAIServerModel(
|
| 19 |
+
# model_id = os.getenv("AZURE_OPENAI_MODEL"),
|
| 20 |
+
# azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
|
| 21 |
+
# api_key = os.getenv("AZURE_OPENAI_API_KEY"),
|
| 22 |
+
# api_version = os.getenv("app_tokens.OPENAI_API_VERSION")
|
| 23 |
+
# )
|
| 24 |
|
| 25 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 26 |
"""
|
|
|
|
| 44 |
|
| 45 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 46 |
try:
|
| 47 |
+
print("Start Agent...")
|
| 48 |
+
# agent = agent.BasicAgent()
|
| 49 |
except Exception as e:
|
| 50 |
print(f"Error instantiating agent: {e}")
|
| 51 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 101 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 102 |
continue
|
| 103 |
try:
|
| 104 |
+
submitted_answer = "Placeholder" # app-test.py is the real app
|
| 105 |
+
# submitted_answer = agent(question_text)
|
| 106 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 107 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 108 |
except Exception as e:
|