File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
pdl-live-react/src/view/detail/kind Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { stringify } from "yaml"
22
33import Group from "../Group"
44import Result from "../../Result"
5+ import { capitalizeAndUnSnakeCase } from "../../../helpers"
56
67function tryJson ( s : unknown ) {
78 if ( typeof s === "string" ) {
@@ -19,6 +20,8 @@ export default function ModelItems({
1920} : {
2021 block : import ( "../../../pdl_ast" ) . LitellmModelBlock
2122} ) {
23+ // All of this JSON stuff is to handle structured responses from the
24+ // model
2225 const json = tryJson ( result )
2326 const resultForDisplay = Array . isArray ( json )
2427 ? json . map ( ( { sentence } ) => sentence ) . join ( "\n" )
@@ -37,7 +40,7 @@ export default function ModelItems({
3740 Object . entries ( meta ) . map ( ( [ k , v ] ) => (
3841 < Result
3942 key = { k + "." + idx }
40- term = { k }
43+ term = { capitalizeAndUnSnakeCase ( k ) }
4144 result = { typeof v === "object" ? stringify ( v ) : v }
4245 lang = { typeof v === "object" ? "yaml" : undefined }
4346 />
You can’t perform that action at this time.
0 commit comments