mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Use array of messages in CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts
This refactor changes the code in CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts to use an array of messages instead of a single prompt. Each message in the array contains the content and role of the prompt, improving flexibility and readability.
This commit is contained in:
@@ -30,8 +30,10 @@ async def validateSecretKey(secretKey):
|
||||
return False
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
print(f"Validating secret key")
|
||||
url = f"{ONEUPTIME_URL}/api/code-repository/is-valid/{secretKey}"
|
||||
async with session.get(url) as response:
|
||||
print(response)
|
||||
if response.status == 200:
|
||||
return True
|
||||
else:
|
||||
@@ -112,7 +114,7 @@ async def create_item(prompt: Prompt):
|
||||
return {"error": "Prompt is required"}
|
||||
|
||||
# Validate the secret key
|
||||
is_valid = await validateSecretKey(prompt_status.secretkey)
|
||||
is_valid = await validateSecretKey(prompt.secretkey)
|
||||
|
||||
if not is_valid:
|
||||
print("Invalid secret key")
|
||||
|
||||
Reference in New Issue
Block a user