#LangChainJS, Google Auth, and Node

1 messages · Page 1 of 1 (latest)

silk monolith
#

@pale root - let's at least move it to this thread so we don't clutter up the main channel.

#

Did you try using --experimental-vm-modules?

#

Or possibly try using the combined ts-compiler / node thingie?

pale root
#

Allen, really sorry again for taking up your time, i solved this, i changed the javascript from common js to ESModules and the langchain error code was solved. The require issue i solved changing the require(path) to import(path), that way:

#

But really thanks for all the help ❤️

pale root
#

@silk monolith Sorry for the off topic, but do you know how i send instructions to Gemini with langchain?
I found how to i send the saffetySettings, but i didn't find how to send instructions

silk monolith
#

LangChain.js includes system instructions as part of the chat conversation. So however you're creating your chat, you want one of type SYSTEM

#

and this isn't taking up my time. it means I didn't document this well. {: which I know I didn't.

#

If you look at the getting started blog I mentioned, you can see setting that in getJoke:

async function getJoke(topic){

  // Setup the prompt template

  const template = "Tell me a joke about {topic}.";

  const prompt = ChatPromptTemplate.fromMessages([
    ["system", "You are a comedian, and your specialty is telling short jokes about a topic."],
    ["human", template],
  ]);
pale root
silk monolith
#

Hmmm. I have a guess, but can't double check at moment. Might be were not handling flash right. There's a parameter to force it. But I don't remember if flash supports system instructions

#

But there is a parameter to force. Will check later.

pale root
#

I found it

#

And that worked, is a good solution?

silk monolith
#

And that worked? Hmmm. Wonder what it was generating.

#

(I really need a good way to let people debug that)