Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Create Llama
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Create Llama
Commits
8b81b179
Commit
8b81b179
authored
11 months ago
by
Marcus Schiesser
Browse files
Options
Downloads
Patches
Plain Diff
fix: only render sources with metadata
parent
f1c3e8df
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/types/streaming/nextjs/app/components/ui/chat/chat-sources.tsx
+7
-1
7 additions, 1 deletion
.../streaming/nextjs/app/components/ui/chat/chat-sources.tsx
with
7 additions
and
1 deletion
templates/types/streaming/nextjs/app/components/ui/chat/chat-sources.tsx
+
7
−
1
View file @
8b81b179
...
...
@@ -11,6 +11,7 @@ export function ChatSources({ data }: { data: SourceData }) {
const
sources
=
useMemo
(()
=>
{
return
(
data
.
nodes
?.
filter
((
node
)
=>
Object
.
keys
(
node
.
metadata
).
length
>
0
)
?.
filter
((
node
)
=>
(
node
.
score
??
1
)
>
SCORE_THRESHOLD
)
.
sort
((
a
,
b
)
=>
(
b
.
score
??
1
)
-
(
a
.
score
??
1
))
||
[]
);
...
...
@@ -84,5 +85,10 @@ function NodeInfo({ node }: { node: SourceNode }) {
// node generated by unknown loader, implement renderer by analyzing logged out metadata
console
.
log
(
"
Node metadata
"
,
node
.
metadata
);
return
<
p
>
Sorry, unknown node type. Please add a new renderer.
</
p
>;
return
(
<
p
>
Sorry, unknown node type. Please add a new renderer in the NodeInfo
component.
</
p
>
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment