Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
c708b76
feat: upload code
Xavieru718 May 6, 2024
82aa830
feat: upload code
Xavieru718 May 6, 2024
fd32a25
feat: upload code
Xavieru718 May 6, 2024
a556465
Add input area
binbin821 May 6, 2024
cc9b7c1
Add recommended questions
binbin821 May 6, 2024
46cd4a9
feat: login & config
Xavieru718 May 7, 2024
be60e7f
feat: login & config
Xavieru718 May 7, 2024
e455c53
Add answer display with mock data
binbin821 May 7, 2024
b7a57c7
Add chart data format conversion
binbin821 May 7, 2024
868bc29
feat: upload code
Xavieru718 May 8, 2024
3fd52e8
Integrate get custom questions API
binbin821 May 8, 2024
0394660
Merge branch 'feature/report' of github.com:aws-samples/generative-bi…
Xavieru718 May 8, 2024
619c1c3
Integrate ask API
binbin821 May 8, 2024
c1c5813
feat: rename login
Xavieru718 May 8, 2024
254b9a2
feat: rename login
Xavieru718 May 8, 2024
19e81dd
Add reject intent
binbin821 May 8, 2024
c9b4fae
Add knowledge search result
binbin821 May 8, 2024
7a438a7
Add config value
binbin821 May 9, 2024
c0a003c
Handle API exception
binbin821 May 9, 2024
d758400
Add upvote ui
binbin821 May 9, 2024
950decd
Add qa/ask API test
binbin821 May 9, 2024
0ee0a8c
Add suggested questions display
binbin821 May 9, 2024
4af04e9
Integrate Upvote/Downvote API
binbin821 May 9, 2024
a47fa56
Remove undefined ui in topnavigation
binbin821 May 10, 2024
ff9f2ca
Handle setting button click event
binbin821 May 10, 2024
976100e
Update UI style
binbin821 May 10, 2024
5440a02
Support user to query with suggested question
binbin821 May 10, 2024
4b6add2
feat: upload nginx & docker file
Xavieru718 May 10, 2024
f93ad1d
feat: upload nginx & docker file
Xavieru718 May 10, 2024
5ba61c0
change api
supinyu May 11, 2024
161a134
change api
supinyu May 11, 2024
a366aa8
Agent search result display
binbin821 May 10, 2024
080dc5c
feat: fix default toggle
Xavieru718 May 11, 2024
07fdb4c
Merge branch 'feature/report' of github.com:aws-samples/generative-bi…
Xavieru718 May 11, 2024
f70b89b
feat: fix error type
Xavieru718 May 11, 2024
cbbe1ff
feat: fix error type
Xavieru718 May 11, 2024
d5340bd
Add window scroll
binbin821 May 11, 2024
ea5630f
Remove query test API
binbin821 May 11, 2024
59d2265
add log store
supinyu May 11, 2024
12cd766
add log store
supinyu May 11, 2024
0111e1c
add log store
supinyu May 11, 2024
111d138
Merge branch 'main' into spy_dev
supinyu May 11, 2024
e3df1f7
remove model id
supinyu May 11, 2024
3678fc5
change log id
supinyu May 11, 2024
7522c01
change log id
supinyu May 11, 2024
ca64579
feat: fix scroll and style
binbin821 May 11, 2024
5ce16bb
Merge remote-tracking branch 'origin/main' into feature/report
May 11, 2024
f8de187
Merge pull request #70 from aws-samples/spy_dev
supinyu May 11, 2024
772115e
add user_feedback_downvote
supinyu May 11, 2024
4f3a5a3
feat: fix docker file
Xavieru718 May 11, 2024
34e2879
Merge branch 'feature/report' of github.com:aws-samples/generative-bi…
Xavieru718 May 11, 2024
607ddfb
fix some error
supinyu May 11, 2024
a5e2f32
chang agent cot prompt
supinyu May 11, 2024
a2d673e
chang agent cot prompt example
supinyu May 11, 2024
9a1d3d6
Merge branch 'spy_dev' of https://github.com/aws-samples/generative-b…
supinyu May 11, 2024
efc0055
chang agent cot prompt example
supinyu May 11, 2024
8369c3d
chang agent cot prompt example
supinyu May 11, 2024
74241b6
add status_code response
supinyu May 11, 2024
b4a1cde
Merge pull request #71 from aws-samples/spy_dev
supinyu May 12, 2024
2c45009
Scroll to current view if not in viewport
binbin821 May 11, 2024
5e9d6fb
Get custom questions based on different data profile
binbin821 May 13, 2024
87c68db
change agent cot
supinyu May 14, 2024
6431f50
Merge pull request #72 from aws-samples/spy_dev
supinyu May 14, 2024
47f8b5d
Merge pull request #73 from aws-samples/feature/report
wzt1001 May 15, 2024
1ad074b
Add files via upload
wzt1001 May 15, 2024
34a13c0
feat: data profile is null
binbin821 May 15, 2024
dce9aeb
change streamlit show
supinyu May 15, 2024
f2dab07
Merge branch 'main' into spy_dev
supinyu May 15, 2024
3e8f9bb
change api
supinyu May 16, 2024
4353564
change api
supinyu May 16, 2024
771ba4d
feat: update insight check
Xavieru718 May 16, 2024
883591f
Merge branch 'feature/report' of github.com:aws-samples/generative-bi…
Xavieru718 May 16, 2024
f51fc06
add chart data
supinyu May 16, 2024
eb1dc58
add chart data
supinyu May 16, 2024
7197101
fix user_feedback_downvote return False
supinyu May 16, 2024
888576b
fix user_feedback_downvote return False
supinyu May 16, 2024
342a381
feat: ui optimization
binbin821 May 15, 2024
5b6b08e
fix agent search chart data show
supinyu May 16, 2024
113f2eb
fix get_agent_cot_task some bug
supinyu May 16, 2024
6f42000
fix get_agent_cot_task some bug
supinyu May 16, 2024
14ab94c
check sql_chart_data format
supinyu May 16, 2024
f965f1a
check sql_chart_data format
supinyu May 16, 2024
cc883dc
check sql_chart_data format
supinyu May 16, 2024
484578b
check sql_chart_data format
supinyu May 17, 2024
b66bc91
remove data_visualization_chart
supinyu May 17, 2024
2f8606a
fix some error for agent
supinyu May 17, 2024
ba21892
fix some error for agent
supinyu May 17, 2024
4b26afc
fix some error for agent
supinyu May 17, 2024
d6e5567
fix show logic
supinyu May 17, 2024
ded573f
fix show logic
supinyu May 17, 2024
fb92d40
fix show logic
supinyu May 17, 2024
c8042f0
Merge pull request #74 from aws-samples/feature/report
binbin821 May 17, 2024
b4db997
change dynamoDB BillingMode
supinyu May 17, 2024
625eae4
Merge pull request #75 from aws-samples/spy_dev
supinyu May 17, 2024
00a462d
dependabot[bot] May 21, 2024
b8a3d8b
Merge pull request #76 from aws-samples/dependabot/pip/application/py…
supinyu May 22, 2024
9a59994
feat: disable scroll when body empty
binbin821 May 21, 2024
8c806f6
Add env
binbin821 May 23, 2024
f7b419d
Merge pull request #77 from aws-samples/feature/report
binbin821 May 23, 2024
f4eb736
Update .env
binbin821 May 23, 2024
99dbe11
add mysql schema
supinyu May 24, 2024
0b80b0e
Merge branch 'main' into spy_dev
supinyu May 24, 2024
0e627e5
Merge pull request #78 from aws-samples/spy_dev
supinyu May 24, 2024
6065ab4
change the password to hashed password
supinyu May 24, 2024
4ce7a9e
Update README.md
wzt1001 May 25, 2024
f251cee
Add a right logo
binbin821 May 27, 2024
7eb2736
Merge pull request #79 from aws-samples/feature/report
binbin821 May 27, 2024
6dad443
Add files via upload
supinyu May 28, 2024
2b0294f
Merge pull request #80 from supinyu/derby
supinyu May 28, 2024
5c5718e
Delete report-front-end/public/derby-logo.png
supinyu May 28, 2024
5b0d46b
Merge branch 'main' into spy_dev
supinyu Jun 3, 2024
35dfc0f
Merge branch 'feature/report' of https://github.com/aws-samples/gener…
Jun 3, 2024
061e29b
change prompt
supinyu Jun 3, 2024
afa84c0
Merge pull request #81 from aws-samples/spy_dev
supinyu Jun 3, 2024
f1b0368
deleted sole page for future suggested questions
Jun 4, 2024
fff1858
removed page
Jun 4, 2024
fcec8bb
Merge pull request #82 from aws-samples/1.2.0wangzt
wzt1001 Jun 4, 2024
a02d8aa
add DYNAMODB_AWS_REGION
supinyu Jun 5, 2024
46b732e
add DYNAMODB_AWS_REGION
supinyu Jun 5, 2024
a8cb6f8
fix bug when create data profile
supinyu Jun 6, 2024
796d4e8
add docker compose sh
supinyu Jun 6, 2024
c23add4
add shopping demo profiles
supinyu Jun 6, 2024
185abff
fix some bug for table show
supinyu Jun 6, 2024
7bb831b
Merge pull request #83 from aws-samples/spy_dev
supinyu Jun 6, 2024
b0fd562
add hava_session_state_flag judge
supinyu Jun 6, 2024
5c6c7f0
Merge pull request #84 from aws-samples/spy_dev
supinyu Jun 6, 2024
f2acf18
update init hava_session_state_flag judge
supinyu Jun 6, 2024
51aee06
Merge pull request #85 from aws-samples/spy_dev
supinyu Jun 6, 2024
4204ae5
change readme
supinyu Jun 7, 2024
a3eeceb
add mysql schema
supinyu May 24, 2024
ca0e133
change the password to hashed password
supinyu May 24, 2024
d87fd48
Update README.md
wzt1001 May 25, 2024
16ee866
Add files via upload
supinyu May 28, 2024
7ccc6ad
Delete report-front-end/public/derby-logo.png
supinyu May 28, 2024
35bb5c6
change prompt
supinyu Jun 3, 2024
5c8f3b2
add DYNAMODB_AWS_REGION
supinyu Jun 5, 2024
0c0dd0c
add DYNAMODB_AWS_REGION
supinyu Jun 5, 2024
3c6834d
fix bug when create data profile
supinyu Jun 6, 2024
8c8ed2d
add docker compose sh
supinyu Jun 6, 2024
a0e60f0
add shopping demo profiles
supinyu Jun 6, 2024
1d05e41
fix some bug for table show
supinyu Jun 6, 2024
dbc9240
add hava_session_state_flag judge
supinyu Jun 6, 2024
bcdc901
update init hava_session_state_flag judge
supinyu Jun 6, 2024
6cd8a89
Add cognito
binbin821 Jun 7, 2024
5427a7d
Merge pull request #86 from aws-samples/feature/report
binbin821 Jun 7, 2024
2691f18
Add email to confirm login
binbin821 Jun 7, 2024
f32fa93
Merge pull request #87 from aws-samples/feature/report
binbin821 Jun 7, 2024
e1788ee
feat: scroll bug
binbin821 Jun 7, 2024
4cbec02
Merge pull request #88 from aws-samples/feature/report
binbin821 Jun 7, 2024
b56f842
Add this statement in mysql prompt to fix the generating SQL error. T…
NancyWu007 May 24, 2024
ec93b8a
Update database.py
wzt1001 Jun 10, 2024
0518a88
fix case for hava_session_state_flag
supinyu Jun 11, 2024
91e42a3
Merge pull request #89 from Honeyfish20/main
supinyu Jun 11, 2024
d2c5dea
Merge pull request #90 from aws-samples/spy_dev
supinyu Jun 11, 2024
d580713
change max token
supinyu Jun 12, 2024
4b2458e
change websocket api
supinyu Jun 12, 2024
c61a73c
change websocket api
supinyu Jun 12, 2024
edae30b
change websocket api
supinyu Jun 12, 2024
b39e943
change websocket api
supinyu Jun 12, 2024
7707354
ui update
binbin821 Jun 7, 2024
f5e11ae
Merge pull request #91 from aws-samples/feature/report
binbin821 Jun 12, 2024
21e375d
change websocket api
supinyu Jun 13, 2024
0ea5024
Remove preset credential in config
Deng-Ryan Jun 13, 2024
1ab1ee4
Merge pull request #92 from aws-samples/dengru_dev
Deng-Ryan Jun 13, 2024
3f2611f
change agent cot task
supinyu Jun 13, 2024
b8d1903
change agent cot task
supinyu Jun 13, 2024
29ab545
change prompt update
supinyu Jun 14, 2024
cefe3a3
add websocket
binbin821 Jun 13, 2024
736ef67
Merge pull request #93 from aws-samples/feature/report
binbin821 Jun 14, 2024
8ce2b07
add context window
binbin821 Jun 14, 2024
b577d50
Merge pull request #94 from aws-samples/feature/report
binbin821 Jun 14, 2024
ee247ce
change main page readme
supinyu Jun 17, 2024
50a5df3
Merge branch 'main' of https://github.com/aws-samples/generative-bi-u…
supinyu Jun 17, 2024
012e6a8
Merge branch 'main' into spy_dev
supinyu Jun 17, 2024
72f7fe9
add agent question state
supinyu Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ celerybeat.pid
*.sage.py

