Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tour guide #460

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def rag_tool(retriever_config: dict, query=None):
unique_figure_list = [dict(t) for t in unique_set]
state['extra_response']['figures'] = unique_figure_list

context_md = format_rag_data(output["result"]["docs"], state.get("qq_match_contexts", {}))
context_md = format_rag_data(
output["result"]["docs"], state.get("qq_match_contexts", {}))
send_trace(
f"\n\n{context_md}\n\n", enable_trace=state["enable_trace"])
# send_trace(
Expand Down
130 changes: 130 additions & 0 deletions source/portal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion source/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"remark-gfm": "^4.0.0",
"remark-html": "^16.0.1",
"sass": "^1.74.1",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"react-joyride": "^2.9.3"
},
"devDependencies": {
"@types/lodash": "^4.17.0",
Expand Down
36 changes: 16 additions & 20 deletions source/portal/src/layout/CommonLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { useAuth } from 'react-oidc-context';
import ConfigContext from 'src/context/config-context';
import { useLocation, useNavigate } from 'react-router-dom';
import CustomBreadCrumb, { BreadCrumbType } from './CustomBreadCrumb';
import { CustomNavigationItem } from 'src/types';

interface CommonLayoutProps {
activeHref: string;
Expand Down Expand Up @@ -154,6 +155,7 @@ const CommonLayout: React.FC<CommonLayoutProps> = ({
<SideNavigation
activeHref={currentActiveHref}
header={{ href: '/', text: t('name') }}
className="main-navigation"
onFollow={(e) => {
if (!e.detail.external) {
e.preventDefault();
Expand All @@ -165,54 +167,48 @@ const CommonLayout: React.FC<CommonLayoutProps> = ({
type: 'link',
text: t('homeSidebar'),
href: '/',
id: 'home-sidebar',
itemID: 'home-nav'
},
{
type: 'section',
text: t('chatSpace'),
id: 'chat-space',
items: [
{
type: 'link',
text: t('chat'),
href: '/chats',
id: 'chat',
itemID: 'chat-nav'
},
{
type: 'link',
text: t('sessionHistory'),
href: '/sessions',
id: 'session-history',
itemID: 'session-history-nav'
},
],
},
{
type: 'section',
text: t('settings'),
items: layoutItems as readonly any[],
// href: '/chatbot-management',
// },
// {
// type: 'link',
// text: t('intention'),
// href: '/intention',
// },
// {
// type: 'link',
// text: t('docLibrary'),
// href: '/library',
// },
// {
// type: 'link',
// text: t('prompt'),
// href: '/prompts',
// },
// ],
items: layoutItems.map((item, index) => ({
...item,
itemID: `settings-nav-${index}`,
className: item.text.toLowerCase().replace(/\s+/g, '-'),
})),
},
{ type: 'divider' },
{
type: 'link',
text: t('documentation'),
href: 'https://github.com/aws-samples/Intelli-Agent',
external: true,
itemID: 'docs-nav'
},
]}
] as CustomNavigationItem[]}
/>
}
content={<>{isLoading ? <Spinner /> : children}</>}
Expand Down
15 changes: 15 additions & 0 deletions source/portal/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@
"repeatedIndexName": "The index is duplicated with a previous entry, please modify it",
"repeatedIndex": "The index name is already in use. Please choose a different name"
},
"tour":{
"home": "Deploying this solution using the default parameters will build the environment in Amazon Web Services.",
"chat": "Click here to start chatting with the AI assistant.",
"session": "Session history contains all your chat history, you can resume the chat by choosing the chat history.",
"chatbot": "You can create/edit/delete the chatbots. Each chatbot has at least one index for Intention/QD/QQ, Intention index stores the chatbot intentions, QD index stores the knowledges, QQ index stores the FAQ.",
"intention": "Manage your intentions here. The intentions are uploaded via excel files, the chatbot will chat according to the intentions you provided, if no intention is provided, it will retrive knowledges by default.",
"kb": "You can create/update/delete knowledges. Choose index type as QD to inject a knowledge, and choose QQ index type to inject FAQ (only in excel format).",
"prompt": "Manage your prompts here. Conversation summary prompt will rewrite the queries in your chat history, RAG prompt is for how to use the retrieved knowledges to help LLM generate responses, tool calling prompt defines how the agent choose and invoke tools.",
"restartTour": "Start tour",
"previous": "Previous",
"close": "Close",
"finish": "Finish",
"next": "Next",
"skip": "Skip tour"
},
"solutionName": "AI Customer Service",
"subTitle": "Streamlined Workflow for Building Agent-Based Applications",
"projectDescription": "AI Customer Service offers a streamlined workflow for developing scalable, production-grade agent-based applications",
Expand Down
15 changes: 15 additions & 0 deletions source/portal/src/locale/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,21 @@
"indexValid": "索引已经被其他模型使用,请变更索引名称",
"repeatedIndex": "索引名称和现有索引重复,请更换名称"
},
"tour":{
"home": "使用默认参数部署此解决方案将在亚马逊网络服务(Amazon Web Services)中构建此环境。",
"chat": "点击此处开始与人工智能助手对话。",
"session": "会话历史包含您所有的聊天记录,您可以通过选择聊天历史来恢复对话。",
"chatbot": "您可以创建/编辑/删除聊天机器人。每个聊天机器人至少有一个用于意图/QD/QQ的索引,意图索引存储聊天机器人的意图,QD索引存储知识,QQ索引存储常见问题解答。",
"intention": "在此管理您的意图。意图通过Excel文件上传,聊天机器人将根据您提供的意图进行对话。如果没有提供意图,它将默认检索知识库。",
"kb": "您可以创建/更新/删除知识。选择索引类型为QD以注入知识,选择QQ索引类型以注入常见问题解答(仅支持Excel格式)。",
"prompt": "在此管理您的提示词。对话摘要提示词将重写您聊天历史中的查询,RAG提示词用于如何使用检索到的知识来帮助大语言模型生成回复,工具调用提示词定义了代理如何选择和调用工具。",
"restartTour": "开始向导",
"previous": "上一步",
"close": "关闭",
"finish": "完成",
"next": "下一步",
"skip": "跳过向导"
},
"solutionName": "AI Customer Service",
"subTitle": "构建基于代理的应用程序的优化工作流",
"projectDescription": "AI Customer Service提供一个高效简洁的工作流程,用于开发可扩展的、生产级别的、基于 agent(代理)的应用",
Expand Down
Loading
Loading