optionally specify available bedrock model used in validation
This commit is contained in:
parent
1294ce4041
commit
0f94e4cd01
30
.vscode/launch.json
vendored
30
.vscode/launch.json
vendored
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
// set root directory to api/ folder
|
|
||||||
"cwd": "${workspaceFolder}/api",
|
|
||||||
"name": "Python: Flask",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"module": "flask",
|
|
||||||
"env": {
|
|
||||||
"FLASK_APP": "app.py",
|
|
||||||
"FLASK_DEBUG": "1",
|
|
||||||
"GEVENT_SUPPORT": "True"
|
|
||||||
},
|
|
||||||
"args": [
|
|
||||||
"run",
|
|
||||||
"--no-debugger",
|
|
||||||
"--no-reload",
|
|
||||||
"--host=0.0.0.0",
|
|
||||||
"--port=5001"
|
|
||||||
],
|
|
||||||
"jinja": true,
|
|
||||||
"justMyCode": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -17,9 +17,11 @@ class BedrockProvider(ModelProvider):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
model_instance = self.get_model_instance(ModelType.LLM)
|
model_instance = self.get_model_instance(ModelType.LLM)
|
||||||
bedrock_validate_model_name = credentials.get('model_for_validation', 'amazon.titan-text-lite-v1')
|
|
||||||
|
# Use `amazon.titan-text-lite-v1` model by default for validating credentials
|
||||||
|
model_for_validation = credentials.get('model_for_validation', 'amazon.titan-text-lite-v1')
|
||||||
model_instance.validate_credentials(
|
model_instance.validate_credentials(
|
||||||
model=bedrock_validate_model_name,
|
model=model_for_validation,
|
||||||
credentials=credentials
|
credentials=credentials
|
||||||
)
|
)
|
||||||
except CredentialsValidateFailedError as ex:
|
except CredentialsValidateFailedError as ex:
|
||||||
|
@ -74,7 +74,8 @@ provider_credential_schema:
|
|||||||
label:
|
label:
|
||||||
en_US: Available Model Name
|
en_US: Available Model Name
|
||||||
zh_Hans: 可用模型名称
|
zh_Hans: 可用模型名称
|
||||||
type: text-input
|
type: secret-input
|
||||||
placeholder:
|
placeholder:
|
||||||
en_US: A model you have access to (e.g. amazon.titan-text-lite-v1) for validation.
|
en_US: A model you have access to (e.g. amazon.titan-text-lite-v1) for validation.
|
||||||
zh_Hans: 为了进行验证,请输入一个您可用的模型名称 (例如:amazon.titan-text-lite-v1)
|
zh_Hans: 为了进行验证,请输入一个您可用的模型名称 (例如:amazon.titan-text-lite-v1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user