Methods
call(user, text, engineopt) → {Promise.<Object>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
user |
string | The ID of the user accessing the Soffos API. Soffos assumes that the owner of the api is an application (app) and that app has users. Soffos API will accept any string. | ||
text |
string | Text to be corrected. | ||
engine |
string |
<optional> |
null | The LLM engine to be used. |
Returns:
correction - string
Corrected text.
Corrected text.
- Type
- Promise.<Object>
Example
import { SoffosServices } from "soffosai";
const my_apiKey = "Token <put your api key here>";
const service = new SoffosServices.TranscriptCorrectionService({apiKey:my_apiKey});
let response = await service.call(
"Client 87654321",
" We just want to show people or services can't help them. Create amazing. Applications"
);
console.log(JSON.stringify(response, null, 2));
// returns
// {
// "corrected": "We just want to show people how our services can help them create amazing applications."
// "cost": {
// "api_call_cost": 0.005,
// "character_volume_cost": 0.005,
// "total_cost": 0.01
// },
// "engine": "gpt-3.5-turbo-instruct",
// "charged_character_count": 100,
// "unit_price": "0.000050"
// }
setInputConfigs(name, text, engineopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Reference name of this Service. It will be used by the Pipeline to reference this Service. | ||
text |
string | InputConfig | Text to be corrected. | ||
engine |
string |
<optional> |
null | The LLM engine to be used. |