15
Views
9
Comments
[AWS Bedrock Runtime] Getting error in AWS_Bedrock-Runtime_IS
aws-bedrock-runtime
Service icon
Forge asset by Stefan Weber

Hi everyone,

We are encountering an error in the AWS_Bedrock Runtime_IS module while using the Anthropic Claude TexttoText action. Although we have provided the correct inputs, we are receiving the following error:

"The type initializer for 'Amazon.BedrockRuntime.AmazonBedrockRuntimeConfig' threw an exception."

Could you please assist us in resolving this issue?

Thank you in advance.

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi Aravind,

please provide some additional details on how you are calling the action (the parameters you have set).

Best

Stefan

UserImage.jpg
Aravind I

Hi Stefan,

Thanks for the reply. These are the parameters being passed to the action. If required, I can share the OML file from my personal environment for further review.


2021-10-09 07-57-44
Stefan Weber
 
MVP

mh. Looks correct to me. At least in my environment it works. Are you using any other AWS Forge components in that project? If so you would need to create service action wrappers around the _iS module server actions and use those in your project. That is due to the different SDK versions there might be an issue with resolving the correct assemblies, because with strong references both SDKs would become part of your project.

UserImage.jpg
Aravind I

Hi Stefan, we are not using any other AWS forge component except Claude. Do I need to wrapper up this Claude action? Please share me the OML for better understanding. 

2021-10-09 07-57-44
Stefan Weber
 
MVP

No, in that case you do not need to wrap it in a service action. Did you download the demo application? It shows how to use the whole library.

you can also upload your oml here for me to review and try it.

Stefan

UserImage.jpg
Aravind I

Hi, Stefan.  I did not use any additional AWS components and instead relied on dependencies.  However, in my scenario, I need to utilize another AWS component (AWS_Textract).  I consumed a service action from the coreservice module, and the identical problem occurred when I took the dependency and used it. 
 My situation is to upload a file (of any form) and extract the text from it using AWS_Textract, and then ask any query from that uploaded file to get a result using Anthropic Claude-3. 
Due to security concerns I can't upload the OML.

2021-10-09 07-57-44
Stefan Weber
 
MVP

Yes. Most likely you experience what is called "Assembly hell". Different versions of the same dll used. In your case the SDK from Textract and Bedrock.

In such a case you would need to wrap the server actions of the IS module in SERVICE actions in a separate module. Then in your project use the service actions instead of the server actions. This will let the Bedrock component run in its own context not interfering with any other assemblies.

UserImage.jpg
Aravind I

Hi Stefan,

I tried using a service action instead of a server action and also attempted to consume it as a REST API, but I'm still encountering the same error.

It would be helpful if we could explore any other possible ways to resolve this issue.

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi Aravind, as I cannot replicate the issue in my environment(s) I only see a chance in helping you if you can upload the OML.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.