From 21c4145f54cc24b494294b2a39e0353358279f34 Mon Sep 17 00:00:00 2001 From: birdup Date: Fri, 10 May 2024 23:15:00 +0500 Subject: [PATCH] Upload files to "/" Signed-off-by: birdup --- README.MD | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.MD diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..c6ea76f --- /dev/null +++ b/README.MD @@ -0,0 +1,39 @@ +# Reverse Engineer: Interacting with the Anakin API + +This Python script demonstrates how to interact with the Anakin API to generate a response from the Claude 3 Sonnet Example model. + +## Prerequisites + +1. Python 3.x installed on your system. +2. The `requests` library installed. You can install it using `pip install requests`. + +## Usage + +1. Replace the following variables with your own values: + - `workspace_id`: Your user workspace ID. + - `app_id`: The ID of the app you want to use. + - `app_instance_id`: The ID of the app instance you want to use. + - `app_conversation_id`: The ID of the app conversation you want to use. + - `authorization_bearer`: Your authorization bearer token. + +2. Customize the `content` variable with the prompt you want to send to the model. + +3. Run the script, and it will print the response from the model. + +## Explanation + +The script performs the following steps: + +1. Imports the necessary libraries: `requests` and `uuid`. +2. Defines the variables needed for the API requests. +3. Creates a function `generate_unique_id()` to generate a unique ID for each request. +4. Sends the first request to the `/api/v1/workspaces/0/apps/{app_id}/app-conversation-messages` endpoint with the provided data and headers. This request generates a response from the Claude 3 Sonnet Example model. +5. Sends the second request to the `/api/v1/user/credit?locale=en-US` endpoint to retrieve the user's credit information. + +The script uses the `requests` library to make the API calls and handles any `ChunkedEncodingError` exceptions that may occur during the streaming response. + +## Notes + +- Make sure to replace the placeholders with your actual values before running the script. +- The script assumes that you have the necessary permissions and access to the Anakin API. +- The script is provided as an example and may need to be modified to fit your specific use case. \ No newline at end of file