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

Minified React error any time i try to use any Gemini Fine Tuned model. #3

Open
Pixel-Panda opened this issue Jul 27, 2024 · 0 comments

Comments

@Pixel-Panda
Copy link

Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7BnodeId%2C%20nodeName%2C%20stage%2C%20errorObject%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Node logic:

const {
  GoogleGenerativeAI,
} = require("@google/generative-ai");

export default async function generateResponseTextStream({
  API_KEY,
  prompt,
  modelType,
  nodeId,
  nodeName
}, { logging }) {
  const genAI = new GoogleGenerativeAI(API_KEY);

  const model = genAI.getGenerativeModel({
    model: "tunedModels/theActualModelIDFromGoogleAIStudio"
  });

  try {
    const result = await model.generateContent({ prompt, modelType });
    const text = result.text; // Ensure result has a text property
    
    logging.log(text);
    
    // Constructing the output according to the provided schema
    return {
      nodeId: nodeId, // Dynamic nodeId
      nodeName: nodeName, // Dynamic nodeName
      stage: "completed",
      errorObject: {
        warnings: [],
        errors: []
      },
      text: text // Ensure this is a string
    };
  } catch (error) {
    logging.error('Error generating content:', error);
    
    // Constructing the error output according to the provided schema
    return {
      nodeId: nodeId, // Dynamic nodeId
      nodeName: nodeName, 
      stage: "failed",
      errorObject: {
        warnings: [],
        errors: [{
          location: {
            lineText: error.message,
            file: "script.js",
            column: 0,
            line: 0,
            suggestion: "",
            namespace: "",
            length: 0
          },
          pluginName: "GoogleGenerativeAI",
          notes: [],
          id: "error-id",
          text: error.message
        }]
      }
    };
  }
}```

In fact NO fine tuned models work in BuildShip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant