Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

DM Abbot #5

Open
aidadiaz9 opened this issue Oct 14, 2023 · 6 comments
Open

DM Abbot #5

aidadiaz9 opened this issue Oct 14, 2023 · 6 comments
Assignees
Labels
abbot Abbot (bot) related api API related functional requirement Required for system functionality and stability (MVP) nostr Related to nostr integration nostrasia Related to nostrasia hackathon

Comments

@aidadiaz9
Copy link
Collaborator

aidadiaz9 commented Oct 14, 2023

Due date = 10/17/23

@aidadiaz9 aidadiaz9 converted this from a draft issue Oct 14, 2023
@bnonni bnonni moved this from Backlog to Todo in Abbot - ATL BitLab Bot Oct 14, 2023
@bnonni
Copy link
Member

bnonni commented Oct 14, 2023

General

  • Need to create notes kind 4 for "encrypted direct message"
  • Follow spec defined for NIP-04
  • Use functionality from pynostr

Backend - Relay-Abbot

  • Use Relay-Abbot (see API crossplatform POC #3) to store and forward notes kind 4 that are directed to abbot
  • POST to Abbot via telegram API with new slash command in "text" field

Backend - Abbot

  • Define how to parse this from telegram
  • Could use a new slash command handler or some kind of message filter
  • Slash command example: /nostrdm <note_kind_4>
  • nostr_dm function should parse note, create embeddings, store in pinecone, pull similarity data, send to OpenAI, use Nostr class functions to construct a response API call to Relay-Abbot to broadcast to relay

Backend - Nostr

  • Add functions to Nostr class to construct a note kind 4 and sign it (nostr/nostr.py)

@bnonni bnonni moved this from Todo to In Progress in Abbot - ATL BitLab Bot Oct 14, 2023
@bnonni bnonni added api API related functional requirement Required for system functionality and stability (MVP) abbot Abbot (bot) related nostr Related to nostr integration nostrasia Related to nostrasia hackathon labels Oct 15, 2023
@bnonni
Copy link
Member

bnonni commented Oct 20, 2023

Taking new direction based on discussions with @w3irdrobot. We will be building our own API to run on top of the Telegram Abbot that will handle requests from a Nostr Abbot server. Nostr Abbot will be our nostr relay listener.

@bnonni
Copy link
Member

bnonni commented Oct 20, 2023

General

  • Need to create notes kind 4 for "encrypted direct message"
  • Follow spec defined for NIP-04
  • Use functionality from pynostr

Backend - Relay-Abbot

  • Use Relay-Abbot (see API crossplatform POC #3) to store and forward notes kind 4 that are directed to abbot
  • POST to Abbot via telegram API with new slash command in "text" field

Backend - Abbot

  • Define how to parse this from telegram
  • Could use a new slash command handler or some kind of message filter
  • Slash command example: /nostrdm <note_kind_4>
  • nostr_dm function should parse note, create embeddings, store in pinecone, pull similarity data, send to OpenAI, use Nostr class functions to construct a response API call to Relay-Abbot to broadcast to relay

Backend - Nostr

  • Add functions to Nostr class to construct a note kind 4 and sign it (nostr/nostr.py)

Updating this to align with new direction.

General

  • Need to create notes kind 4 for "encrypted direct message"
  • Follow spec defined for NIP-04
  • Use functionality from pynostr

Backend - AbbotNostr

  • Need to figure out how to keep a live socket open with relays to get DM events in real time
  • When DM event comes in, parse, decrypt content, create GPT object and store it all (see Setup and integrate databases #12)
  • Pull history from mongo and feed to OpenAI chatCompletion
  • Get response, construct history object {"role": "assistant", "content": "response from GPT"} add to history list and update DB
  • Construct DM event with response from GPT and broadcast to relay

bnonni added a commit to ATLBitLab/bot that referenced this issue Oct 24, 2023
# This is the 1st commit message:

requirements.txt

# This is the commit message ATLBitLab#2:

service file

# This is the commit message ATLBitLab#3:

server

# This is the commit message ATLBitLab#4:

Bump babel from 2.8.0 to 2.9.1

Bumps [babel](https://github.com/python-babel/babel) from 2.8.0 to 2.9.1.
- [Release notes](https://github.com/python-babel/babel/releases)
- [Changelog](https://github.com/python-babel/babel/blob/master/CHANGES.rst)
- [Commits](python-babel/babel@v2.8.0...v2.9.1)

---
updated-dependencies:
- dependency-name: babel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#5:

Bump oauthlib from 3.2.0 to 3.2.2

Bumps [oauthlib](https://github.com/oauthlib/oauthlib) from 3.2.0 to 3.2.2.
- [Release notes](https://github.com/oauthlib/oauthlib/releases)
- [Changelog](https://github.com/oauthlib/oauthlib/blob/master/CHANGELOG.rst)
- [Commits](oauthlib/oauthlib@v3.2.0...v3.2.2)

---
updated-dependencies:
- dependency-name: oauthlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#6:

Bump twisted from 22.4.0 to 22.10.0

Bumps [twisted](https://github.com/twisted/twisted) from 22.4.0 to 22.10.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](twisted/twisted@twisted-22.4.0...twisted-22.10.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#7:

Update issue templates
# This is the commit message ATLBitLab#8:

server

# This is the commit message ATLBitLab#9:

group

# This is the commit message ATLBitLab#10:

server

# This is the commit message ATLBitLab#11:

update reqs
bnonni added a commit to ATLBitLab/bot that referenced this issue Oct 24, 2023
# This is the 1st commit message:

requirements.txt

# This is the commit message ATLBitLab#2:

service file

# This is the commit message ATLBitLab#3:

server

# This is the commit message ATLBitLab#4:

Bump babel from 2.8.0 to 2.9.1

Bumps [babel](https://github.com/python-babel/babel) from 2.8.0 to 2.9.1.
- [Release notes](https://github.com/python-babel/babel/releases)
- [Changelog](https://github.com/python-babel/babel/blob/master/CHANGES.rst)
- [Commits](python-babel/babel@v2.8.0...v2.9.1)

---
updated-dependencies:
- dependency-name: babel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#5:

Bump oauthlib from 3.2.0 to 3.2.2

Bumps [oauthlib](https://github.com/oauthlib/oauthlib) from 3.2.0 to 3.2.2.
- [Release notes](https://github.com/oauthlib/oauthlib/releases)
- [Changelog](https://github.com/oauthlib/oauthlib/blob/master/CHANGELOG.rst)
- [Commits](oauthlib/oauthlib@v3.2.0...v3.2.2)

---
updated-dependencies:
- dependency-name: oauthlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#6:

Bump twisted from 22.4.0 to 22.10.0

Bumps [twisted](https://github.com/twisted/twisted) from 22.4.0 to 22.10.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](twisted/twisted@twisted-22.4.0...twisted-22.10.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
# This is the commit message ATLBitLab#7:

Update issue templates
# This is the commit message ATLBitLab#8:

server

# This is the commit message ATLBitLab#9:

group

# This is the commit message ATLBitLab#10:

server

# This is the commit message ATLBitLab#11:

update reqs

# This is the commit message ATLBitLab#12:

updates

# This is the commit message ATLBitLab#13:

local
@bnonni
Copy link
Member

bnonni commented Oct 26, 2023

Due date = 10/17/23

Due date:

  • 10/26/23 or 10/27/23 (ideal)
  • 10/28/23 (latest)

@bnonni
Copy link
Member

bnonni commented Oct 28, 2023

Backend - AbbotNostr

Open Questions

  • Need to figure out how to keep a live socket open with relays to get DM events in real time

Func Reqs

  • When DM event comes in, parse content, create GPT object and store new or update existing DM document (see Setup and integrate databases #12)
  • Grab the history key-value pair from DM document and send to OpenAI chatCompletion
  • Get response and construct new history object {"role": "assistant", "content": "response from GPT"}
  • Add to history list and update DM document in DB
  • Construct CHANNEL_MESSAGE event with response from GPT and broadcast to relay

@bnonni
Copy link
Member

bnonni commented Nov 14, 2023

Progress made and changes live on the nostrasia branch.

@bnonni bnonni moved this from In Progress to Backlog in Abbot - ATL BitLab Bot Nov 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
abbot Abbot (bot) related api API related functional requirement Required for system functionality and stability (MVP) nostr Related to nostr integration nostrasia Related to nostrasia hackathon
Projects
None yet
Development

No branches or pull requests

4 participants