adding serialziation back to multilmp

This commit is contained in:
William Guss
2024-07-27 16:34:34 -07:00
parent f4c66ca641
commit 9dea134533
6 changed files with 33 additions and 17 deletions

View File

@@ -107,6 +107,11 @@ You can then visualize your promtps by visiting the frontend on `http://localhos
## Todos
### Metrics
- [ ] Design the metrics functionality. (maybe link WandB lol)
### Bugs
- [ ] Fix weird rehashing issue of the main prompt whenever subprompt changes? Or just make commits more of a background deal.
@@ -149,6 +154,7 @@ You can then visualize your promtps by visiting the frontend on `http://localhos
## Store
- [ ] Improve developer experience around logging mechanisms
- [ ] Drastically improve query runtime and performance test.
## DX (Developer Experience)
- [x] Enhance UX for the LMP details page

View File

@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Ell Studio</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@@ -12,7 +12,8 @@ export function CodeSection({
lines,
startingLineNumber = 1,
isDependent = false,
collapsedHeight = '150px' // New prop with default value
collapsedHeight = '150px',
showLineNumbers = true // New prop with default value
}) {
const [isHovering, setIsHovering] = useState(false);
const codeRef = useRef(null);
@@ -47,7 +48,7 @@ export function CodeSection({
<SyntaxHighlighter
language="python"
style={atomDark}
showLineNumbers={true}
showLineNumbers={showLineNumbers}
startingLineNumber={startingLineNumber}
customStyle={{
margin: 0,

View File

@@ -168,7 +168,7 @@ const HierarchicalTable = ({ schema, data, onRowClick, onSelectionChange, initia
onSelectionChange={onSelectionChange}
initialSortConfig={initialSortConfig}
>
<div className="overflow-x-auto">
<div className="overflow-x-auto hide-scrollbar">
<table className="w-full">
<TableHeader
schema={schema}

View File

@@ -12,7 +12,7 @@ const InvocationDetailsSidebar = ({ invocation, onClose }) => {
const resizeRef = useRef(null);
const argsLines = useMemo(() => {
return lstrCleanStringify(invocation.args, 1);
return invocation.args.length > 0 ? lstrCleanStringify(invocation.args, 1) : null;
}, [invocation.args]);
const kwargsLines = useMemo(() => {
@@ -24,7 +24,7 @@ const InvocationDetailsSidebar = ({ invocation, onClose }) => {
}, [invocation.kwargs]);
useEffect(() => {
if (argsLines.split('\n').length > 10 || (hasKwargs && kwargsLines.split('\n').length > 10)) {
if ((argsLines && argsLines.split('\n').length > 10) || (hasKwargs && kwargsLines.split('\n').length > 10)) {
setInputExpanded(false);
}
}, [argsLines, kwargsLines, hasKwargs]);
@@ -104,15 +104,18 @@ const InvocationDetailsSidebar = ({ invocation, onClose }) => {
</div>
<div className="flex flex-grow source-code-container">
<div className="flex-grow p-4 overflow-y-auto w-[400px] hide-scrollbar">
<CodeSection
title="Args"
code={argsLines}
showCode={inputExpanded}
setShowCode={setInputExpanded}
collapsedHeight={'300px'}
lines={argsLines.split('\n').length}
language="json"
/>
{argsLines && (
<CodeSection
title="Args"
code={argsLines}
showCode={inputExpanded}
setShowCode={setInputExpanded}
collapsedHeight={'300px'}
lines={argsLines.split('\n').length}
language="json"
showLineNumbers={false}
/>
)}
{hasKwargs && (
<CodeSection
@@ -123,6 +126,7 @@ const InvocationDetailsSidebar = ({ invocation, onClose }) => {
collapsedHeight={'300px'}
lines={kwargsLines.split('\n').length}
language="json"
showLineNumbers={false}
/>
)}
@@ -135,7 +139,8 @@ const InvocationDetailsSidebar = ({ invocation, onClose }) => {
showCode={outputExpanded}
setShowCode={setOutputExpanded}
lines={result.content.split('\n').length}
language="plaintext"
language="text"
showLineNumbers={false}
/>
))
}

View File

@@ -39,5 +39,9 @@ def write_a_really_good_story(about : str):
ell.user(f"Make a final revision of this story in your voice: {best_draft}."),
]
story = write_a_really_good_story("a dog")
if __name__ == "__main__":
from ell.stores.sql import SQLiteStore
store = SQLiteStore('sqlite_example')
store.install()
story = write_a_really_good_story("a dog")