SAAHMATHWORKS commited on
Commit
531a2b2
·
1 Parent(s): 3e14b58

Add Python path fix to all modules

Browse files
api/main.py CHANGED
@@ -1,4 +1,9 @@
1
  # api/main.py
 
 
 
 
 
2
  from typing import Optional
3
  from contextlib import asynccontextmanager
4
  from fastapi import FastAPI, Query, HTTPException
 
1
  # api/main.py
2
+ # Add project root to Python path
3
+ import sys
4
+ from pathlib import Path
5
+ sys.path.insert(0, str(Path(__file__).parent.parent))
6
+
7
  from typing import Optional
8
  from contextlib import asynccontextmanager
9
  from fastapi import FastAPI, Query, HTTPException
database/mongodb_client.py CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  from pymongo import MongoClient, ReadPreference
2
  from pymongo.errors import ServerSelectionTimeoutError, ConnectionFailure
3
  from langchain_mongodb.vectorstores import MongoDBAtlasVectorSearch
 
1
+ # Add project root to Python path
2
+ import sys
3
+ from pathlib import Path
4
+ sys.path.insert(0, str(Path(__file__).parent.parent))
5
+
6
  from pymongo import MongoClient, ReadPreference
7
  from pymongo.errors import ServerSelectionTimeoutError, ConnectionFailure
8
  from langchain_mongodb.vectorstores import MongoDBAtlasVectorSearch
database/postgres_checkpointer.py CHANGED
@@ -1,4 +1,8 @@
1
  # database/postgres_checkpointer.py - CORRECT VERSION
 
 
 
 
2
  from psycopg_pool import AsyncConnectionPool
3
  from psycopg.rows import dict_row
4
  from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver # ✅ Correct import
 
1
  # database/postgres_checkpointer.py - CORRECT VERSION
2
+ # Add project root to Python path
3
+ import sys
4
+ from pathlib import Path
5
+ sys.path.insert(0, str(Path(__file__).parent.parent))
6
  from psycopg_pool import AsyncConnectionPool
7
  from psycopg.rows import dict_row
8
  from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver # ✅ Correct import