Character limit
Hi i dont know if the repository dead or no but i have problem with it
It only puts the 50% of the repsond instead of the repsond of the c.ai message
And if you wonder why i care about this because im working on discord bot about c.ai bot and people who uses it wants the bot to put the full repsond
Thanks
Hi, the repository is alive.
Could you please provide me with your code that you think is causing this problem?
async def send_ai_message(channel_id, message_content, user_name):
chat_data = active_chats.get(channel_id)
if not chat_data or not chat_data["is_active"]:
return None
client = chat_data["client"]
character_id = chat_data["character_id"]
chat_id = chat_data["chat_id"]
formatted_message = f"[{user_name}]: {message_content}"
answer = await client.chat.send_message(
character_id, chat_id, formatted_message,
streaming=True
)
printed_length = 0
full_response = ""
async for message in answer:
if printed_length == 0:
full_response += f"[{message.author_name}]: "
text = message.get_primary_candidate().text
full_response += text[printed_length:]
printed_length = len(text)
return full_response.strip()
Try to use it without streaming
async def send_ai_message(channel_id, message_content, user_name):
chat_data = active_chats.get(channel_id)
if not chat_data or not chat_data["is_active"]:
return None
client = chat_data["client"]
character_id = chat_data["character_id"]
chat_id = chat_data["chat_id"]
formatted_message = f"[{user_name}]: {message_content}"
answer = await client.chat.send_message(
character_id, chat_id, formatted_message
)
text = answer.get_primary_candidate().text
return text.strip()
I tried it It says there is no full_response After i added full response it doesnt send anything in the c.ai chat
Nvm i fixed it
But still it has character limit
Can you fix it by changing library files?
Oh, sorry, my bad. It should return text.strip() instead of full_response.strip()
I'm not quite sure what character limit you've encountered, the Library is definitely working as it should.
here is explain
Uh did you forgot about the issue or you dont know the solution?
Could you please, for example, print the text that you are getting in response from the character using my library before sending this message to discord (i.e. in the send_ai_message function before return do print(text) ) and compare it with the actual character response message on the website?
If they are different then that's really weird and I'll try to figure out what's wrong, if they are the same then the problem is somewhere in your code.
on discord
on console
on c.ai
So there is no solution? Im still waitting idc if this takes months
I've been really busy lately, sorry for the long response time.
It looks more like a problem on the c.ai side. I tried asking the same bot to write me some code and it generates something like
and then stops.
In other scenarios everything is fine and responses are complete. Maybe c.ai is just incapable of generating code?
hello..having the same issue here i think it's like a limit from c.ai i use the token normally for 1 month..sometimes a week..then it switches to an older model with dumb responses and message limit the only solution i use is just switching to another account it's not really a solution tho but it works.. not sure if it's a limit for the api or just a limit from c.ai so we pay for plus?