Skip to content

Commit

Permalink
Dev minor (#1429)
Browse files Browse the repository at this point in the history
* Modify graphrag prompt (#1421)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq (#1412)

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* Prod fixes + enhancements (#1407)

* change default settings back to fp32

* add logging and cache triples

* up

* up

* pre-commit and cleanups

* making community summary prompt async

* up

* up

* revert prompt changes

* up

* up

* modify default

* bump test timeout due to stricter concurrency limits

* bump sleep

* rm ubuntu from windows/mac workflows

* up

* add tests

* Feature/include vectors option document chunks (#1419)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* add option to include vectors in document chunks

* checkin

* update vector

---------

Co-authored-by: Nolan Tremelling <[email protected]>

* Allow env var to set the default R2R deployment for the dashboard (#1417)

* modify community_summary_prompt function and corresponding prompt

* add tests

* up

* Feature/various documentation tweaks (#1422)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* add option to include vectors in document chunks

* checkin

* update vector

* some various documentation tweaks

* some various documentation tweaks

---------

Co-authored-by: Nolan Tremelling <[email protected]>

* Graphrag tests (#1418)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq (#1412)

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* Prod fixes + enhancements (#1407)

* change default settings back to fp32

* add logging and cache triples

* up

* up

* pre-commit and cleanups

* making community summary prompt async

* up

* up

* revert prompt changes

* up

* up

* modify default

* bump test timeout due to stricter concurrency limits

* bump sleep

* rm ubuntu from windows/mac workflows

* up

* add tests

---------

Co-authored-by: Nolan Tremelling <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>

* Modify graphrag tests timeouts (#1416)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq (#1412)

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* Prod fixes + enhancements (#1407)

* change default settings back to fp32

* add logging and cache triples

* up

* up

* pre-commit and cleanups

* making community summary prompt async

* up

* up

* revert prompt changes

* up

* up

* modify default

* bump test timeout due to stricter concurrency limits

* bump sleep

* rm ubuntu from windows/mac workflows

* modify timeouts

---------

Co-authored-by: Nolan Tremelling <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>

* feat: Make prompt provider methods asynchronous (comments below) (#1415)

* Fix async JSON parsing (#1408)

* Fix async JSON parsing

* Remove score completion from js

* clean up js

* lockfile

* Feature/build custom logger (#1409)

* building a custom logger for r2r

* fix log

* maintain bkwd compat

* Feature/add kg description prompt (#1411)

* add kg desc prompt

* add kg desc prompt

* add kg desc prompt

* fix prompt name

* separate test run freq (#1412)

* separate test run freq

* task_id check fix

* add ingestion docs

* updatet

* add

* rm old prompts

* rm old prompots

* rm old prompts

* rm old prompts

* Prod fixes + enhancements (#1407)

* change default settings back to fp32

* add logging and cache triples

* up

* up

* pre-commit and cleanups

* making community summary prompt async

* up

* up

* revert prompt changes

* up

* up

* modify default

* bump test timeout due to stricter concurrency limits

* bump sleep

* rm ubuntu from windows/mac workflows

* feat: Make prompt provider methods asynchronous

---------

Co-authored-by: Nolan Tremelling <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>

* up

* up

---------

Co-authored-by: Nolan Tremelling <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>

* Add routes, service level methods around conversations (#1420)

* Add routes, service level methods around conversations

* Slight refactor to match project conventions, add JS methods

* Updated JS methods

* JS docs

* Add python

* Update JS user tests

* Bump JS, fix python SKD ingest chunks comments

* Update pyproject.toml

---------

Co-authored-by: Nolan Tremelling <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
Co-authored-by: emrgnt-cmplxty <[email protected]>
  • Loading branch information
4 people authored Oct 18, 2024
1 parent e3434b6 commit c9be2c5
Show file tree
Hide file tree
Showing 28 changed files with 2,037 additions and 568 deletions.
183 changes: 183 additions & 0 deletions docs/documentation/js-sdk/conversations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
---
title: 'Conversations'
description: 'Managing conversations with R2R.'
---

<Warning>
This feature is currently in beta. Functionality may change, and we value your feedback around these features.
</Warning>

<Note>
Occasionally this SDK documentation falls out of date, cross-check with the automatically generated <a href="/api-reference/introduction"> API Reference documentation </a> for the latest parameters.
</Note>

## Conversation Management

### Get Conversations Overview

Retrieve an overview of existing conversations:

```javascript
const offset = 0;
const limit = 10;
const overviewResponse = await client.conversationsOverview(offset, limit);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response containing an overview of conversations.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="offset" type="number">
The offset to start listing conversations from.
</ParamField>

<ParamField path="limit" type="number">
The maximum number of conversations to return.
</ParamField>

### Get Conversation

Fetch a specific conversation by its UUID:

```javascript
const conversationId = '123e4567-e89b-12d3-a456-426614174000';
const conversation = await client.getConversation(conversationId);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response containing the requested conversation details.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversationId" type="string" required>
The UUID of the conversation to retrieve.
</ParamField>

### Create Conversation

Create a new conversation:

```javascript
const newConversation = await client.createConversation();
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response containing details of the newly created conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

### Add Message

Add a message to an existing conversation:

```javascript
const conversationId = '123e4567-e89b-12d3-a456-426614174000';
const message = { text: 'Hello, world!' };
const parentId = '98765432-e21b-12d3-a456-426614174000';
const metadata = { key: 'value' };

const addMessageResponse = await client.addMessage(conversationId, message, parentId, metadata);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response after adding the message to the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversationId" type="string" required>
The UUID of the conversation to add the message to.
</ParamField>

<ParamField path="message" type="object" required>
The message object to add to the conversation.
</ParamField>

<ParamField path="parentId" type="string">
An optional UUID of the parent message.
</ParamField>

<ParamField path="metadata" type="object">
An optional metadata object for the message.
</ParamField>

### Update Message

Update an existing message in a conversation:

```javascript
const messageId = '98765432-e21b-12d3-a456-426614174000';
const updatedMessage = { text: 'Updated message content' };

const updateMessageResponse = await client.updateMessage(messageId, updatedMessage);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response after updating the message.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="messageId" type="string" required>
The UUID of the message to update.
</ParamField>

<ParamField path="message" type="object" required>
The updated message object.
</ParamField>

### Get Branches Overview

Retrieve an overview of branches in a conversation:

```javascript
const conversationId = '123e4567-e89b-12d3-a456-426614174000';
const branchesOverview = await client.branchesOverview(conversationId);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response containing an overview of branches in the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversationId" type="string" required>
The UUID of the conversation to get branches for.
</ParamField>

### Delete Conversation

Delete a conversation by its UUID:

```javascript
const conversationId = '123e4567-e89b-12d3-a456-426614174000';
const deleteResponse = await client.deleteConversation(conversationId);
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="object">
The response after deleting the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversationId" type="string" required>
The UUID of the conversation to delete.
</ParamField>
9 changes: 0 additions & 9 deletions docs/documentation/js-sdk/observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ description: 'Manage and observe your R2R system.'
## Analytics and Observability
R2R provides various tools for analytics and observability to help you monitor and improve the performance of your RAG system.

### Completion Scores
Scores act as an observability metric and are attached to RAG completions in R2R.

Scores are bound to values between -1 (a strong negative association) and 1 (a strong positive association), where:
- A score close to 1 may indicate a highly relevant and accurate completion
- A score close to 0 may indicate a neutral or uncertain quality
- A score close to -1 may indicate a potentially irrelevant or incorrect completion

```javascript
const scoringResponse = await client.login("message_id_here", "password123");
```


<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
Expand Down
193 changes: 193 additions & 0 deletions docs/documentation/python-sdk/conversations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
title: 'Conversations'
description: 'Managing conversations with R2R.'
---

<Warning>
This feature is currently in beta. Functionality may change, and we value your feedback around these features.
</Warning>

<Note>
Occasionally this SDK documentation falls out of date, cross-check with the automatically generated <a href="/api-reference/introduction"> API Reference documentation </a> for the latest parameters.
</Note>

## Conversation Management

### Get Conversations Overview

Retrieve an overview of existing conversations:

```python
conversation_ids = ['123e4567-e89b-12d3-a456-426614174000', '987f6543-e21b-12d3-a456-426614174000']
offset = 0
limit = 10
overview_response = await client.conversations_overview(conversation_ids, offset, limit)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response containing an overview of conversations.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversation_ids" type="list[str]">
Optional list of conversation UUIDs to retrieve.
</ParamField>

<ParamField path="offset" type="int">
The offset to start listing conversations from.
</ParamField>

<ParamField path="limit" type="int">
The maximum number of conversations to return.
</ParamField>

### Get Conversation

Fetch a specific conversation by its UUID:

```python
conversation_id = '123e4567-e89b-12d3-a456-426614174000'
branch_id = 'optional-branch-id'
conversation = await client.get_conversation(conversation_id, branch_id)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response containing the requested conversation details.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversation_id" type="str" required>
The UUID of the conversation to retrieve.
</ParamField>

<ParamField path="branch_id" type="str">
Optional ID of a specific branch to retrieve.
</ParamField>

### Create Conversation

Create a new conversation:

```python
new_conversation = await client.create_conversation()
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response containing details of the newly created conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

### Add Message

Add a message to an existing conversation:

```python
conversation_id = '123e4567-e89b-12d3-a456-426614174000'
message = Message(text='Hello, world!')
parent_id = '98765432-e21b-12d3-a456-426614174000'
metadata = {'key': 'value'}

add_message_response = await client.add_message(conversation_id, message, parent_id, metadata)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response after adding the message to the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversation_id" type="str" required>
The UUID of the conversation to add the message to.
</ParamField>

<ParamField path="message" type="Message" required>
The message object to add to the conversation.
</ParamField>

<ParamField path="parent_id" type="str">
An optional UUID of the parent message.
</ParamField>

<ParamField path="metadata" type="dict">
An optional metadata dictionary for the message.
</ParamField>

### Update Message

Update an existing message in a conversation:

```python
message_id = '98765432-e21b-12d3-a456-426614174000'
updated_message = Message(text='Updated message content')

update_message_response = await client.update_message(message_id, updated_message)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response after updating the message.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="message_id" type="str" required>
The UUID of the message to update.
</ParamField>

<ParamField path="message" type="Message" required>
The updated message object.
</ParamField>

### Get Branches Overview

Retrieve an overview of branches in a conversation:

```python
conversation_id = '123e4567-e89b-12d3-a456-426614174000'
branches_overview = await client.branches_overview(conversation_id)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response containing an overview of branches in the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversation_id" type="str" required>
The UUID of the conversation to get branches for.
</ParamField>

### Delete Conversation

Delete a conversation by its UUID:

```python
conversation_id = '123e4567-e89b-12d3-a456-426614174000'
delete_response = await client.delete_conversation(conversation_id)
```

<AccordionGroup>
<Accordion title="Response">
<ResponseField name="response" type="dict">
The response after deleting the conversation.
</ResponseField>
</Accordion>
</AccordionGroup>

<ParamField path="conversation_id" type="str" required>
The UUID of the conversation to delete.
</ParamField>
Loading

0 comments on commit c9be2c5

Please sign in to comment.