Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the google endpoints use optional dependencies #1467

Open
nsarrazin opened this issue Sep 13, 2024 · 0 comments
Open

Make the google endpoints use optional dependencies #1467

nsarrazin opened this issue Sep 13, 2024 · 0 comments
Labels
enhancement New feature or request models This issue is related to model performance/reliability

Comments

@nsarrazin
Copy link
Collaborator

Most endpoints use the following kind of logic to ensure the app does not break if the package is not installed:

	let BedrockRuntimeClient, InvokeModelWithResponseStreamCommand;
	try {
		({ BedrockRuntimeClient, InvokeModelWithResponseStreamCommand } = await import(
			"@aws-sdk/client-bedrock-runtime"
		));
	} catch (error) {
		throw new Error("Failed to import @aws-sdk/client-bedrock-runtime. Make sure it's installed.");
	}

The only exceptions are the GenAI and Vertex endpoints under endpoints/google

This is because of the HarmBlockThreshold enum which is used in our zod schema used to validate the endpoint definition. Not sure what the best way is to deal with this, could we just hardcode the values?

@nsarrazin nsarrazin added enhancement New feature or request models This issue is related to model performance/reliability labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request models This issue is related to model performance/reliability
Projects
None yet
Development

No branches or pull requests

1 participant