Skip to content

Commit

Permalink
bugfix baiduvdb retriever
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjial committed Mar 19, 2024
1 parent 418da74 commit da3a033
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ def _init_client(self, instance_id, account, api_key):
from pymochow.auth.bce_credentials import AppBuilderCredentials

gateway = os.getenv("GATEWAY_URL") if os.getenv("GATEWAY_URL") else GATEWAY_URL

appbuilder_token = os.getenv("APPBUILDER_TOKEN")
uri_prefix=self.vdb_uri_prefix + instance_id.encode('utf-8')

config = Configuration(
credentials=AppBuilderCredentials(account, api_key, appbuilder_token),
endpoint=gateway,
uri_perfix=self.vdb_uri_prefix,
uri_prefix=uri_prefix,
connection_timeout_in_mills=DEFAULT_TIMEOUT_IN_MILLS,
)
self.vdb_client = pymochow.MochowClient(config)
Expand Down Expand Up @@ -195,7 +197,10 @@ def _create_table_in_db(
fields.append(Field(FIELD_TEXT, FieldType.STRING))
fields.append(
Field(
FIELD_VECTOR, FieldType.FLOAT_VECTOR, dimension=table_params.dimension
FIELD_VECTOR,
FieldType.FLOAT_VECTOR,
dimension=table_params.dimension,
not_null=True,
)
)

Expand Down

0 comments on commit da3a033

Please sign in to comment.