Skip to content

Commit 3c38635

Browse files
Spam Classify -> Spam Conversation, Spam Document
1 parent 8cb6e4d commit 3c38635

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

README.md

+41-4
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,15 @@ client.task.fraud_spamicity({
397397
}
398398
```
399399

400-
#### ➡️ Spam Classify
400+
#### ➡️ Spam Conversation
401401

402-
* **Method:** `client.task.spam_classify(data)`
403-
* **Reference:** [Spam Classify](https://docs.mirage-ai.com/references/api/v1/#spam-classify)
402+
* **Method:** `client.task.spam_conversation(data)`
403+
* **Reference:** [Spam Conversation](https://docs.mirage-ai.com/references/api/v1/#spam-conversation)
404404

405405
* **Request:**
406406

407407
```python
408-
client.task.spam_classify({
408+
client.task.spam_conversation({
409409
"sender": {
410410
"name": "John Doe",
411411
"email": "[email protected]"
@@ -442,6 +442,43 @@ client.task.spam_classify({
442442
}
443443
```
444444

445+
#### ➡️ Spam Document
446+
447+
* **Method:** `client.task.spam_document(data)`
448+
* **Reference:** [Spam Document](https://docs.mirage-ai.com/references/api/v1/#spam-document)
449+
450+
* **Request:**
451+
452+
```python
453+
client.task.spam_document({
454+
"name": "Spammy Domain",
455+
"domain": "spammy-domain.crisp.help",
456+
"title": "Spammy title",
457+
"content": "Spammy content"
458+
});
459+
```
460+
461+
* **Response:**
462+
463+
```json
464+
{
465+
"reason": "processed",
466+
467+
"data": {
468+
"class": "spam",
469+
"confidence": 0.82,
470+
"logprob": -0.10,
471+
472+
"scores": {
473+
"gibberish": 0.0,
474+
"marketing": 0.0,
475+
"regular": 0.0,
476+
"spam": 0.82
477+
}
478+
}
479+
}
480+
```
481+
445482
### Data API
446483

447484
#### ➡️ Context Ingest

mirage_api/resources/task.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,8 @@ def translate_text(self, data):
3636
def fraud_spamicity(self, data):
3737
return self.parent.post("/task/fraud/spamicity", data)
3838

39-
def spam_classify(self, data):
40-
return self.parent.post("/task/spam/classify", data)
39+
def spam_conversation(self, data):
40+
return self.parent.post("/task/spam/conversation", data)
41+
42+
def spam_document(self, data):
43+
return self.parent.post("/task/spam/document", data)

0 commit comments

Comments
 (0)