Skip to content

Commit

Permalink
Add ability to rank question
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Oct 10, 2023
1 parent e70e268 commit 08d6288
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ client.task.answer_question({

* **Request:**

```javascript
```python
client.task.summarize_paragraphs({
"transcript": [
{
Expand Down Expand Up @@ -282,6 +282,58 @@ client.task.categorize_conversation({
}
```

#### ➡️ Rank Question

* **Method:** `client.task.rank_question(data)`
* **Reference:** [Rank Question](https://docs.mirage-ai.com/references/api/v1/#rank-question)

* **Request:**

```python
client.task.rank_question({
"question": "Hi! I am having issues setting up DNS records for my Crisp helpdesk. Can you help?",
"source": "helpdesk",

"context": {
"team": {
"id": "cf4ccdb5-df44-4668-a9e7-3ab31bebf89b",
"name": "Crisp"
}
}
});
```

* **Response:**

```json
{
"reason": "processed",

"data": {
"results": [
{
"id": "15fd3f24-56c8-435e-af8e-c47d4cd6115c",
"score": 9,
"grouped_text": "Setup your Helpdesk domain name\ntutorials for most providers",

"items": [
{
"source": "helpdesk",
"primary_id": "51a32e4c-1cb5-47c9-bcc0-3e06f0dce90a",
"secondary_id": "15fd3f24-56c8-435e-af8e-c47d4cd6115c",
"text": "Setup your Helpdesk domain name\ntutorials for most providers",

"metadata": {
"title": "Setup your Helpdesk domain name"
}
}
]
}
]
}
}
```

#### ➡️ Translate Text

* **Method:** `client.task.translate_text(data)`
Expand Down
3 changes: 3 additions & 0 deletions mirage_api/resources/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ def summarize_conversation(self, data):
def categorize_conversation(self, data):
return self.parent.post("/task/categorize/conversation", data)

def rank_question(self, data):
return self.parent.post("/task/rank/question", data)

def translate_text(self, data):
return self.parent.post("/task/translate/text", data)

0 comments on commit 08d6288

Please sign in to comment.