# Random Stuff Api Wrapper

{% hint style="danger" %}
DEBUG MODE IS BROKEN. KEEP IT ON FALSEEEEEEEE
{% endhint %}

## Set-Up

Installing library:

```
pip install rsaw==0.8
```

Set-Up client:

{% code title="cookie.py" %}

```bash
from rsaw.v5.rsa import *
client = RandomStuff(key="Remote Control", server="main")
```

{% endcode %}

In the client there are multiple options, `key` define your key, `server` server you want data from main/backup, `plan` what plan you are, `debug` if set to false (defaults to True) it will ignore all errors and send a random backup message (more on that below).&#x20;

### Backup Messages:

Backup messages will ignore errors and send a random message from a list.

```bash
from rsaw.v5.rsa import *

client = RandomStuff(key="Remote Control", server="main")
client.set_backups(ai=['ai broke man','ai cant think'], joke=['joke failed'])

joke = client.get_joke(joke_type='invalid joke type')
print(joke) # then this would print joke failed because thats our backup
```

If you set `debug` to true in the client then it will normally give errors so you can fix your bug.

### Response Type:

the `res_type` is how you want your response, if set to `json`(or anything else but text) it will return all the response data witch looks like this: `{response: "The response", server: "main/backup", uid: 69}` for AI. If set to `text` it will index it and return just the response message (or joke)&#x20;

```bash
from rsaw.v5.rsa import *

client = RandomStuff(key="Remote Control", server="main")
client.set_backups(ai=['ai broke man','ai cant think'], joke=['joke failed'])

joke_text = client.get_joke(res_type='text')
print(joke_text)

joke_json = client.get_joke(res_type='json')
print(joke_json)
```

### Error's:

UNDER CONSTRUCTION... ERRORS ARE REALLY BROKEN RIGHT NOW


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eliang.gitbook.io/rsaw/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
