Skip to content

Commit 4a893c1

Browse files
committed
black
1 parent eb33102 commit 4a893c1

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

services/chatbot/src/chatbot/retrieverutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def get_chroma_collection(api_key):
4646
name="chats",
4747
embedding_function=OpenAIEmbeddingFunction(
4848
api_key=api_key,
49-
model="text-embedding-3-large",
49+
model_name="text-embedding-3-large",
5050
),
5151
)
5252
return collection

services/chatbot/src/mcpserver/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
load_dotenv()
55

6+
67
class Config:
78
TLS_ENABLED = os.getenv("TLS_ENABLED", "false").lower() in ("true", "1", "yes")
89
WEB_SERVICE = os.getenv("WEB_SERVICE", "crapi-web")
910
IDENTITY_SERVICE = os.getenv("IDENTITY_SERVICE", "crapi-identity:8080")
1011
CHROMA_PERSIST_DIRECTORY = os.getenv("CHROMA_PERSIST_DIRECTORY", "/app/vectorstore")
1112
OPENAPI_SPEC = os.getenv("OPENAPI_SPEC", "/app/resources/crapi-openapi-spec.json")
1213
API_USER = os.getenv("API_USER", "admin@example.com")
13-
API_PASSWORD = os.getenv("API_PASSWORD", "Admin!123")
14+
API_PASSWORD = os.getenv("API_PASSWORD", "Admin!123")

services/chatbot/src/mcpserver/server.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
logger.setLevel(logging.DEBUG)
1818

1919
BASE_URL = f"{'https' if Config.TLS_ENABLED else 'http'}://{Config.WEB_SERVICE}"
20-
BASE_IDENTITY_URL = f"{'https' if Config.TLS_ENABLED else 'http'}://{Config.IDENTITY_SERVICE}"
20+
BASE_IDENTITY_URL = (
21+
f"{'https' if Config.TLS_ENABLED else 'http'}://{Config.IDENTITY_SERVICE}"
22+
)
2123
API_KEY = None
2224

2325

@@ -57,6 +59,7 @@ def get_api_key():
5759
return API_KEY
5860
return API_KEY
5961

62+
6063
# Async HTTP client for API calls
6164
def get_http_client():
6265
"""Create and configure the HTTP client with appropriate authentication."""
@@ -68,7 +71,8 @@ def get_http_client():
6871
headers=headers,
6972
)
7073

71-
# Load your OpenAPI spec
74+
75+
# Load your OpenAPI spec
7276
with open(Config.OPENAPI_SPEC, "r") as f:
7377
openapi_spec = json.load(f)
7478

services/chatbot/src/mcpserver/tool_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from langchain.chains import RetrievalQA
88
from langchain_openai import ChatOpenAI
99

10+
1011
async def get_any_api_key():
1112
if os.environ.get("CHATBOT_OPENAI_API_KEY"):
1213
return os.environ.get("CHATBOT_OPENAI_API_KEY")

0 commit comments

Comments
 (0)