Skip to content

Commit

Permalink
Add a proper homepage and UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
whilo committed Apr 14, 2024
1 parent 4a36a96 commit e40057d
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 76 deletions.
1 change: 1 addition & 0 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
metosin/reitit {:mvn/version "0.7.0-alpha7"}
io.github.nextjournal/markdown {:mvn/version "0.5.148"}
hiccup/hiccup {:mvn/version "2.0.0-RC3"}
org.clj-commons/hickory {:mvn/version "0.7.4"}
ring/ring-jetty-adapter {:mvn/version "1.12.0"}
etaoin/etaoin {:mvn/version "1.0.40"}
missionary/missionary {:mvn/version "b.34"}
Expand Down
6 changes: 3 additions & 3 deletions resources/default_schema.edn
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
{:db/ident :message/text
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :message/url
:db/valueType :db.type/string
:db/cardinality :db.cardinality/many}
{:db/ident :message/link
:db/valueType :db.type/string
:db/cardinality :db.cardinality/many}
Expand All @@ -80,9 +83,6 @@
{:db/ident :conversation/summary
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :conversation/link
:db/valueType :db.type/string
:db/cardinality :db.cardinality/many}
{:db/ident :conversation/message
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}
Expand Down
4 changes: 2 additions & 2 deletions resources/prompts/assistance.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
You are simmie_beta, a chat bot. Answer to the conversation with strong priority to the last message in the conversation history. If you cannot provide much new insight actively ask clarifying questions and try to figure out what the purpose of the conversation is. Ask users explicitly for their goals if they are unclear. You are able to handle different inputs such as voice messages or sent URLs that you automatically retrieve. Be brief and concise but optimistic, imitate the style of the conversation.

You have access to the following external function calls that you must use in each of these cases:
If the user asks for a piece of information that is not available in context conduct a web search to get more information by answering with WEBSEARCH('your search terms'). If you think can derive precise search terms feel free to do preemptive web searches if it will advance the conversation.
If the user asks for a piece of information that is not available in context, including information you offered, you must conduct a web search to get more information by answering with WEBSEARCH('your search terms'). If you think you can derive precise search terms feel free to do preemptive web searches if it will advance the conversation.
If the user wants to imagine or picture an idea, answer with IMAGEGEN('your prompt').
If the user wants to add an issue/todo, answer with ADD_ISSUE('issue title') for each issue and it will be added to the chat as well.
If the user wants to remove an issue/todo, answer with REMOVE_ISSUE('issue title') for each issue and it will be added to the chat as well.
Expand All @@ -16,7 +16,7 @@ When one of the users comes back after more than a few hours, greet them friendl
NEVER reply manually to these requests or merely reply to the command, but *always* use the function calls above!


You can make use of these notes from the chat archive provided in org-mode syntax:
You can make use of these notes from the chat archive provided in Markdown syntax:
=================
%s
=================
Expand Down
2 changes: 1 addition & 1 deletion resources/prompts/note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Title: %s
Body:%s


Given the note above on the subect, update it in light of the following conversation summary and return the new note body only. References to entities (events, places, people, organisations, businesses, academic topics, everyday topics, etc.) are syntactically expressed as Wikipedia style internal links with double brackets, e.g. [[peter][my friend peter]] or [[peter]]. Make sure you retain these references. Be brief and succinct while keeping important facts, focus on the topic of the title *only* and rely on the references for the rest of the context to be provided in these notes. Use Markdown with LaTeX support for formulas. Make full use of Markdown to lay out the note well, but prefer nested lists of bullet points to paragraphs. If you do not want to update the note, write SKIP.
Given the note above on the subect, update it in light of the following conversation summary and return the new note body only. References to entities (events, places, people, organisations, businesses, academic topics, everyday topics, etc.) are syntactically expressed as Wikipedia style internal links with double brackets, e.g. [[peter][my friend peter]] or just [[peter]]. Make sure you retain these references. Be brief and succinct while keeping important facts, focus on the topic of the title *only* and rely on the references for the rest of the context to be provided in these notes. Use Markdown with LaTeX support for formulas. Make full use of Markdown to lay out the note well, but prefer nested lists of bullet points to paragraphs. If you do not want to update the note, write SKIP.

%s

17 changes: 1 addition & 16 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Simmie</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css">
<style>
body, html {
height: 100%;
margin: 0;
}
.full-height {
height: 100%;
}
.content {
color: black;
background-color: white;
padding: 20px;
margin: 20px;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.0/css/bulma.min.css">
</head>
<body>
<section class="hero is-fullheight">
Expand Down
7 changes: 5 additions & 2 deletions src/ie/simm/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
conn)
(catch Exception _
(d/connect cfg)))]
#_(d/transact conn default-schema)
(d/transact conn default-schema)
(swap! peer assoc-in [:conn chat-id] conn)
conn)))

Expand Down Expand Up @@ -47,7 +47,8 @@

(defn msg->txs [message]
(let [{:keys [message_id from chat date text]} message
tags (when text (extract-links text))]
tags (when text (extract-links text))
url (when text (re-find #"https?://\S+" text))]
(vec
(concat
(when from
Expand Down Expand Up @@ -81,6 +82,8 @@
:message/from [:from/id (long (:id from))]
:message/chat [:chat/id (long (:id chat))]
:message/date (java.util.Date. (long (* 1000 date)))}
(when url
{:message/url url})
(when text
{:message/text text})
(when (seq tags)
Expand Down
Loading

0 comments on commit e40057d

Please sign in to comment.