MCPcopy Create free account
hub / github.com/ScrapeGraphAI/scrapecraft / send_message

Function send_message

backend/app/api/chat.py:28–47  ·  view source on GitHub ↗

Send a message to the scraping agent and get a response.

(request: MessageRequest)

Source from the content-addressed store, hash-verified

26
27@router.post("/message", response_model=MessageResponse)
28async def send_message(request: MessageRequest):
29 """Send a message to the scraping agent and get a response."""
30 try:
31 result = await openrouter_agent.process_message(
32 message=request.message,
33 pipeline_id=request.pipeline_id,
34 context=request.context
35 )
36
37 return MessageResponse(
38 response=result["response"],
39 urls=result["urls"],
40 schema=result["schema"],
41 code=result.get("code"),
42 results=result.get("results", []),
43 status=result["status"],
44 timestamp=datetime.utcnow()
45 )
46 except Exception as e:
47 raise HTTPException(status_code=500, detail=str(e))
48
49@router.get("/history/{pipeline_id}")
50async def get_chat_history(pipeline_id: str, limit: int = 50):

Callers

nothing calls this directly

Calls 2

MessageResponseClass · 0.85
process_messageMethod · 0.45

Tested by

no test coverage detected