-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e6b56a
commit c074f08
Showing
5 changed files
with
195 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
async def chat(): | ||
pass | ||
|
||
|
||
async def hydrate(): | ||
pass | ||
|
||
|
||
async def insight(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
|
||
from dotenv import load_dotenv | ||
from realtime.connection import Socket | ||
|
||
load_dotenv() | ||
|
||
SUPABASE_ID = os.getenv("SUPABASE_ID") | ||
API_KEY = os.getenv("SUPABASE_API_KEY") | ||
|
||
|
||
def derive_facts(payload): | ||
print("Derive Facts: ", payload) | ||
|
||
|
||
if __name__ == "__main__": | ||
URL = f"wss://{SUPABASE_ID}.supabase.co/realtime/v1/websocket?apikey={API_KEY}&vsn=1.0.0" | ||
s = Socket(URL) | ||
s.connect() | ||
|
||
channel = s.set_channel("realtime:public:messages") | ||
channel.join().on("INSERT", derive_facts) | ||
s.listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters