You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
791 B
32 lines
791 B
import requests
|
|
import json
|
|
import os
|
|
|
|
url = "https://swarms.world/api/edit-prompt"
|
|
|
|
headers = {
|
|
"Content-Type": "application/json",
|
|
"Authorization": f"Bearer {os.getenv('SWARMS_API_KEY')}",
|
|
}
|
|
|
|
data = {
|
|
"id": "prompt_id",
|
|
"name": "Updated Prompt",
|
|
"prompt": "This is an updated prompt from an API route.",
|
|
"description": "Updated description of the prompt.",
|
|
"useCases": [
|
|
{
|
|
"title": "Updated use case 1",
|
|
"description": "Updated description of use case 1",
|
|
},
|
|
{
|
|
"title": "Updated use case 2",
|
|
"description": "Updated description of use case 2",
|
|
},
|
|
],
|
|
"tags": "updated, prompt",
|
|
}
|
|
|
|
response = requests.post(url, headers=headers, data=json.dumps(data))
|
|
print(response.json())
|