File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed
pdl-live-react/src/view/detail/kind Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,30 @@ export default function ModelItems({
3535 ? "yaml"
3636 : "plaintext"
3737
38+ // Ugh, some of this logic may be specific to Granite LLM
3839 const meta = Array . isArray ( json )
3940 ? json . flatMap ( ( { meta } , idx ) =>
40- Object . entries ( meta ) . map ( ( [ k , v ] ) => (
41- < Result
42- key = { k + "." + idx }
43- term = { capitalizeAndUnSnakeCase ( k ) }
44- result = { typeof v === "object" ? stringify ( v ) : v }
45- lang = { typeof v === "object" ? "yaml" : undefined }
46- />
47- ) ) ,
41+ Object . entries ( meta )
42+ . map ( ( [ k , v ] ) => {
43+ if (
44+ k === "citation" &&
45+ v &&
46+ typeof v === "object" &&
47+ "snippet" in v
48+ ) {
49+ return [ k , v . snippet ]
50+ } else {
51+ return [ k , v ]
52+ }
53+ } )
54+ . map ( ( [ k , v ] ) => (
55+ < Result
56+ key = { k + "." + idx }
57+ term = { capitalizeAndUnSnakeCase ( String ( k ) ) }
58+ result = { typeof v === "object" ? stringify ( v ) : v }
59+ lang = { typeof v === "object" ? "yaml" : undefined }
60+ />
61+ ) ) ,
4862 )
4963 : undefined
5064
You can’t perform that action at this time.
0 commit comments