Discussions

Ask a Question
Back to All

Sending Message

Hi ,

  async function sendMessage(text: string) {
    try {
      if (streamId.current && sessionId.current && textRef.current) {
        const response = await fetchWithRetries(
          `/agents/${agentId}/chat/${chatId}`,
          {
            streamId: streamId.current,
            sessionId: sessionId.current,
            messages: [
              {
                role: "user",
                content: text,
                created_at: new Date().toString(),
              },
            ],
          }
        );
        return response.data;
      }
    } catch (error: any) {
 			console.log(error)
  }
  }

I am sending message to the agent Stream, i have created successfully all the knowledgeId, streamId, sessionId, agentId and chatId. However after certain amount of tries , it gets the BAD call error (attached at the pic). Are we limited to 15 calls per day ?

If yes, how do you count the 15 calls, is it from the sessionID or is it from the user's authentication key?

Please let me know.

Thank you.