Skip to content

Commit 30a7734

Browse files
authored
Merge pull request #49 from CMU-313/llm-implementation
Llm Implementation
2 parents 20116d2 + 79c36cf commit 30a7734

35 files changed

Lines changed: 828 additions & 3 deletions

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def main():
2+
print("Hello from nodebb-spring-26-tigers!")
3+
4+
5+
if __name__ == "__main__":
6+
main()

public/openapi/components/schemas/PostObject.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ PostObject:
1818
For posts received via ActivityPub, it is the url of the original piece of content.
1919
content:
2020
type: string
21+
isEnglish:
22+
type: boolean
23+
translatedContent:
24+
type: string
2125
sourceContent:
2226
type: string
2327
nullable: true
@@ -182,6 +186,10 @@ PostDataObject:
182186
description: A topic identifier
183187
content:
184188
type: string
189+
isEnglish:
190+
type: boolean
191+
translatedContent:
192+
type: string
185193
timestamp:
186194
type: number
187195
votes:

public/openapi/components/schemas/TopicObject.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ TopicObject:
109109
sourceContent:
110110
type: string
111111
nullable: true
112+
translatedContent:
113+
type: string
114+
nullable: true
112115
timestampISO:
113116
type: string
114117
description: An ISO 8601 formatted date string (complementing `timestamp`)
@@ -146,6 +149,8 @@ TopicObject:
146149
example: "#f44336"
147150
index:
148151
type: number
152+
isEnglish:
153+
type: boolean
149154
nullable: true
150155
tags:
151156
type: array

public/openapi/read/categories.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ get:
8282
type: number
8383
content:
8484
type: string
85+
isEnglish:
86+
type: boolean
87+
translatedContent:
88+
type: string
8589
timestampISO:
8690
type: string
8791
description: An ISO 8601 formatted date string (complementing `timestamp`)
@@ -142,6 +146,10 @@ get:
142146
type: number
143147
content:
144148
type: string
149+
isEnglish:
150+
type: boolean
151+
translatedContent:
152+
type: string
145153
sourceContent:
146154
type: string
147155
nullable: true

public/openapi/read/index.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ get:
7777
type: number
7878
content:
7979
type: string
80+
isEnglish:
81+
type: boolean
82+
translatedContent:
83+
type: string
8084
timestampISO:
8185
type: string
8286
description: An ISO 8601 formatted date string (complementing `timestamp`)
@@ -144,6 +148,10 @@ get:
144148
type: number
145149
content:
146150
type: string
151+
isEnglish:
152+
type: boolean
153+
translatedContent:
154+
type: string
147155
sourceContent:
148156
type: string
149157
nullable: true

public/openapi/read/unread.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ get:
143143
sourceContent:
144144
type: string
145145
nullable: true
146+
translatedContent:
147+
type: string
148+
nullable: true
146149
timestampISO:
147150
type: string
148151
description: An ISO 8601 formatted date string (complementing `timestamp`)
@@ -180,6 +183,8 @@ get:
180183
example: "#f44336"
181184
index:
182185
type: number
186+
isEnglish:
187+
type: boolean
183188
tags:
184189
type: array
185190
items:

public/openapi/write/posts/pid.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ get:
3535
description: A topic identifier
3636
content:
3737
type: string
38+
isEnglish:
39+
type: boolean
40+
translatedContent:
41+
type: string
3842
timestamp:
3943
type: number
4044
flagId:

public/src/client/topic.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,28 @@ define('forum/topic', [
7272
addCrosspostsHandler();
7373

7474
$(window).on('scroll', utils.debounce(updateTopicTitle, 250));
75+
configurePostToggle();
7576

7677
handleTopicSearch();
7778

7879
hooks.fire('action:topic.loaded', ajaxify.data);
7980
};
8081

82+
function configurePostToggle() {
83+
$('.topic').on('click', '.view-translated-btn', function () {
84+
// Toggle the visibility of the next .translated-content div
85+
$(this).closest('.sensitive-content-message').next('.translated-content').toggle();
86+
// Optionally, change the button text based on visibility
87+
var isVisible = $(this).closest('.sensitive-content-message').next('.translated-content').is(':visible');
88+
if (isVisible) {
89+
$(this).text('Hide the translated message.');
90+
} else {
91+
$(this).text('Click here to view the translated message.');
92+
}
93+
});
94+
}
95+
96+
8197
function handleTopicSearch() {
8298
require(['mousetrap'], (mousetrap) => {
8399
if (config.topicSearchEnabled) {

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[project]
2+
name = "nodebb-spring-26-tigers"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.11"
7+
dependencies = []

0 commit comments

Comments
 (0)