Hi, i’m getting
{
"error": {
"code": 400,
"message": "\* GenerateContentRequest.contents: contents is not specified\\n",
"status": "INVALID_ARGUMENT"
}
}
When trying to use LangChain with ChatOpenAI:
import { ChatOpenAI } from '@langchain/openai';
const model = new ChatOpenAI({
model: modelToUse,
apiKey: openAiKey,
temperature: 0.5,
...(customBaseUrl && {
configuration: { baseURL: customBaseUrl, fetch: obsidianOpenAIFetch },
}),
});
const messages = [new SystemMessage(systemPrompt)];
...
I thought “OpenAI-compatible” means “OpenAI-compatible”
This is full request body being sent to https://generativelanguage.googleapis.com/v1beta/openai/
{
"model": "gemini-2.0-flash-lite",
"temperature": 0.5,
"stream": false,
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "extract",
"strict": true,
"schema": {
"type": "object",
"properties": {
"fileTitle": {
"type": "string",
"description": "A suggested title for the Obsidian Note. Ensure that it is in the proper format for a file on mac, windows and linux, do not include any special characters"
},
"summary": {
"type": "string",
"description": "A summary of the transcript in Markdown. It will be nested under a h2 # tag, so use a tag less than that for headers\nConcise bullet points containing the primary points of the speaker"
},
"insights": {
"type": "string",
"description": "Insights that you gained from the transcript in Markdown.\nA brief section, a paragraph or two on what insights and enhancements you think of\nSeveral bullet points on things you think would be an improvement, feel free to use headers\nIt will be nested under an h2 tag, so use a tag less than that for headers"
},
"mermaid_chart": {
"type": "string",
"description": "A valid unicode mermaid chart that shows a concept map consisting of both what insights you had along with what the speaker said for the mermaid chart, \nDont wrap it in anything, just output the mermaid chart. \nDo not use any special characters that arent letters in the nodes text, particularly new lines, tabs, or special characters like apostraphes or quotes or commas"
},
"answered_questions": {
"type": "string",
"nullable": true,
"description": "If the user says \"Hey Scribe\" or alludes to you, asking you to do something, answer the question or do the ask and put the answers here\nPut the text in markdown, it will be nested under an h2 tag, so use a tag less than that for headers\nSummarize the question in a short sentence as a header and place your reply nicely below for as many questions as there are\nAnswer their questions in a clear and concise manner"
}
},
"required": [
"fileTitle",
"summary",
"insights",
"mermaid_chart",
"answered_questions"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
},
"messages": [
{
"role": "system",
"content": "You are \"Scribe\" an expert note-making AI for Obsidian you specialize in the Linking Your Thinking (LYK) strategy. The following is the transcription generated from a recording of someone talking aloud or multiple people in a conversation. There may be a lot of random things said given fluidity of conversation or thought process and the microphone's ability to pick up all audio. The transcription may address you by calling you \"Scribe\" or saying \"Hey Scribe\" and asking you a question, they also may just allude to you by asking \"you\" to do something. Give them the answers to this question. Give me notes in Markdown language on what was said, they should be - Easy to understand - Succinct - Clean - Logical - Insightful. It will be nested under a h2 # tag, feel free to nest headers underneath it. Rules: - Do not include escaped new line characters - Do not mention \"the speaker\" anywhere in your response. - The notes should be written as if I were writing them. The following is the transcribed audio: <transcript> Let's try another one. </transcript>"
},
{
"role": "system",
"content": "Please respond in en language"
}
]
}
Why is it not working?