Send image as base64 encoded
It would be nice if I could send the image as a base64 encoded string. that would improve the latency to transform an image of a user
I am currently using the model with your api, like:
export const convertImageToVector = async (url: string) => {
const data = {
model: "jina-clip-v2",
dimensions: 1024,
normalized: true,
embedding_type: "float",
input: [{ image: url }],
}
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization:
"Bearer <KEY>",
},
body: JSON.stringify(data),
}
const res = await fetch("https://api.jina.ai/v1/embeddings", options).then(
(response) => response.json(),
)
if (res.detail) {
return {
error: res.detail,
}
}
return res.data[0].embedding
}
From what I could find about the docs of your api (btw I love the API explorer, but a classic api reference would be great too) I can only submit a url. Currently I need to wait for the image to be uplaoded to s3 so that I can then send it to jina, which increases latency by a good amount. I was also looking at the aws sagemaker and I think replicate, but they all only show it using a url
Awesome, will give it a try. You should think about a more visible/prominent way of linking those docs on your landing page imo. I was looking around for quite some time and couldnt find it