Giter Club home page Giter Club logo

Comments (5)

dwelle avatar dwelle commented on July 4, 2024 4

We're actually in the process of moving away from bring-your-own-token workflow as it was too complicated and introduced it early only due to extremely low API limits on OpenAI's part. Further, it's limiting us to only use a specific service if we wanted to do something more dynamic.

We'll be updating this soon.

from excalidraw.

maekoos avatar maekoos commented on July 4, 2024

From what I quickly read on the openAI Vision API website the api seems compatible with what is currently implemented:

const body: OpenAIInput.ChatCompletionCreateParamsBase = {
model: "gpt-4-vision-preview",
// 4096 are max output tokens allowed for `gpt-4-vision-preview` currently
max_tokens: 4096,
temperature: 0.1,
messages: [
{
role: "system",
content: SYSTEM_PROMPT,
},
{
role: "user",
content: [
{
type: "image_url",
image_url: {
url: image,
detail: "high",
},
},
{
type: "text",
text: `Above is the reference wireframe. Please make a new website based on these and return just the HTML file. Also, please make it for the ${theme} theme. What follows are the wireframe's text annotations (if any)...`,
},
{
type: "text",
text,
},
],
},
],
};
let result:
| ({ ok: true } & OpenAIOutput.ChatCompletion)
| ({ ok: false } & OpenAIOutput.APIError);
const resp = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify(body),
});
if (resp.ok) {
const json: OpenAIOutput.ChatCompletion = await resp.json();
result = { ...json, ok: true };
} else {
const json: OpenAIOutput.APIError = await resp.json();
result = { ...json, ok: false };
}
return result;

Seems like all that is needed is to change the model to "gpt-4o"?

from excalidraw.

maekoos avatar maekoos commented on July 4, 2024

I got it working by only changing the model to "gpt-4o".

However, I found another issue in the process. Wireframes inside a frame will just generate a generic website:
image

A totally unrelated issue but also kind of awkward... :/

from excalidraw.

yunuuuk1 avatar yunuuuk1 commented on July 4, 2024

excalidraw_ai_setting
P0001

I'm using the wireframe to code feature in Excalidraw, but I'm getting this error message:
Error!
The model gpt-4-vision-preview has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
I also tried changing the default vision model to gpt-4o, but I'm still getting the same error. Can help me with this issue?"

from excalidraw.

maekoos avatar maekoos commented on July 4, 2024

As @dwelle said, they will be updating this soon.

If you need it right away and have a ChatGPT 4o token (you need to pay $5 on platform.openai.com I think) then you could try this version (the one generated from my pull request):

https://excalidraw-git-fork-maekoos-fix-8147-excalidraw.vercel.app/

from excalidraw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.