Skip to content

Commit f9d46e3

Browse files
author
Lloyd Hamilton
committed
Revert list model changes
1 parent 1abea9e commit f9d46e3

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

adalflow/adalflow/components/model_client/bedrock_client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from botocore.config import Config
2323

2424
log = logging.getLogger(__name__)
25-
log.level = logging.DEBUG
2625

2726
bedrock_runtime_exceptions = boto3.client(
2827
service_name="bedrock-runtime",
@@ -174,7 +173,7 @@ def handle_stream_response(self, stream: dict) -> GeneratorType:
174173
yield chunk
175174
except Exception as e:
176175
print(f"Error in handle_stream_response: {e}") # Debug print
177-
raise
176+
raise from e
178177

179178
def parse_chat_completion(self, completion: dict) -> "GeneratorOutput":
180179
"""Parse the completion, and put it into the raw_response."""
@@ -203,14 +202,14 @@ def list_models(self):
203202

204203
try:
205204
response = self._client.list_foundation_models()
206-
models = response.get("modelSummaries", [])
205+
models = response.get("models", [])
207206
for model in models:
208207
print(f"Model ID: {model['modelId']}")
209-
print(f" Name: {model['modelName']}")
210-
print(f" Input Modalities: {model['inputModalities']}")
211-
print(f" Output Modalities: {model['outputModalities']}")
212-
print(f" Provider: {model['providerName']}")
208+
print(f" Name: {model['name']}")
209+
print(f" Description: {model['description']}")
210+
print(f" Provider: {model['provider']}")
213211
print("")
212+
214213
except Exception as e:
215214
print(f"Error listing models: {e}")
216215

@@ -255,7 +254,6 @@ def call(
255254
if model_type == ModelType.LLM:
256255
if "stream" in api_kwargs and api_kwargs.get("stream", False):
257256
log.debug("Streaming call")
258-
printc("Streaming")
259257
api_kwargs.pop("stream") # stream is not a valid parameter for bedrock
260258
self.chat_completion_parser = self.handle_stream_response
261259
return self.sync_client.converse_stream(**api_kwargs)

0 commit comments

Comments
 (0)