Comments (10)
Hi @kithawk, can you elaborate on this use case? Why would you need inline mode in a private chat when you can simply message the bot privately
from chatgpt-telegram-bot.
This would allow you to generate and send response directly in a private conversation with another user (but marked as being generated via the bot, just like when using bots like @vid
or @pic
)
from chatgpt-telegram-bot.
Ah, I get what you mean now. I've added experimental support for this in the inline-query-response branch.
Let me know what you think. I've tested it a few times and it seems very slow.
from chatgpt-telegram-bot.
Thanks, it works as expected. However, it appears that the Telegram API for inline queries only provides a response once we stop typing. Therefore, when we pause, ChatGPT sends a response, but if we resume typing and send another message, it makes an additional call to the API, resulting in extra token usage as the API still considers the previous message 'unsent' since ChatGPT has already received it.
For example, if we send @bot hey
, we should get a 'hello' response. However, if we pause and then resume typing @bot hey, what's the weather?
, we will receive information about no access to the weather. This results in a separate call to the ChatGPT API (using tokens), as well as the API keeping a history of the conversation.
To avoid this issue, one solution could be to not keep history in private inline messages. Another solution could be to send the message to the OpenAI API only if the private inline message ends with something that would explicitly indicate the end of the query, such as @@
. This way, only the message @bot hey, what's the weather @@
would be sent to ChatGPT to provide an inline answer.
from chatgpt-telegram-bot.
Hi @kithawk, I agree that history should not be kept for inline messages.
Does inline query work for you with long outputs (e.g. if you ask tell me a story
)? For me it just keeps spinning and never updates. Seems like the response never shows up if the request takes more than a fixed amount of time (e.g. 5s). But i can't find any documentation on this timeout
from chatgpt-telegram-bot.
Hey @n3d1117, same behaviour for me - for longer queries it times out. Not sure if this works, but maybe for answer we do the prompt, and once we get response from API we can edit the message that was already sent (containing just the prompt)
from chatgpt-telegram-bot.
Hmm not a big fan of this idea. Will keep this issue open in case someone wants to work on it
from chatgpt-telegram-bot.
i wonder if the @bold bot can serve as a model for the inline mode. it accepts queries in real-time, but it doesn't execute the query or provide a response until the user clicks one of the presented options. It would be more efficient to hold off on sending anything to the API until after the user confirms the choice by clicking on a pop-up.
This approach would allow for presenting different options for the type of response you want to receive from the API (humor, serious, etc).. similar to "bold", "italic", "fixed" options in the @bold bot.
from chatgpt-telegram-bot.
@k3it I don't think that's going to work. Here's how inline queries work for these kinds of bots:
async def inline_query(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
query = update.inline_query.query
results = [
InlineQueryResultArticle(
id='some_id',
title="Bold",
input_message_content=InputTextMessageContent(
"**query**", parse_mode=ParseMode.MARKDOWN
),
),
# italic, etc...
]
await update.inline_query.answer(results)
There's a predefined InputTextMessageContent
based on what you write. There's no way to make an API call after the user selects Bold
.
Also, I don't think what @kithawk was proposing is feasible either. I haven't checked, but we don't have access to the message sent after a user clicks on the inline popup, so we can't edit it.
from chatgpt-telegram-bot.
@n3d1117 I believe we can edit inline messages sent by bot. A PR is proposed to implement this feature. Feel free to review and provide suggestions.
from chatgpt-telegram-bot.
Related Issues (20)
- When contacting the bot, an error occurs HOT 1
- bot unstart HOT 1
- how i can use plugins? HOT 3
- Enabling and using plugins HOT 16
- Can't change model from 3.5 to 4 HOT 1
- Contributions to this Repo HOT 1
- deepl plugin returns text in unicode escape sequence HOT 4
- Exception while handling an update: getattr():
- Deployment issues with fly.io
- Оооид
- Duck Duck Go Rate Limit HOT 1
- Update docker image in docker hub HOT 1
- Separate /image commands for Dall-E 2 and Dall-E 3
- audo ---> text HOT 1
- DDG HOT 3
- Everything worked and abruptly stopped working HOT 1
- Bugs in the operation of plugins: auto_tts, ddg_ddg_search, and ddg_images_earch (403, HttpError).
- stop or new dialog
- Add support for gpt-4-turbo-2024-04-09 HOT 1
- am i the only one facing this? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-telegram-bot.