Spaces:
Running
Running
Fix Pydantic model conversion and remove Railway dependency
Browse files- main.py +1 -1
- main_streamlit.py +3 -3
main.py
CHANGED
|
@@ -378,7 +378,7 @@ async def find_schemes(request: SchemeRequest):
|
|
| 378 |
return ApiResponse(
|
| 379 |
success=True,
|
| 380 |
message="Schemes found successfully",
|
| 381 |
-
data=response
|
| 382 |
)
|
| 383 |
except Exception as e:
|
| 384 |
logger.error(f"Scheme search failed: {str(e)}")
|
|
|
|
| 378 |
return ApiResponse(
|
| 379 |
success=True,
|
| 380 |
message="Schemes found successfully",
|
| 381 |
+
data=response.model_dump() if hasattr(response, 'model_dump') else response
|
| 382 |
)
|
| 383 |
except Exception as e:
|
| 384 |
logger.error(f"Scheme search failed: {str(e)}")
|
main_streamlit.py
CHANGED
|
@@ -8,9 +8,9 @@ load_dotenv()
|
|
| 8 |
st.set_page_config(layout="wide", page_title="Jan-Contract Unified Assistant", page_icon="⚖️")
|
| 9 |
|
| 10 |
# Backend Configuration
|
| 11 |
-
# Default to
|
| 12 |
-
|
| 13 |
-
default_url = os.getenv("BACKEND_URL",
|
| 14 |
|
| 15 |
with st.sidebar:
|
| 16 |
with st.expander("⚙️ Connection Settings"):
|
|
|
|
| 8 |
st.set_page_config(layout="wide", page_title="Jan-Contract Unified Assistant", page_icon="⚖️")
|
| 9 |
|
| 10 |
# Backend Configuration
|
| 11 |
+
# Default to local server (run with: python -m uvicorn main:app --port 8000)
|
| 12 |
+
LOCAL_URL = "http://localhost:8000"
|
| 13 |
+
default_url = os.getenv("BACKEND_URL", LOCAL_URL)
|
| 14 |
|
| 15 |
with st.sidebar:
|
| 16 |
with st.expander("⚙️ Connection Settings"):
|