# Environments
.env
.venv
env/
venv/
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This is a comprehensive framework designed to enable Generative BI capabilities
- Text-to-SQL functionality for querying customized data sources using natural language.
- User-friendly interface for adding, editing, and managing data sources, tables, and column descriptions.
- Performance enhancement through the integration of historical question-answer ranking and entity recognition.
- Customize business information, including entity information, formulas, SQL samples, and analysis ideas for complex business problems.
- Add agent task splitting function to handle complex attribution analysis problems.
- Intuitive question-answering UI that provides insights into the underlying Text-to-SQL mechanism.
- Simple agent design interface for handling complex queries through a conversational approach.

Expand Down Expand Up @@ -50,10 +52,17 @@ After the role is created, and then add permission by creating inline policy as
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"bedrock:*",
"dynamodb:*"
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream",
"dynamodb:*Table",
"dynamodb:*Item",
"dynamodb:Scan",
"dynamodb:Query"
],
"Resource": "*"
"Resource": [
"arn:aws:bedrock:us-west-2::foundation-model/*",
"arn:aws:dynamodb:us-west-2:**YOURACCOUNTID**:table/Nlq*"
]
}
]
}
Expand Down Expand Up @@ -171,7 +180,7 @@ the default account is

```
username: admin
password: awsadmin
password: # Please set the password following instructions below
```

