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

How to include images #16

Closed
murnifine opened this issue Aug 20, 2024 · 5 comments
Closed

How to include images #16

murnifine opened this issue Aug 20, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@murnifine
Copy link

murnifine commented Aug 20, 2024

and I need help to convert my javascript version code to rust

const APIKey = "this-my-api-key...........";
const genAI = new GoogleGenerativeAI(APIKey);
const model = genAI.getGenerativeModel({
	model: selectedModel,
	systemInstruction: "you are metadata generator",
	safetySettings,
	generationConfig,
});

let response, chatSession;


chatSession = model.startChat({
	history: [
		{
			role: "user",
			parts: [
				{
					inlineData: {
						mimeType: "image/webp",
						data: imageBase64Data,
					},
				},
			],
		},
		{
			role: "model",
			parts: [
				{
					text: "title: beautiful blue sky, keywords: sky, blue, cloud, summer",
				},
			],
		},
	],
});

response = await chatSession.sendMessage([
	{
		inlineData: {
			mimeType: mimeType,
			data: base64Image,
		},
	},
]);
@murnifine murnifine changed the title How to set API key programmatically? How to include images Aug 20, 2024
@jeremychone
Copy link
Owner

@murnifine images are not supported yet. They will in the future. I will add a ticket.

@jeremychone
Copy link
Owner

See #17 for tracking

@jeremychone
Copy link
Owner

@murnifine I am closing this particular ticket, but do not worry, this feature is in the plan.

@jeremychone jeremychone added the duplicate This issue or pull request already exists label Aug 20, 2024
@jeremychone
Copy link
Owner

@murnifine btw, it is strange, I got the email notification about "How to set API key programmatically?", so I guess you found how to do that. The AuthResolver is here for that.

@murnifine
Copy link
Author

@murnifine btw, it is strange, I got the email notification about "How to set API key programmatically?", so I guess you found how to do that. The AuthResolver is here for that.

yes I have found it, now just looking for how to implement the image as a prompt, I hope it can be realized soon, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants