#JavaScript for AI

1 messages ยท Page 1 of 1 (latest)

obsidian skiff
#

Good noon,
I wanted to ask if there is a script for Javascript that has all the functions you need to work with the Roleplay Ai. because a colleague has always done it but he can't do it at the moment and I have no idea about the script because I don't do much programming.

obsidian skiff
#

If anyone could help me, I'm new to Javascript

jovial pagoda
obsidian skiff
jovial pagoda
#

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

obsidian skiff
#

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

trim cedar
obsidian skiff
# trim cedar Are you referring to a character description? And if you're referring to 'your' ...

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

trim cedar
#

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?

obsidian skiff
trim cedar
#

I don't understand... What's your point?

tight heart
tight heart
#

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.

obsidian skiff
#

I'll take a look at it later, I'm on the way right now

obsidian skiff
# tight heart You can't just ask for a code that lets you chat with the model, with chat histo...

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.

tight heart
#

Wrote it in a few minutes, as simple as I could.

jovial pagoda
tight heart
#

?

#

What did I do?

jovial pagoda
tight heart
#

Okey.

tight heart
#

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.

obsidian skiff
# tight heart This is a simple code that uses Pawan's API, it reads an Input on the console th...

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?

tight heart
#

If you need any further help or have any question, yeah yeah, just tell me.

obsidian skiff
#

And did everything go well because of the owner, who didn't seem to react that well?

tight heart
#

It was a mistake of mine.

#

It's resolved now.

obsidian skiff
#

Oh everything's fine, don't worry about it.

obsidian skiff
tight heart
#

Nice evening.

#

I mean, good night.

obsidian skiff
#

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

tight heart
#

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.

obsidian skiff
#

I'll try to answer that tonight

obsidian skiff
#

Ah cool, thanks for the explanation, even if it's a bit difficult for me to understand