Skip to content

fix(robot): add the role message markdown and upgrade the tiny-robot version #3471

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

Merged
merged 1 commit into from
Jun 3, 2025
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
6 changes: 3 additions & 3 deletions examples/sites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@docsearch/react": "npm:@docsearch/css",
"@modelcontextprotocol/sdk": "1.12.1",
"@opentiny/next": "0.1.2",
"@opentiny/tiny-robot": "0.2.0-alpha.7",
"@opentiny/tiny-robot-kit": "0.2.0-alpha.7",
"@opentiny/tiny-robot-svgs": "0.2.0-alpha.7",
"@opentiny/tiny-robot": "0.2.0-alpha.8",
"@opentiny/tiny-robot-kit": "0.2.0-alpha.8",
"@opentiny/tiny-robot-svgs": "0.2.0-alpha.8",
"@opentiny/tiny-schema-renderer": "1.0.0-beta.5",
"@opentiny/tiny-vue-mcp": "0.0.1-beta.1",
"@opentiny/utils": "workspace:~",
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/src/views/components-doc/common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ defineExpose({ loadPage })
const show = ref(false)
onMounted(() => {
// tiny-robot 通过路由参数存在 mcp-robot, 则弹出对话容器
const hasRobot = router.currentRoute.value.hash === '#grid-ai-agent'
const hasRobot = router.currentRoute.value.fullPath.includes('grid-ai-agent')
show.value = !!hasRobot

document.body.classList.toggle('docs-on-robot-show', show.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export function useTinyRobot() {

const roles = {
assistant: {
type: 'markdown',
placement: 'start',
avatar: aiAvatar,
maxWidth: '80%'
Expand Down
19 changes: 19 additions & 0 deletions examples/sites/src/views/components-doc/composition/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ export async function handleSSEStream(response: Response, handler: StreamHandler
if (!dataMatch) continue

const data = JSON.parse(dataMatch[1])
if (data?.event === 'workflow_started') {
handler.onData({
id: data.workflow_run_id,
created: data.created_at,
choices: [
{
index: messageIndex++,
delta: {
role: 'assistant',
content: '**Workflow started** \r\n'
},
finish_reason: null
}
],
object: '',
model: ''
})
}

if (data?.event === 'message' && data?.answer) {
handler.onData({
id: data.id,
Expand Down
Loading