if you want change the password or add username, you can change the
Expand Down Expand Up @@ -203,8 +212,8 @@ preauthorized:
change the password to hashed password

```python
import streamlit_authenticator as stauth
hashed_passwords = stauth.Hasher(['abc', 'def']).generate()
from streamlit_authenticator.utilities.hasher import Hasher
hashed_passwords = Hasher(['abc', 'def']).generate()
```


Expand Down
8 changes: 5 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- 通过自然语言查询自定义数据源的Text-to-SQL功能。
- 用户友好的界面,可添加、编辑和管理数据源、表和列描述。
- 通过集成历史问题答案排名和实体识别来提高性能。
- 自定义业务信息,包括实体信息,公式,SQL样本,复杂业务问题分析思路等。
- 增加agent任务拆分功能,能够处理复杂的归因分析问题。
- 直观的问答界面,可深入了解底层的Text-to-SQL机制。
- 简单的代理设计界面,可通过对话方式处理复杂查询。

Expand Down Expand Up @@ -163,7 +165,7 @@ docker exec nlq-webserver python opensearch_deploy.py custom false

```
username: admin
password: awsadmin
password: # 请按照以下教程设定密码
```

如果你想修改密码或者增加用户,可以修改如下文件
Expand Down Expand Up @@ -196,8 +198,8 @@ preauthorized:
密码需要从明文转换成哈希过之后的密码,可以通过如下方式,获取

