Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SN1 connector documentation #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 206 additions & 0 deletions SN_1/sn1-openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{
"paths": {
"/chat/": {
"post": {
"responses": {
"400": {
"schema": {
"$ref": "#/definitions/StreamError"
},
"description": ""
},
"200": {
"schema": {
"$ref": "#/definitions/StreamChunk"
},
"description": ""
}
},
"parameters": [
{
"in": "body",
"required": false,
"name": "body",
"schema": {
"$ref": "#/definitions/QueryChat"
}
}
],
"tags": [
"Prompting API"
],
"summary": "Chat",
"description": "Chat endpoint.",
"produces": [
"application/json"
]
}
},
"/echo/": {
"post": {
"responses": {
"400": {
"schema": {
"$ref": "#/definitions/StreamError"
},
"description": ""
},
"200": {
"schema": {
"$ref": "#/definitions/StreamChunk"
},
"description": ""
}
},
"parameters": [
{
"in": "body",
"required": false,
"name": "body",
"schema": {
"$ref": "#/definitions/QueryChat"
}
}
],
"tags": [
"Prompting API"
],
"summary": "Echo test",
"description": "Echo endpoint for testing purposes.",
"produces": [
"application/json"
]
}
}
},
"info": {
"title": "Prompting API",
"version": "0.0.1"
},
"swagger": "2.0",
"definitions": {
"QueryChat": {
"type": "object",
"properties": {
"k": {
"type": "integer",
"format": "int32",
"description": "The number of miners from which to request responses."
},
"exclude": {
"type": "array",
"description": "A list of roles or agents to exclude from querying.",
"items": {
"type": "string"
}
},
"roles": {
"type": "array",
"description": "The roles of the agents to query.",
"items": {
"type": "string"
}
},
"messages": {
"type": "array",
"description": "The messages to be sent to the network.",
"items": {
"type": "string"
}
},
"timeout": {
"type": "integer",
"format": "int32",
"description": "The time in seconds to wait for a response."
},
"prefer": {
"type": "string",
"description": "The preferred response format, can be either 'longest' or 'shortest'."
},
"sampling_mode": {
"type": "string",
"description": "The mode of sampling to use, defaults to 'random'. Can be either 'random' or 'top_incentive'."
}
},
"required": [
"messages",
"roles"
]
},
"StreamError": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error occurred."
},
"timestamp": {
"type": "string",
"description": "The timestamp of the error."
},
"sequence_number": {
"type": "integer",
"format": "int32",
"description": "A sequential identifier for the error."
},
"finish_reason": {
"type": "string",
"description": "Indicates an error completion."
}
},
"required": [
"error",
"sequence_number",
"timestamp"
]
},
"StreamChunk": {
"type": "object",
"properties": {
"delta": {
"type": "string",
"description": "The new chunk of response received."
},
"finish_reason": {
"type": "string",
"description": "The reason for the response completion, if applicable."
},
"accumulated_chunks": {
"type": "array",
"description": "All accumulated chunks of responses.",
"items": {
"type": "string"
}
},
"accumulated_chunks_timings": {
"type": "array",
"description": "Timing for each chunk received.",
"items": {
"type": "number",
"format": "float"
}
},
"timestamp": {
"type": "string",
"description": "The timestamp at which the chunk was processed."
},
"sequence_number": {
"type": "integer",
"format": "int32",
"description": "A sequential identifier for the response part."
},
"selected_uid": {
"type": "integer",
"format": "int32",
"description": "The identifier for the selected response source."
}
},
"required": [
"delta",
"selected_uid",
"sequence_number",
"timestamp"
]
}
}
}