Replies: 3 comments 2 replies
-
Para configurar o import { GoogleAIModelRequestParams, GoogleAIResponseMimeType } from 'path-to-langchain-google-common/src/types';
const requestParams: GoogleAIModelRequestParams = {
generationConfig: {
responseMimeType: 'application/json' as GoogleAIResponseMimeType,
temperature: 1,
topP: 0.95,
topK: 64,
maxOutputTokens: 8192,
// outras opções de configuração
},
// outros parâmetros de solicitação
};
// Use requestParams na sua chamada Gemini Alternativamente, se você estiver usando a classe import { GoogleBaseLLM, GoogleAIResponseMimeType } from 'path-to-langchain-google-common/src/llms';
const llm = new GoogleBaseLLM({
responseMimeType: 'application/json' as GoogleAIResponseMimeType,
temperature: 1,
topP: 0.95,
topK: 64,
maxOutputTokens: 8192,
// outras opções de configuração
});
// Use a instância llm na sua chamada Gemini Isso configurará a instância Referências
|
Beta Was this translation helpful? Give feedback.
-
@dosu this does not work |
Beta Was this translation helpful? Give feedback.
-
@rossanodr
|
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
How can I set the responseMimeType on gemini calls using langchain?
System Info
"yarn info langchain"
Beta Was this translation helpful? Give feedback.
All reactions