Byword (Independent Publisher) (#2964)

* Revert "Merge branch 'microsoft:dev' into dev"

This reverts commit 096a7c3199, reversing
changes made to cb0948670f.

* Revert "Merge branch 'microsoft:dev' into dev"

This reverts commit cb0948670f, reversing
changes made to dc26e8a026.

* Revert "Revert "Merge branch 'microsoft:dev' into dev""

This reverts commit 01764d0a6d.

* Revert "Revert "Merge branch 'microsoft:dev' into dev""

This reverts commit a3f086ef0f.

* Add files via upload

* Revert "Add files via upload"

This reverts commit eeff7b7a02.

* Add files via upload

* Delete independent-publisher-connectors/FileIO directory

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Revert "Add files via upload"

This reverts commit 1d85506958.

* Update readme.md

* Revert "Update readme.md"

This reverts commit b94447a142.

* Add files via upload
This commit is contained in:
Troy Taylor 2023-12-08 08:40:11 -05:00 коммит произвёл GitHub
Родитель 10306bee77
Коммит 9f642ffe99
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 463 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,366 @@
{
"swagger": "2.0",
"info": {
"title": "Byword",
"description": "Generate high quality, AI-written articles at scale. Trusted by over 30,000 marketers, Byword has written hundreds of thousands of articles, on every topic imaginable.",
"version": "1.0",
"contact": {
"name": "Troy Taylor",
"url": "https://www.hitachisolutions.com",
"email": "ttaylor@hitachisolutions.com"
}
},
"host": "api.byword.ai",
"basePath": "/",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/create_article": {
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The message.",
"title": "Message"
},
"articleID": {
"type": "string",
"description": "The article identifier.",
"title": "Article ID"
}
}
}
}
},
"summary": "Create article",
"description": "Creates a new article from one of the three creation modes.",
"operationId": "ArticlePost",
"parameters": [
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"description": "The mode.",
"title": "Mode",
"default": "keyword",
"enum": [
"keyword",
"title"
]
},
"input": {
"type": "string",
"description": "The input.",
"title": "Input"
},
"language": {
"type": "string",
"description": "The language.",
"title": "Language"
},
"subheadings": {
"type": "string",
"description": "The subheadings.",
"title": "Subheadings"
},
"undetectable": {
"type": "boolean",
"description": "Whether undetectable.",
"title": "Undetectable"
},
"tone": {
"type": "string",
"description": "The tone.",
"title": "Tone"
},
"length": {
"type": "integer",
"format": "int32",
"description": "The length.",
"title": "Length"
}
},
"required": [
"input",
"mode"
]
}
}
]
}
},
"/get_article": {
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"Body": {
"type": "string",
"description": "The body.",
"title": "Body"
},
"Body (Markdown)": {
"type": "string",
"description": "The body in markdown.",
"title": "Body (Markdown)"
},
"Body (Plaintext)": {
"type": "string",
"description": "The body in plaintext.",
"title": "Body (Plaintext)"
},
"Created Date": {
"type": "string",
"description": "The created date.",
"title": "Created Date"
},
"Headings": {
"type": "array",
"items": {
"type": "string"
},
"description": "The headings.",
"title": "Headings"
},
"Image - Assets": {
"type": "array",
"items": {
"type": "string"
},
"description": "The image assets.",
"title": "Image Assets"
},
"Language": {
"type": "string",
"description": "The language.",
"title": "Language"
},
"Meta": {
"type": "string",
"description": "The meta.",
"title": "Meta"
},
"Mode": {
"type": "string",
"description": "The mode.",
"title": "Mode"
},
"Source": {
"type": "string",
"description": "The source.",
"title": "Source"
},
"Status": {
"type": "string",
"description": "The status.",
"title": "Status"
},
"Table of Contents": {
"type": "string",
"description": "The table of contents.",
"title": "Table of Contents"
},
"Title": {
"type": "string",
"description": "The title.",
"title": "Title"
},
"URL Slug": {
"type": "string",
"description": "The URL slug.",
"title": "URL Slug"
},
"_id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
}
}
}
}
},
"summary": "Get article",
"description": "Retrieve a created article. Articles typically take around 60 seconds to generate.",
"operationId": "ArticleGetPost",
"parameters": [
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "object",
"properties": {
"articleID": {
"type": "string",
"description": "The article identifier.",
"title": "Article ID"
}
}
}
}
]
}
},
"/list_articles": {
"post": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Body": {
"type": "string",
"description": "The body.",
"title": "Body"
},
"Body (Markdown)": {
"type": "string",
"description": "The body in markdown.",
"title": "Body (Markdown)"
},
"Body (Plaintext)": {
"type": "string",
"description": "The body in plaintext.",
"title": "Body (Plaintext)"
},
"Created Date": {
"type": "string",
"description": "The created date.",
"title": "Created Date"
},
"Headings": {
"type": "array",
"items": {
"type": "string"
},
"description": "The headings.",
"title": "Headings"
},
"Image - Assets": {
"type": "array",
"items": {
"type": "string"
},
"description": "The image assets.",
"title": "Image Assets"
},
"Language": {
"type": "string",
"description": "The language.",
"title": "Language"
},
"Meta": {
"type": "string",
"description": "The meta.",
"title": "Meta"
},
"Mode": {
"type": "string",
"description": "The mode.",
"title": "Mode"
},
"Source": {
"type": "string",
"description": "The source.",
"title": "Source"
},
"Status": {
"type": "string",
"description": "The status.",
"title": "Status"
},
"Table of Contents": {
"type": "string",
"description": "The table of contents.",
"title": "Table of Contents"
},
"Title": {
"type": "string",
"description": "The title.",
"title": "Title"
},
"URL Slug": {
"type": "string",
"description": "The URL slug.",
"title": "URL Slug"
},
"_id": {
"type": "string",
"description": "The identifier.",
"title": "ID"
}
}
}
}
}
},
"summary": "List articles",
"description": "Retrieves all articles created.",
"operationId": "ArticlesPost",
"parameters": [
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "object",
"properties": {
"cursor": {
"type": "integer",
"format": "int32",
"description": "The cursor.",
"title": "Cursor",
"default": 0
}
}
}
}
]
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {},
"security": [],
"tags": [],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://byword.ai/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://byword.ai/"
},
{
"propertyName": "Categories",
"propertyValue": "AI"
}
]
}

