You are on page 1of 7

Http Plugin Notes

Rest API:
 REST basically is a style of web architecture that governs the behavior of clients and
servers. While API is a more general set of protocols and is deployed over the software to
help it interact with some other software. REST is only geared towards web
applications. And mostly deals with HTTP requests and responses.
 A REST API is a web service API which uses URIs and HTTP protocol and JSON
for data format.
 It is limited to client-server-based applications. REST is a set of rules or guidelines
to build a web API.
 As REST uses HTTP verbs (GET, POST, PUT or DELETE) methods for
communication.
 Routes consist of two parts: an HTTP method and a resource path—for example, GET
/pets.
 A route in a REST API is a combination of a URL path and an HTTP method, and
it defines an endpoint that can be called to perform a specific operation on the API.
Namespace:
 Namespaces are the slugs in the URL before the endpoint.
 namespace refers to a grouping or a partition of available resources or operations that are
exposed by an API.
 namespace called "users" could contain all the resources and operations related to user
management, such as creating or deleting users, updating their information, and so on.
Examples:
Here are a few examples of namespaces in the context of REST APIs:
1. Users namespace:
URL path: /api/v1/users
Resources and operations:
- GET /api/v1/users : list all users
- POST /api/v1/users : create a new user
- GET /api/v1/users/{id} : get a specific user by ID
- PUT /api/v1/users/{id} : update a specific user by ID
- DELETE /api/v1/users/{id} : delete a specific user by ID
2. Products namespace:
URL path: /api/v1/products
Resources and operations:
- GET /api/v1/products : list all products
- POST /api/v1/products : create a new product
- GET /api/v1/products/{id} : get a specific product by ID
- PUT /api/v1/products/{id} : update a specific product by ID
- DELETE /api/v1/products/{id} : delete a specific product by ID

Plugins:
 Plugins can be used to add extra functionality to an API, such as authentication,
logging, caching, rate limiting, and so on.
 They can also be used to integrate the API with other services or systems, such as
databases or message queues. Plugins provide a way to extend an API without
having to modify the core code, making it easier to maintain and update the API
over time.
 API Plugin is a component to define a function template for the API Parser and API
Server to work with a third-party system.

Manifest:
 It is a structured representation
 we want to teach the model how to make useful queries with the Plugin Tool, based on the
information available in the manifest.

Payload
 In the context of an API, the payload can consist of the data that the client sends to the
server in the request body, and/or the data that the server sends back to the client in the
response body.
POST /users
Content-Type: application/json

{
"username": "newuser",
"email": "newuser@example.com",
"password": "password"
}

In this example, the payload is the JSON object `{ "username": "newuser", "email":
"newuser@example.com", "password": "password" }`, and it is sent to the server in the request
body when making a POST request to the `/users` endpoint.

Rating
 Any message that has the following errors should be marked a rating 1:
o It calls a plugin that does not exist in the context
 e.g. wikipedia.page-title-tile but wikipedia is not mentioned in the
namespaces of the task (i.e. Cell#0 in the task)
o It doesn’t call any function (no to: ..) but inputs text that looks like a message
to a plugin
 e.g. {"title": …}
o If the assistant fails to write a “summary” message after seeing the output of a
plugin
o If assistant don’t call the plugin, and mentioned, I’m an AI model, I can’t etc.. ->
rating 1
o If the response is in python code, then 1 rating.
 If namespace and function is correct, but parameter is wrong then shoud be -> rating 3
 If some other endpoint is called for some task, which was the optimial one then rating ->
rating 4.
 URL is not in format -> rating 4
 If the assistant doesn’t use the API call for the response, but gave the response right with
using API call, rate it -> rating 6

 If the assistant provided the source of API and user didn’t ask for that, then rate it 1.
[MAKE SURE IF THE API SOURCE IS USEFUL FOR THE USER, THEN ITS FINE]
 If there is no need to call the plugin, but assistant did, and the API is valid API, then give
1 rating.
 If assistant mentioned”will continue to speak”, give this 5 rating.
 If the plugin is correct and parameter in code form.. rating should be 2
 Completion that does not include the link, give it a rating 5.
 If the assistant is not displaying the image directly, then give rating -> 4
 If the assistant called the wrong API and continue the conversation, then don’t rate a
useless response, since atleast it give ways to the user to recover. Give a rating 6.
 If there is no need to call the plugin again, then give this a 2 rating.

if it was obviously a known fact, we shouldn't penalize the assistant for stating it without
using any plugins. If there is obvious facts, there is no need to use the API response.

syntax-related issue should be rated a 1 (wrong/no plugin name or function, text in plugin
message, JSON payload sent to text rather than a plugin, etc.

**RATINGS**

7: Best solution, no need furthur improvements

6: Solution is mostly good, small amount of spelling mistakes, contains small amount of unnecessary
details which can be avoided.

5: Solution is mostly good, but small mistakes that user would care, poor phrasing, some missing
information but not neccessary.

4: Response overall usefull, missing information, interoperate the question differently. Main thing is
that if there is something in the completion which, if removed, or added, makes the
completion much better in terms of content then we would go towards rating of 4
3: Response is some useful, but did major mistakes that user would care, programming bug.

2: Response is unhelpful overall, factural errors or other mistakes

1: harmful content, misleading information

---

5,6,7 --> Best Solution to Mostly good [ACCEDPTED]

3,4 --> Solution is Useful [ACCEPTED SOMEHOW WITH CHANGES]


1,2 --> SOlution is not helpful [NOT ACCEPTED]

1 --> Hallucinations

2 --> Misleading information, Unreasonable opinions

Make Sure This


 avoid adding “Date/Time” unless user has asked about any specific date.
 output/response of an API endpoint call contains some useful URL, please include (only if it is
useful) it in the response to the “User” using markdown notation, i.e. [text](url)

DON’T’
 No references to APIs or endpoints mentioned in the response to User
 No PII (Personal Identifiable Information) is included in the notebook
 No grammatical issues and typos in the notebook
 “Date/Time” are not referenced while adding response to User

7: the completion cannot be improved.
 6: the completion is mostly good, but may have minor mistakes that the user
would not really care about, such as an unimportant spelling mistake, a small
amount of unnecessary information, etc.
 5: the completion is mostly good, but may have small mistakes that the user
would care a little bit about, such as poor phrasing that makes the completion
harder to follow, missing information that would have been nice but not essential
for the user to know, etc.
 4: the completion is useful overall, but could be significantly improved, such as
adding significantly more information, or interpreting the question in a different
way.
 3: the completion has some helpful parts but makes a major mistake that the
user would care about, such as an important factual error or a programming bug
that the user would have trouble fixing.
 2: the response is unhelpful overall, because of important factual errors or other
mistakes.
 1: the response is potentially harmful in some way, most likely because of
harmful disallowed content or highly misleading mistake.

The assistant shouldn't mention any services and databases that it has access to since it could lead
to security issues – if assistant mention give a rating of 1
Grammar mistake

Knowledge based and me tool me se hi hi URL required hoga

Url format galat hota hai to 1 rate

You might also like