Spaces:
Running
Running
axeronis commited on
Commit ·
df78a99
1
Parent(s): d5e5285
fix(backend): use GoogleGeminiClient instead of non-existent GeminiClient
Browse files
backend/app/api/landing.py
CHANGED
|
@@ -8,7 +8,7 @@ from app.models.landing import LandingConfig
|
|
| 8 |
from app.schemas.landing import LandingConfigResponse, LandingConfigUpdate
|
| 9 |
from app.api.deps import get_current_user
|
| 10 |
from app.models.user import User, UserRole
|
| 11 |
-
from app.services.gemini_client import
|
| 12 |
|
| 13 |
router = APIRouter()
|
| 14 |
|
|
@@ -120,7 +120,7 @@ async def demo_chat(request: DemoChatRequest):
|
|
| 120 |
"""
|
| 121 |
try:
|
| 122 |
# Initialize Gemini client
|
| 123 |
-
gemini =
|
| 124 |
|
| 125 |
# Format chat history for Gemini
|
| 126 |
chat_history = []
|
|
@@ -132,10 +132,10 @@ async def demo_chat(request: DemoChatRequest):
|
|
| 132 |
response = await gemini.generate_response(
|
| 133 |
prompt=request.message,
|
| 134 |
system_instruction=DEMO_SYSTEM_PROMPT,
|
| 135 |
-
|
| 136 |
)
|
| 137 |
|
| 138 |
-
return DemoChatResponse(reply=response
|
| 139 |
|
| 140 |
except Exception as e:
|
| 141 |
print(f"Demo chat error: {e}")
|
|
|
|
| 8 |
from app.schemas.landing import LandingConfigResponse, LandingConfigUpdate
|
| 9 |
from app.api.deps import get_current_user
|
| 10 |
from app.models.user import User, UserRole
|
| 11 |
+
from app.services.gemini_client import GoogleGeminiClient
|
| 12 |
|
| 13 |
router = APIRouter()
|
| 14 |
|
|
|
|
| 120 |
"""
|
| 121 |
try:
|
| 122 |
# Initialize Gemini client
|
| 123 |
+
gemini = GoogleGeminiClient()
|
| 124 |
|
| 125 |
# Format chat history for Gemini
|
| 126 |
chat_history = []
|
|
|
|
| 132 |
response = await gemini.generate_response(
|
| 133 |
prompt=request.message,
|
| 134 |
system_instruction=DEMO_SYSTEM_PROMPT,
|
| 135 |
+
context=chat_history
|
| 136 |
)
|
| 137 |
|
| 138 |
+
return DemoChatResponse(reply=response, success=True)
|
| 139 |
|
| 140 |
except Exception as e:
|
| 141 |
print(f"Demo chat error: {e}")
|