Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Formatting
  • Loading branch information
bfollington committed May 31, 2024
commit ab25232f4e9896529717998717f683e925657022
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,22 @@ export class ComApp extends LitElement {
this.graph = newGraph;

const result = await doLLM(this.userInput, '', null)
newNode.messages.push(result?.choices[0].message);
const message = result?.choices[0]?.message
if (message) {
newNode.messages.push(message);
}

this.graph = { ...newGraph }
}

onInput(text) {
this.userInput = text
console.log(this.userInput)
}

render() {
return html`
<com-app-grid>
<com-chat slot="main">
<com-thread slot="main" .graph=${this.graph}></com-thread>
<div slot="footer">
<com-unibox>
<com-editor slot="main" .value=${this.userInput} .onInput=${(v) => this.onInput(v)}></com-editor>
<com-editor slot="main" .value=${this.userInput}></com-editor>
<com-button slot="end" .action=${() => this.appendMessage()}>Send</com-button>
</com-unibox>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ function definitionToHtml(definition: any, context: any) {
if (definition.contentType === 'application/json+vnd.common.ui') {
const el = createElement(definition.body, snapshot(context).outputs)

return html`<div>${unsafeHTML(el.outerHTML)}</div><pre class="code">${pretty(el.outerHTML)}</pre><pre class="code">${JSON.stringify(definition.body, null, 2)}</pre>`
return html`<div>${unsafeHTML(el.outerHTML)}</div>
<pre class="code">${pretty(el.outerHTML)}</pre>
<pre class="code">${JSON.stringify(definition.body, null, 2)}</pre>`
}
return html`<pre>${JSON.stringify(definition, null, 2)}</pre>`
}
Expand Down