Skip to content

Commit 78cd83b

Browse files
committed
revert bedrock testing on simple client server app
1 parent d56d681 commit 78cd83b

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
import boto3
4-
import json
5-
from flask import Flask
4+
from flask import Flask, request
5+
6+
# Let's use Amazon S3
7+
s3 = boto3.resource("s3")
68

7-
client = boto3.client(service_name="bedrock-runtime")
89
app = Flask(__name__)
910

11+
1012
@app.route("/server_request")
1113
def server_request():
12-
messages = [
13-
{"role": "user", "content": [{"text": "Write a short poem"}]},
14-
]
15-
16-
model_response = client.converse(
17-
modelId="us.amazon.nova-lite-v1:0",
18-
messages=messages
19-
)
20-
21-
print("\n[Full Response]")
22-
print(json.dumps(model_response, indent=2))
23-
24-
print("\n[Response Content Text]")
25-
print(model_response["output"]["message"]["content"][0]["text"])
26-
14+
print(request.args.get("param"))
15+
for bucket in s3.buckets.all():
16+
print(bucket.name)
17+
return "served"
2718

2819

2920
if __name__ == "__main__":
30-
app.run(port=8082)
21+
app.run(port=8082)

0 commit comments

Comments
 (0)