Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import error related to makereal #26

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/components/MakeRealButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEditor, useToasts } from '@tldraw/tldraw'
import { useCallback } from 'react'
import { makeReal } from '../makeReal'
import { makeReal } from '../lib/makeReal'

export function MakeRealButton() {
const editor = useEditor()
Expand Down
4 changes: 2 additions & 2 deletions app/lib/getHtmlFromOpenAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export async function getHtmlFromOpenAI({
})

const body: GPT4VCompletionRequest = {
model: 'gpt-4-vision-preview',
model: 'gpt-4-turbo',
max_tokens: 4096,
temperature: 0,
messages,
Expand Down Expand Up @@ -139,7 +139,7 @@ type MessageContent =
)[]

export type GPT4VCompletionRequest = {
model: 'gpt-4-vision-preview'
model: 'gpt-4-turbo'
messages: {
role: 'system' | 'user' | 'assistant' | 'function'
content: MessageContent
Expand Down
10 changes: 5 additions & 5 deletions app/lib/makeReal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Editor, createShapeId, getSvgAsImage, track } from '@tldraw/tldraw'
import { getSelectionAsText } from './lib/getSelectionAsText'
import { getHtmlFromOpenAI } from './lib/getHtmlFromOpenAI'
import { blobToBase64 } from './lib/blobToBase64'
import { addGridToSvg } from './lib/addGridToSvg'
import { PreviewShape } from './PreviewShape/PreviewShape'
import { getSelectionAsText } from './getSelectionAsText'
import { getHtmlFromOpenAI } from './getHtmlFromOpenAI'
import { blobToBase64 } from './blobToBase64'
import { addGridToSvg } from './addGridToSvg'
import { PreviewShape } from '../PreviewShape/PreviewShape'
leowilkin marked this conversation as resolved.
Show resolved Hide resolved

export async function makeReal(editor: Editor, apiKey: string) {
// Get the selected shapes (we need at least one)
Expand Down