mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 16:36:22 +02:00
add auth for copilot and agents
This commit is contained in:
parent
cdc96e7ce3
commit
ad4ea23d79
14 changed files with 173 additions and 43 deletions
|
|
@ -7,13 +7,16 @@ if __name__ == "__main__":
|
|||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--sample_request', type=str, required=True, help='Sample request JSON file name under tests/sample_requests/')
|
||||
parser.add_argument('--api_key', type=str, required=True, help='API key to use for authentication')
|
||||
parser.add_argument('--host', type=str, required=False, help='Host to use for the request', default='http://localhost:4040')
|
||||
args = parser.parse_args()
|
||||
|
||||
request = read_json_from_file(f"./tests/sample_requests/{args.sample_request}").get("lastRequest", {})
|
||||
print("Sending request...")
|
||||
response = requests.post(
|
||||
"http://localhost:4040/chat",
|
||||
json=request
|
||||
f"{args.host}/chat",
|
||||
json=request,
|
||||
headers={'Authorization': f'Bearer {args.api_key}'}
|
||||
).json()
|
||||
print("Output: ")
|
||||
print(response)
|
||||
Loading…
Add table
Add a link
Reference in a new issue