```python
import streamlit_authenticator as stauth
hashed_passwords = stauth.Hasher(['abc', 'def']).generate()
from streamlit_authenticator.utilities.hasher import Hasher
hashed_passwords = Hasher(['abc', 'def']).generate()
```


Expand Down
1 change: 1 addition & 0 deletions application/api/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ def get_message(self):
class ContentEnum(Enum):
EXCEPTION = "exception"
COMMON = "common"
STATE = "state"
END = "end"
388 changes: 45 additions & 343 deletions application/api/main.py

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions application/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class Question(BaseModel):
agent_cot_flag: bool = True
profile_name: str = "shopping-demo"
explain_gen_process_flag: bool = True
gen_suggested_question_flag: bool = True
gen_suggested_question_flag: bool = False
answer_with_insights: bool = False
top_k: float = 250
top_p: float = 0.9
max_tokens: int = 2048
temperature: float = 0.01


class QuestionSocket(Question):
session_id: str
context_window: int = 3
session_id: str = "-1"
user_id: str = "admin"


class Example(BaseModel):
Expand All @@ -28,13 +28,6 @@ class Example(BaseModel):
answer: str


# class Answer(BaseModel):
# examples: list[Example]
# sql: str
# sql_explain: str
# sql_query_result: list[Any]


class QueryEntity(BaseModel):
query: str
sql: str
Expand All @@ -45,7 +38,7 @@ class FeedBackInput(BaseModel):
data_profiles: str
query: str
query_intent: str
query_answer_list: list[QueryEntity]
query_answer: str


class Option(BaseModel):
Expand All @@ -57,21 +50,23 @@ class CustomQuestion(BaseModel):
custom_question: list[str]


class ChartEntity(BaseModel):
chart_type: str
chart_data: list[Any]


class SQLSearchResult(BaseModel):
sql: str
sql_data: list[Any]
data_show_type: str
sql_gen_process: str
data_analyse: str
sql_data_chart: list[ChartEntity]


class TaskSQLSearchResult(BaseModel):
sub_task_query: str
sql: str
sql_data: list[Any]
data_show_type: str
sql_gen_process: str
data_analyse: str
sql_search_result: SQLSearchResult


class KnowledgeSearchResult(BaseModel):
Expand Down
Loading