#JavaScript for AI
1 messages ยท Page 1 of 1 (latest)
If anyone could help me, I'm new to Javascript
can you explain your issue? what are you trying to do?
I wanted to ask if someone could give me a template, i.e. an almost finished script, to learn how something like this is structured because I need one that I would like to work with that I can use for my bot
something like what?
please explain what you are trying to do
what do you want to learn
what do you want to do with this API
this API is an api for our models which they are large language model
can be used for too many task and projects
please explain what you want or no one can help you
I couldn't make a help tag, it's not an error either
it's not about API
It's about my bot. I would like to add a script there that I can work with any AI that comes up with a question and can also respond to previous messages, so a reminder of the chat history is based on a conversation
Are you referring to a character description? And if you're referring to 'your' bot which means you are wanting a way to make a card and for that I don't think anybody would assist you here.
I don't understand what you don't understand, I wanted to ask if anyone has a script for AI that I can insert prompts and Ai keys etc. and that the script can also remember chat histories so that you can build a conversation. So for example I say 4 messages before that I like cake and 4 messages later I ask what I like and he then answers me that I like cake. I can or can't like Chatgpt
Aha you mean the chat history don't you?
There's an auto summary option and no need for scripts in that. Just click that button and it will summarise the chat. Again you can also type individually for what details it wants to remember like '{{char}} likes cake'. However I don't know how is this related to the api?
@trim cedar
As previously written, there was no help tag
I don't understand... What's your point?
Buddy, I think he's not using any frontend, you think he is.
You're referring to a bot, a Discord bot? It is possible to do simple things like chat with the model through the terminal, assign personalities and chat History, but it is not convenient, obviously.
You can do this in other contexts, but how you do it depends on what you're doing.
You can't just ask for a code that lets you chat with the model, with chat history and the possibility to assign personalities, that's too vague.
I'll take a look at it later, I'm on the way right now
And how far can you imagine that I can teach myself this? I don't want to go too deeply into the subject. I usually need practically visible things myself as theory. I like it when people show me how the whole thing works so that I have something ready to find out for myself how he got this inheritance. The problem with the program I actually use is like a building block set where you put different things together and at the end it delivers a result. Unfortunately, I have to do this myself and I actually never had to deal directly with scripts because I worked with the building blocks. That's why I wanted to ask if anyone gives me a script, I'll try to incorporate it into my system so that I can see how it works and if I have any questions I can write them down here.
Wrote it in a few minutes, as simple as I could.
@tight heart Sharing other API services is advertising, please follow the #๐๐๐ฎ๐ฅ๐๐ฌ
create a ticket
Okey.
This is a simple code that uses Pawan's API, it reads an Input on the console then pushes it to an array of object following the format accepted by any openai compatible API, then sends it to the API, generating the chat completion, printing the response and pushing the response to the same array of object, so we have an working chat history.
I added an object at the beggining of the code so you can change a few data that are used through the code easily, just keep track of how they are used.
I added this setTimout at the end of the code cause my vscode is buggy, you can remove it.
Oh thank you very much, that's very kind of you. I'll take a look at it and go over it a bit. I don't have much idea about it yet, but thanks to your comments I can understand a little better what it does and how it works. But I'll internalize that more tomorrow because I have to go to sleep now and unfortunately I'll be back at work tomorrow.
But if I have any questions about this topic, would it be okay if I tag you?
If you need any further help or have any question, yeah yeah, just tell me.
And did everything go well because of the owner, who didn't seem to react that well?
Oh everything's fine, don't worry about it.
Yes, I will make sure you have a nice evening too ๐
Question: Did you write all of this yourself in just a few minutes?
Due to my poor internet, I had time to read the whole thing for 20 minutes and take a closer look. I understood how ${config.character.personality} works Config is the heading, you can imagine it like a folder and you go through each point . continue in until you get to personality and can therefore write the data. I found that very interesting. I haven't been able to actively use the code yet and haven't had the time yet, but I'll try to do it in the next few days to adjust the rest so that everything can work
Yeah
you are using dot notation to navigate the properties of a JSON (JavaScript Object Notation) object, when using dot notation, you access a property of an object.
Simply put, each dot takes you to a different depth of the object's structure, allowing you to access the object's properties at different depths.
Each property has a stored value, in the case of user, another object.
As you said, it's just like a foulder.
I'll try to answer that tonight
Ah cool, thanks for the explanation, even if it's a bit difficult for me to understand