aboutsummaryrefslogtreecommitdiff
path: root/autogpt/core/runner/cli_web_app/client/client.py
blob: 346203f7ca42eedfe29f1985e794830bf1b6a26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import json

import requests


def run():
    body = json.dumps(
        {"ai_name": "HelloBot", "ai_role": "test", "ai_goals": ["goal1", "goal2"]}
    )

    header = {"Content-Type": "application/json", "openai_api_key": "asdf"}
    print("Sending: ", header, body)
    response = requests.post(
        "http://localhost:8080/api/v1/agents", data=body, headers=header
    )
    print(response.content.decode("utf-8"))