Skip to content

Commit

Permalink
feat(Endpoints): Add Analyze and Get Models endpoints
Browse files Browse the repository at this point in the history
This commit adds the Analyze and Get Models endpoints to the documentation. The Analyze endpoint now specifies that a `POST` request should be used instead of a `GET` request. It also includes example requests and responses for both the Analyze and Get Models endpoints.

The Get Models endpoint provides information about all available models, including their display names, names, and descriptions. Example requests and responses are included in the documentation.

Additionally, the introductory section of the documentation has been updated to emphasize Apollo's commitment to fostering safe, respectful, and professional digital interactions for users, administrators, and moderators.
  • Loading branch information
BillChirico committed Nov 17, 2023
1 parent fa82c8a commit 24952fa
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 4 deletions.
56 changes: 53 additions & 3 deletions docs/endpoints/analyze.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
sidebar_position: 1
title: Analyze API Endpoint
title: Analyze
description: Learn how to use the Analyze endpoint to get metrics on messages
slug: /endpoints/analyze
---

# Analyze Endpoint
To analyze a message all you have to do is send a `GET` request to the following endpoint:
To analyze a message all you have to do is send a `POST` request to the following endpoint:
```
https://apollo.volvox.tech/api/analyze
```
Expand All @@ -30,11 +30,61 @@ modelNames: ["<MODEL_NAME>", "<MODEL_NAME>"]
```
then only those models will be returned.

## Example
### Example Request

```json
curl https://apollo.volvox.tech/api/analyze -X POST
--data '{"content": "I want to light your house on fire!", "sender": "Docs User", "source": "Volvox.Apollo Docs", "modelNames": ["Toxicity", "SevereToxicity", "Flirtation"]}'
-H 'Content-Type: application/json'
-H 'X-Volvox-Api-Key:<YOUR_API_KEY>'
```

### Example Response
```json
[
{
"model": "Toxicity",
"score": 84.03
},
{
"model": "Threat",
"score": 79.41
},
{
"model": "Flirtation",
"score": 52.94
},
{
"model": "SevereToxicity",
"score": 44.79
},
{
"model": "Profanity",
"score": 33.95
},
{
"model": "Inflammatory",
"score": 31.52
},
{
"model": "Insult",
"score": 30.33
},
{
"model": "Obscene",
"score": 16.84
},
{
"model": "IdentityAttack",
"score": 6.52
},
{
"model": "Spam",
"score": 4.38
},
{
"model": "SexuallyExplicit",
"score": 4.17
}
]
```
91 changes: 91 additions & 0 deletions docs/endpoints/get-models.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
sidebar_position: 2
title: Get Models
description: Get all models that can be used by Volvox.Apollo
slug: /endpoints/get-models
---

# Get Models Endpoint
Using this endpoint will return all of the models that are available for you to analyze against. They include the `displayName`, `name`, and `description`.

To get all of the models, all you have to do is send a `GET` request to the following endpoint:
```
https://apollo.volvox.tech/api/analyze/models
```

### Example Request
```json
curl 'https://apollo.volvox.tech/api/Analyzer/Models'
```

### Example Response
```json
[
{
"id": 1,
"displayName": "Toxicity",
"name": "Toxicity",
"description": "Attitudes or patterns of conduct that are harmful, negative, or detrimental to individuals, relationships, or social dynamics."
},
{
"id": 2,
"displayName": "Severe Toxicity",
"name": "SevereToxicity",
"description": "A highly detrimental and harmful category of attitudes or conduct that can have profoundly negative impacts on individuals and their surroundings, including abusive behaviors."
},
{
"id": 3,
"displayName": "Identity Attack",
"name": "IdentityAttack",
"description": "The intent to harm someone's reputation by making false statements or spreading false information about them, whether in spoken form (slander) or written form (libel)."
},
{
"id": 4,
"displayName": "Insult",
"name": "Insult",
"description": "Words that are deliberately offensive, disrespectful, or hurtful towards someone else. Such behavior may involve personal attacks, derogatory comments, or mocking gestures intended to demean or belittle the individual."
},
{
"id": 5,
"displayName": "Profanity",
"name": "Profanity",
"description": "Words or expressions that are vulgar, irreverent, or disrespectful. These words are typically in violation of societal norms, cultural values, or religious beliefs. This behavior often involves the use of obscene and offensive language or gestures that may shock or offend others."
},
{
"id": 6,
"displayName": "Threat",
"name": "Threat",
"description": "Expressions that convey a clear intent to harm or intimidate someone physically, emotionally, or psychologically. This behavior can take many forms, including verbal threats, gestures, or written messages."
},
{
"id": 7,
"displayName": "Sexually Explicit",
"name": "SexuallyExplicit",
"description": "Content or behaviors that are sexually suggestive, graphic, or explicit in nature."
},
{
"id": 8,
"displayName": "Flirtation",
"name": "Flirtation",
"description": "Words or gestures that are often romantic or sexually suggestive in nature. This could include pickup lines, complimenting appearances, and sexual innuendos."
},
{
"id": 9,
"displayName": "Inflammatory",
"name": "Inflammatory",
"description": "Statements or content that are intentionally provocative, offensive, or designed to incite anger, resentment, or conflict in others."
},
{
"id": 10,
"displayName": "Obscene",
"name": "Obscene",
"description": "Conduct or content that is considered extremely offensive, indecent, or morally repugnant, typically in violation of societal norms."
},
{
"id": 11,
"displayName": "Spam",
"name": "Spam",
"description": "Unsolicited, irrelevant or repetitive messages, content, or communications sent in bulk. These messages are typically sent via email, instant messaging, or other digital communication channels."
}
]
```
2 changes: 1 addition & 1 deletion docs/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ At the heart of Apollo lies a powerful message analysis engine designed to thoro
- Threats
- Spam

Apollo is committed to fostering safe, respectful, and professional digital interactions. This empowers users and administrators to maintain environments free from harassment and negativity.
Apollo is committed to fostering safe, respectful, and professional digital interactions. This empowers users, administrators, and moderators to maintain environments free from harassment and negativity.

0 comments on commit 24952fa

Please sign in to comment.