In this chapter, we are going to see how to create change with the new language.
That long chain is promoting the long chain expression language.
As you know, right now, we can use both ways the classic way and the new way.
In the future, it seems that launching is going to promote the new way, the language expression and
the expression language.
But right now you can use both a the goal behind the creation of the long chain expression language.
This new way is to simplify the use of long chain, and have it more easy to integrate with other applications
like Langschmidt, for example.
In my opinion, the first of these goals is not very well achieved.
So in my opinion, the long chain expression language is not more simple than the classic way.
But this is just my opinion.
So what we are going to do is we are going to see, we are going to compare the both way, the the both
ways, the classic and the new for you to be able to start experimenting with it.
So in this chapter we are going to, uh, create a chain with the classic way and with the new way.
So you are very familiar with the classic way already.
We initially, uh, connect with the temp file, then we communicate with the OpenAI API.
And to create a chain in the classic way is very easy.
We import the LM module.
Then we have a language model, we have a prompt template, and we create a chain very easy the chain
with the LM module module we include the language model and the prompt template.
And then we include the user input when we execute the chain.
Remember here we are using the dot predict.
And then we enter the user input this way.
So the same operations with the new language is a is achieved with this expression here.
So this a chain equals long chain is achieved with this new expression here.
The newest thing is this uh is this element called pipe.
So you will read this prompt pipe LM okay.
So the second difference is that instead of using predict right now we are using dot invoke.
And the third change is that instead of using the enter in the user input this way variable equals and
then the input.
We are right now using a Python dictionary.
So you will use the A variable as a dictionary.
A element.
And then you will use the user input.
So that's it.
Uh for a very simple chain the classic way and the new long chain expression language way.
As you know, more information in the long chain documentation where you can find many more details
about the new way of creating a change in the new language.