Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Commit 344a965

Browse files
author
Antonio
committed
docs and format
1 parent 713e53e commit 344a965

2 files changed

Lines changed: 61 additions & 12 deletions

File tree

docs/wiki/V1.md

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Chatbot class for ChatGPT
4242
def __init__(config: dict[str, str],
4343
conversation_id: str | None = None,
4444
parent_id: str | None = None,
45-
session_client=None,
4645
lazy_loading: bool = True,
4746
base_url: str | None = None) -> None
4847
```
@@ -241,6 +240,25 @@ Get message history
241240
- `id`: UUID of conversation
242241
- `encoding`: String
243242

243+
<a id="revChatGPT.V1.Chatbot.share_conversation"></a>
244+
245+
#### share\_conversation
246+
247+
```python
248+
def share_conversation(convo_id: str = None,
249+
node_id: str = None,
250+
anonymous: bool = True) -> str
251+
```
252+
253+
Creates a share link to a conversation
254+
255+
**Arguments**:
256+
257+
- `convo_id`: UUID of conversation
258+
- `node_id`: UUID of node
259+
Returns:
260+
str: A URL to the shared link
261+
244262
<a id="revChatGPT.V1.Chatbot.gen_title"></a>
245263

246264
#### gen\_title
@@ -345,8 +363,9 @@ Async Chatbot class for ChatGPT
345363
```python
346364
def __init__(config: dict,
347365
conversation_id: str | None = None,
348-
parent_id: str = "",
349-
base_url: str = "") -> None
366+
parent_id: str | None = None,
367+
base_url: str | None = None,
368+
lazy_loading: bool = True) -> None
350369
```
351370

352371
Same as Chatbot class, but with async methods.
@@ -358,10 +377,12 @@ Same as Chatbot class, but with async methods.
358377
```python
359378
async def post_messages(messages: list[dict],
360379
conversation_id: str | None = None,
361-
parent_id: str = "",
362-
model: str = "",
380+
parent_id: str | None = None,
381+
plugin_ids: list = [],
382+
model: str | None = None,
363383
auto_continue: bool = False,
364-
timeout: int = 360) -> AsyncGenerator[dict, None]
384+
timeout: float = 360,
385+
**kwargs) -> AsyncGenerator[dict, None]
365386
```
366387

367388
Post messages to the chatbot
@@ -370,8 +391,8 @@ Post messages to the chatbot
370391

371392
- `messages` _list[dict]_ - the messages to post
372393
- `conversation_id` _str | None, optional_ - UUID for the conversation to continue on. Defaults to None.
373-
- `parent_id` _str, optional_ - UUID for the message to continue on. Defaults to "".
374-
- `model` _str, optional_ - The model to use. Defaults to "".
394+
- `parent_id` _str | None, optional_ - UUID for the message to continue on. Defaults to None.
395+
- `model` _str | None, optional_ - The model to use. Defaults to None.
375396
- `auto_continue` _bool, optional_ - Whether to continue the conversation automatically. Defaults to False.
376397
- `timeout` _float, optional_ - Timeout for getting the full response, unit is second. Defaults to 360.
377398

@@ -387,6 +408,7 @@ Post messages to the chatbot
387408
- `"finish_details"` - str,
388409
- `"end_turn"` - bool,
389410
- `"recipient"` - str,
411+
- `"citations"` - list[dict],
390412
}
391413

392414
<a id="revChatGPT.V1.AsyncChatbot.ask"></a>
@@ -398,8 +420,10 @@ async def ask(prompt: str,
398420
conversation_id: str | None = None,
399421
parent_id: str = "",
400422
model: str = "",
423+
plugin_ids: list = [],
401424
auto_continue: bool = False,
402-
timeout: int = 360) -> AsyncGenerator[dict, None]
425+
timeout: int = 360,
426+
**kwargs) -> AsyncGenerator[dict, None]
403427
```
404428

405429
Ask a question to the chatbot
@@ -494,6 +518,25 @@ Get message history
494518

495519
- `id`: UUID of conversation
496520

521+
<a id="revChatGPT.V1.AsyncChatbot.share_conversation"></a>
522+
523+
#### share\_conversation
524+
525+
```python
526+
async def share_conversation(convo_id: str = None,
527+
node_id: str = None,
528+
anonymous: bool = True) -> str
529+
```
530+
531+
Creates a share link to a conversation
532+
533+
**Arguments**:
534+
535+
- `convo_id`: UUID of conversation
536+
- `node_id`: UUID of node
537+
Returns:
538+
str: A URL to the shared link
539+
497540
<a id="revChatGPT.V1.AsyncChatbot.gen_title"></a>
498541

499542
#### gen\_title

src/revChatGPT/V1.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@ def get_msg_history(self, convo_id: str, encoding: str | None = None) -> list:
711711
return response.json()
712712

713713
def share_conversation(
714-
self, convo_id: str = None, node_id: str = None, anonymous: bool = True
714+
self,
715+
convo_id: str = None,
716+
node_id: str = None,
717+
anonymous: bool = True,
715718
) -> str:
716719
"""
717720
Creates a share link to a conversation
@@ -1015,7 +1018,7 @@ async def post_messages(
10151018
parent_id = self.conversation_mapping[conversation_id]
10161019
else:
10171020
print(
1018-
"Warning: Invalid conversation_id provided, treat as a new conversation"
1021+
"Warning: Invalid conversation_id provided, treat as a new conversation",
10191022
)
10201023
conversation_id = None
10211024
parent_id = str(uuid.uuid4())
@@ -1195,7 +1198,10 @@ async def get_msg_history(
11951198
return None
11961199

11971200
async def share_conversation(
1198-
self, convo_id: str = None, node_id: str = None, anonymous: bool = True
1201+
self,
1202+
convo_id: str = None,
1203+
node_id: str = None,
1204+
anonymous: bool = True,
11991205
) -> str:
12001206
"""
12011207
Creates a share link to a conversation

0 commit comments

Comments
 (0)