File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
gc-qa-rag-frontend/src/services
gc-qa-rag-server/ragapp/common Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export const getChatResult = async (
60
60
} ,
61
61
body : requestBody ,
62
62
signal : controller . signal ,
63
+ openWhenHidden :true ,
63
64
async onopen ( response ) {
64
65
if ( response . ok ) {
65
66
return ;
@@ -126,6 +127,7 @@ export const getThinkResult = async (
126
127
} ,
127
128
body : requestBody ,
128
129
signal : controller . signal ,
130
+ openWhenHidden : true ,
129
131
async onopen ( response ) {
130
132
if ( response . ok ) {
131
133
return ;
Original file line number Diff line number Diff line change 1
1
from typing import Generator , List , Dict , Any
2
- from datetime import datetime
2
+ from datetime import datetime , timedelta
3
3
from sqlalchemy import (
4
4
create_engine ,
5
5
Column ,
@@ -145,18 +145,31 @@ def add_qa_feedback(
145
145
146
146
def get_search_history_by_date (self , date : str ) -> List [Dict [str , Any ]]:
147
147
"""Get search history records for a specific date.
148
-
148
+
149
149
Args:
150
- date: The date to query for
151
-
150
+ date: The date to query for in format 'YYYY/MM/DD' or 'YYYY-MM-DD'
151
+
152
152
Returns:
153
153
List[Dict[str, Any]]: List of search history records
154
154
"""
155
155
try :
156
+ # Convert input date to datetime object
157
+ try :
158
+ # Try with / format first
159
+ date_obj = datetime .strptime (date , "%Y/%m/%d" ).date ()
160
+ except ValueError :
161
+ # Try with - format if / fails
162
+ date_obj = datetime .strptime (date , "%Y-%m-%d" ).date ()
163
+
164
+ next_day = date_obj + timedelta (days = 1 )
165
+
156
166
with self .get_session () as session :
157
167
results = (
158
168
session .query (SearchHistory )
159
- .filter (SearchHistory .create_time .cast (String ).like (f"{ date } %" ))
169
+ .filter (
170
+ SearchHistory .create_time >= date_obj ,
171
+ SearchHistory .create_time < next_day
172
+ )
160
173
.all ()
161
174
)
162
175
return [
You can’t perform that action at this time.
0 commit comments