Просмотреть файл

@ -0,0 +1,35 @@
{
"properties": {
"connectionParameters": {
"key": {
"type": "securestring",
"uiDefinition": {
"displayName": "API Key",
"description": "The API Key for this api",
"tooltip": "Provide your API Key",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"scriptOperations": [],
"capabilities": [],
"policyTemplateInstances": [
{
"templateId": "setqueryparameter",
"title": "Add API Key",
"parameters": {
"x-ms-apimTemplateParameter.name": "key",
"x-ms-apimTemplateParameter.value": "@connectionParameters('key')",
"x-ms-apimTemplateParameter.existsAction": "override"
}
}
],
"publisher": "Troy Taylor",
"stackOwner": "Byword"
}
}

Просмотреть файл

@ -0,0 +1,21 @@
# Byword
Generate high quality, AI-written articles at scale. Trusted by over 30,000 marketers, Byword has written hundreds of thousands of articles, on every topic imaginable.
## Publisher: Troy Taylor, Hitachi Solutions
## Prerequisites
You will need to sign up for an account with [Byword](https://byword.ai/signup).
## Obtaining Credentials
You can find your API key on the [Integrations page](https://byword.ai/integrations_api).
## Supported Operations
### Create article
Creates a new article from one of the three creation modes.
### Get article
Retrieve a created article. Articles typically take around 60 seconds to generate.
### List articles
Retrieves all articles created.
## Known Issues and Limitations
There are no known issues at this time.

Просмотреть файл

@ -0,0 +1,41 @@
using Newtonsoft.Json;
using System.Collections.Generic;
public class Script : ScriptBase
{
public override async Task<HttpResponseMessage> ExecuteAsync()
{
var request = this.Context.Request;
var query = new Uri(request.RequestUri.AbsoluteUri).Query;
var queryParams = HttpUtility.ParseQueryString(query);
var key = queryParams["key"];
var requestBody = await request.Content.ReadAsStringAsync();
var requestBodyDictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(requestBody);
var jsonObject = new Dictionary<string, string>
{
{ "key", key }
};
foreach (var kvp in requestBodyDictionary)
{
jsonObject[kvp.Key] = kvp.Value;
}
var json = JsonConvert.SerializeObject(jsonObject);
var uriBuilder = new UriBuilder(request.RequestUri);
var queryParameters = HttpUtility.ParseQueryString(uriBuilder.Query);
queryParameters.Remove("key");
uriBuilder.Query = queryParameters.ToString();
var modifiedUri = uriBuilder.Uri;
var modifiedRequest = new HttpRequestMessage(request.Method, modifiedUri)
{
Content = new StringContent(json, Encoding.UTF8, request.Content.Headers.ContentType.MediaType)
};
var response = await this.Context.SendAsync(modifiedRequest, this.CancellationToken).ConfigureAwait(false);
return response;
}
}