Update rag_chain.py
This commit is contained in:
parent
2f66a36d10
commit
1c6a0a6469
@ -2,8 +2,8 @@
|
|||||||
import os
|
import os
|
||||||
import weaviate
|
import weaviate
|
||||||
from weaviate import Client
|
from weaviate import Client
|
||||||
from weaviate import WeaviateClient
|
# from weaviate import WeaviateClient
|
||||||
from weaviate.connect import ConnectionParams
|
# from weaviate.connect import ConnectionParams
|
||||||
from weaviate.auth import AuthApiKey
|
from weaviate.auth import AuthApiKey
|
||||||
from weaviate.auth import AuthCredentials
|
from weaviate.auth import AuthCredentials
|
||||||
from weaviate.classes.init import Auth
|
from weaviate.classes.init import Auth
|
||||||
@ -76,25 +76,25 @@ def build_rag_chain():
|
|||||||
# auth_cre= AuthCredentials.api_key("01js3q6y7twaxccm5dbh3se9bt")
|
# auth_cre= AuthCredentials.api_key("01js3q6y7twaxccm5dbh3se9bt")
|
||||||
|
|
||||||
# 커넥션 설정 (http, grpc 둘 다)
|
# 커넥션 설정 (http, grpc 둘 다)
|
||||||
auth_client_secret=Auth.api_key("01js3q6y7twaxccm5dbh3se9bt")
|
# auth_client_secret=Auth.api_key("01js3q6y7twaxccm5dbh3se9bt")
|
||||||
connection_params = ConnectionParams.from_params(
|
# connection_params = ConnectionParams.from_params(
|
||||||
http_host="183.111.96.67",
|
# http_host="183.111.96.67",
|
||||||
http_port=32668,
|
# http_port=32668,
|
||||||
http_secure=False,
|
# http_secure=False,
|
||||||
grpc_host="183.111.96.67",
|
# grpc_host="183.111.96.67",
|
||||||
grpc_port=32619, # 예시 포트, 실제 grpc 포트 넣어야 함
|
# grpc_port=32619, # 예시 포트, 실제 grpc 포트 넣어야 함
|
||||||
grpc_secure=False
|
# grpc_secure=False
|
||||||
)
|
# )
|
||||||
|
|
||||||
client4 = WeaviateClient(connection_params=connection_params, auth_client_secret=auth_client_secret)
|
# client4 = WeaviateClient(connection_params=connection_params, auth_client_secret=auth_client_secret)
|
||||||
|
|
||||||
if client4.is_ready():
|
# if client4.is_ready():
|
||||||
print("Weaviate 4 연결 성공!")
|
# print("Weaviate 4 연결 성공!")
|
||||||
else:
|
# else:
|
||||||
print("연결 실패 4. 서버 상태를 확인하세요.")
|
# print("연결 실패 4. 서버 상태를 확인하세요.")
|
||||||
|
|
||||||
import weaviate as legacy_weaviate
|
# import weaviate as legacy_weaviate
|
||||||
legacy_client = legacy_weaviate.Client(connection_params=client4.connection_params) # langchain용
|
# legacy_client = legacy_weaviate.Client(connection_params=client4.connection_params) # langchain용
|
||||||
|
|
||||||
|
|
||||||
client = weaviate.Client(
|
client = weaviate.Client(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user