MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / send_message

Method send_message

tests/performance/test_load.py:184–208  ·  view source on GitHub ↗

Send a message in the conversation.

(self, content: str)

Source from the content-addressed store, hash-verified

182 return None
183
184 async def send_message(self, content: str):
185 """Send a message in the conversation."""
186 if not self.conversation_id:
187 return None
188
189 try:
190 start_time = time.perf_counter()
191
192 response = await self.http_client.post(
193 f"/chat/{self.conversation_id}/message",
194 json={"content": content},
195 headers={"Authorization": f"Bearer token_{self.client_id}"}
196 )
197
198 if response.status_code == 200:
199 self.messages_sent += 1
200 else:
201 self.errors += 1
202
203 end_time = time.perf_counter()
204 return end_time - start_time
205
206 except Exception as e:
207 self.errors += 1
208 return None
209
210 async def join_conversation(self, conversation_id: str):
211 """Join an existing conversation."""

Callers 4

client_load_patternMethod · 0.45
client_messagingMethod · 0.45
active_messagingMethod · 0.45
sustained_client_loadMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected