ChatGPT create a new conversation with history - openai-api

I've tried for 3 days to find a way to create a conversation and keep the history somehow from my app. I want to create a chat app with history with ChatGPT but i didn't see any options/endpoints in theirs API to acomplish this.
I saw that the main chatGPT chat from their website is using a different endpoint that keeps the conversation history based on a conversation ID.
Is there any way to use that or another endpoint that does the same thing?
I will store the history on my side but i don't want to send it each time on the request. It will cost me tokens .
Thanks in advance

The only current solutions are to either make embeddings of the conversation history and build some logic to reference that history when making new requests or summarize the conversation on the backend end pass it as part of the prompt, which you are correct uses additional tokens.

Related

How to make twitter bot track tweets from our followers?

I was making a twitter bot with Twit, I found making tutorials using T.stream('user')
to get stream data about our account, now its deprecated. So in 2021, how can i achieve these?
requirements:
Know when someone follows my bot, and make a thanks post.
Know when someone in my followers list or following list makes a tweet.
Also I have a doubt, when we use stream, old data is also coming, so how exactly stream works? if i only want latest tweets, I have to sent get by setting interval?
For the new followers, you will need to build something using the Account Activity API, which uses webhooks to send you event messages. You will need to filter for the follow events.
For new Tweets from people you are following, you will need to poll the home timeline endpoint. There’s no realtime method for this.

Google Hangouts Chatbot Create Room

I am writing service for messaging between rooms using Hangouts chatbot. Is it possible to create a room with Hangouts chatbot?
https://developers.google.com/hangouts/chat/concepts
If it were generally possible to create a new room programmaticaly with the Hangous API, you could do it with the chatbot.
For example, if you implement the chatbox with Apps Script, you can create a function onMessage(event) and establish was will to happen in case of a certain event.message.text (e.g. create a new chat room if the message text contains the string create new room.
However, for the moment it is not possible to create a new chat room programmatically.
There is a feature request asking for this functionality, but given the potential of abuse, it is controversial either it will be implemented.
See comment #2:
Hello, thank you for the feature request! At the moment rooms cannot
be created via the API to prevent abuse such as a bot or script
spamming room creation. However, this kind of feature has been
discussed internally and may be coming in the future (with
limitations). I will update this issue if more information is
released.
And comment #25:
Thanks for the input. It's great to see some real life use cases. We
fully acknowledge the importance of a CreateRoom(DM) API and we are
actively looking into the right permission model to allow bots to do
so. Please continue to follow this bug as we will post updates here
when appropriate.

Dialogflow Agent Conversation

Is there a way to get the Dialogflow agent's conversation history programmatically?
I made a chatbot using Dialogflow. Now I need to get the conversation history of my agent programmatically.
That feature (an important one) is not available yet.
Since there is not an API call to retrieve a history of conversation So, the only way I know how is to
Go to the Training tab and see the conversations that way, although it only gives the reply in the form of the intent, and not what the bot actually replied.
But if you want to access all conversations history then don't go for one-click integration make your own login system with Outh2 and integrate using Detect Intent Api and store your conversations by logs.
Then you can get conversation history programmatically.
You need to log all the requests by writing your own code if you want
to get the history.
Depends on what history u meant to fetch.
You can easily integrate your agent with google chatbase and you can get the conversation history pretty simple.
You don't need to write any programs and all.
Chatbase Automatically keeps track of history and user messages.
But it can only store history of past 30 days. :)
If you are using the NodeJS library, aling with Dialogflow, one option for you would be to save your conversation inside the user object. That way the data /conversation can be accessed by the user in future sessions.
Here's how I'll go about implementing this:
function saveConv(conv){
Conv.user.storage.convToSave = 'conversation_object'.
}
To access it I'll do:
function getSavedConv(conv){
var savedConv = conv.user.storage.convToSave.
}
Please let me know if this amswered your question.

How to clear the session between two consecutive intents?

We are using bot trees master which uses bot graph dialog for loading graph based dialogs dynamically. We have created a scenario to load multiple intents(whose intents scores are nearly matching). Now the problem I am facing is when I request for single intent , I am getting the bot response and able to enter into next intent but when I request for multiple intents bot is giving the response and when I request for another intent , bot is giving the same response of multiple intents. When bot is entering into multiple intent handler it is not clearing the session and not coming out of that handler. I have tried using session.endConversation().
To understand about bot graph dialog:
https://www.microsoft.com/developerblog/2016/11/11/extending-microsofts-bot-framework-with-graph-baseddialogs-/
Can somebody help on this. Thank you
the builder.IntentDialog() used in this project is no longer considered a best practice. Additionally, further support is not expected. Instead, you will want to use bot.Dialog() to create your dialog flows with a .triggerAction(). The trigger matches on phrases which you can set a score to. Unfortunately, it means you will need to recreate the bot-trees project to fit this new model.
You can find information on managing conversations here, including creating triggers.
If you need a more robust system, you can integrate LUIS into your project. Information regarding recognizing intents with LUIS can be found here.

Is there a way to get Instagram #Mention History via API or otherwise?

The native application doesn't show all the activity, only the most recent.
Therefore I lose 70-90% of my notifications overnight. There must be a way to get all that historical data.
I told you can't, but, thinking.. you can. :)
The API don't provide that facility.. You can check all endpoints here: http://instagram.com/developer/endpoints/
But you can iterate over all your medias an get all comments and likes. If you store it locally, after, will be possible to request API again and check your new unseen interactions.
It will work for likes and comments.

Resources