Send raw text to a model

Is there a node or some other way to control exactly what is send to a model? For example there should also send nor “HUMAN:” Keyword.

Yes. You can use this node:

:point_right: If my reply answers your question, please remember to mark it as a solution.

Hello Solomon, thank you for your answer.

Afaik, this only works with the models from OpenAI, but for the wide range I have to use the “AI Agent” or “Basic LLM Chain”.

I see. In those nodes you have some extra options you can add.

Just open the node and click the button on the bottom and you will see things like:

  • system message
  • sampling temperature

With those options you can have full control over what you are sending to the model.

Is that what you are looking for?

no, but I now can give an example:

from langchain_core.prompts import ChatPromptTemplate, PromptTemplate

chat_prompt_template = ChatPromptTemplate.from_template("teststr")
prompt_template = PromptTemplate.from_template("teststr")


print(chat_prompt_template.format())
print(prompt_template.format())

Output:

prompt_test.py 
Human: teststr
teststr

Process finished with exit code 0

The ChatPromptTemplate adds the “Human” part automatically and also n8n nodes does. I know that most models need the “Human:” keyword word running correct, but my question is, how I can get the full control on what is send to the model in n8n.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.