# room

Room - probably the most interesting feature introduced in version 1.1.0 (the first version to include Room). Room creates a space for interacting with the AI. While you're in the room, the AI retains memory and chat history, but you can also upload your own chat history.

Examples of creating a simple room:

{% tabs %}
{% tab title="Example 1" %}

```python
from freeGPTFix.lib.room import Room

with Room() as room:
	while True:
		text = input("> ")
		resp = room.send_message(text)
		print(resp["reply"])
```

{% endtab %}

{% tab title="Example 2" %}

```python
from freeGPTFix.lib.room import Room

with Room() as room:
	while True:
		text = input("> ")
		resp = room.send_message(text)
		print(resp["reply"])
		room.saveHistory() # save history
```

{% endtab %}
{% endtabs %}

Examples of loading history into a room (history that was saved using `room.saveHistory()`):

```python
from freeGPTFix.lib.room import Room

with Room(history_path="./path/to/yourHistory.json") as room:
	while True:
		text = input("> ")
		resp = room.send_message(text)
		print(resp["reply"])
		room.saveHistory()
```

In this example, we load the history into the room. After making a request and receiving a response from GPT, we save this history back to the file, and this process repeats after each request.
