admin08077 commited on
Commit
fd9caa3
·
verified ·
1 Parent(s): 7b53239

Update services/nftService.ts

Browse files
Files changed (1) hide show
  1. services/nftService.ts +3 -5
services/nftService.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import { callGemini } from "./geminiService";
3
 
4
  export interface GeneratedNFT {
@@ -10,7 +9,7 @@ export interface GeneratedNFT {
10
 
11
  export const nftService = {
12
  /**
13
- * Synthesizes an NFT image using Gemini 2.5 Flash Image via Backend
14
  */
15
  generateImage: async (prompt: string): Promise<string | null> => {
16
  try {
@@ -24,8 +23,7 @@ export const nftService = {
24
  }
25
  );
26
 
27
- // Extract the image from candidates
28
- if (response.candidates && response.candidates[0]?.content?.parts) {
29
  for (const part of response.candidates[0].content.parts) {
30
  if (part.inlineData) {
31
  return `data:image/png;base64,${part.inlineData.data}`;
@@ -78,4 +76,4 @@ export const nftService = {
78
 
79
  return steps;
80
  }
81
- };
 
 
1
  import { callGemini } from "./geminiService";
2
 
3
  export interface GeneratedNFT {
 
9
 
10
  export const nftService = {
11
  /**
12
+ * Synthesizes an NFT image using Gemini 2.5 Flash Image
13
  */
14
  generateImage: async (prompt: string): Promise<string | null> => {
15
  try {
 
23
  }
24
  );
25
 
26
+ if (response.candidates?.[0]?.content?.parts) {
 
27
  for (const part of response.candidates[0].content.parts) {
28
  if (part.inlineData) {
29
  return `data:image/png;base64,${part.inlineData.data}`;
 
76
 
77
  return steps;
78
  }
79
+ };