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

Template Fails Due to Dependency on gpt-4o-mini #738

Open
felipebrgs1 opened this issue Jan 29, 2025 · 1 comment
Open

Template Fails Due to Dependency on gpt-4o-mini #738

felipebrgs1 opened this issue Jan 29, 2025 · 1 comment

Comments

@felipebrgs1
Copy link

felipebrgs1 commented Jan 29, 2025

#739 Pull Request

Description:
The project template is designed to support multiple models, but the function generateTitleFromUserMessage creates a dependency on the gpt-4o-mini model. This causes the application to throw an error if the gpt-4o-mini model is not being used.

Error Message:
When using the Gemini model exclusively, the following error is received:
url: 'https://generativelanguage.googleapis.com/v1beta/models/gpt-4o-mini:generateContent',.

Code:

app/(chat)/actions.ts => 
export async function generateTitleFromUserMessage({ message }: { message: Message; }) {
  const { text: title } = await generateText({
    model: customModel('gpt-4o-mini'),
    system: `
    - you will generate a short title based on the first message a user begins a conversation with
    - ensure it is not more than 80 characters long
    - the title should be a summary of the user's message
    - do not use quotes or colons`,
    prompt: JSON.stringify(message),
  });

  return title;
}

Steps to Reproduce:

  1. Without gpt-4o-mini in models ,send a message to initiate a conversation.
  2. Observe the error triggered by the dependency on gpt-4o-mini.

Expected Behavior:
The template should support multiple models without errors, adapting seamlessly to the available model (e.g., Gemini).

Actual Behavior:
The function explicitly relies on gpt-4o-mini, causing the application to fail when this model is unavailable.

Thank you!

@jayasuryajsk
Copy link

Yeah. I used cursor to fix this. I removed all hardcoded model names and just use available model from models.ts file.
If you want to remove all openai models, it would break Image generation thing we have in the document tool too.
Its depends again on openai api.

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

2 participants