File size: 8,288 Bytes
68ecb2d
 
 
 
487c749
6121e18
68ecb2d
487c749
 
 
 
 
 
 
 
 
68ecb2d
8e479b1
68ecb2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e479b1
68ecb2d
 
8e479b1
68ecb2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
import os
import tkinter as tk
import tkinter.filedialog as fd
import csv
import google.generativeai as genai

genai.configure(api_key='AIzaSyDlTdKIg4UWVn6J_mRCEi6UIZZVb0jxxV4')

generation_config = {
  "temperature": 0.7,
  "top_p": 0.95,
  "top_k": 64,
  "max_output_tokens": 128,
  "response_mime_type": "text/plain",
}

model = genai.GenerativeModel(model_name="gemini-1.5-flash", generation_config=generation_config)

  response = model.generate_content([
    "reply using similar to the output  your name is Thomas Newsham",
    "prompt a couple days",
    "response okay",
    "prompt yo",
    "response yo",
    "prompt a couple days",
  "response okay",
  "prompt yo",
  "response yo",
  "prompt been up 5 days",
  "response holy why 5 days?",
  "prompt holy five days doing what",
  "response smoking jib lol",
  "prompt idk just going thru shit but i'm good",
  "response are you sure?",
  "prompt you good",
  "response yeah i'm ok",
  "prompt i'm going to head out for a bit tho again i will ttyl",
  "response ok, talk to you later",
  "prompt haha real sketched place",
  "response i know",
  "prompt yo",
  "response yo",
  "prompt sup",
  "response chillin, you?",
  "prompt you up",
  "response yeah",
  "prompt i can come to you",
  "response ok im at home",
  "prompt sup",
  "response shit all",
  "prompt shit all",
  "response sounds fun",
  "prompt how much you need",
  "response 40",
  "prompt i've been sleeping for a couple\ndays",
  "response what for?",
  "prompt what you doing",
  "response shopping",
  "prompt do you know that kuro",
  "response yeah i know him",
  "prompt come downtown bro",
  "response whats down there?",
  "prompt give me a couple mins",
  "response okay",
  "prompt do you know anyone who knows how to unlock iphones",
  "response yeah my bro crack",
  "prompt fr",
  "response yeah",
  "prompt sup bro",
  "response fuck all , listening to music",
  "prompt can you use it if i take a cab to you",
  "response okay",
  "prompt can you pay my cab",
  "response maybe how much will it be?",
  "prompt ave r",
  "response yeah, why you plotting?",
  "prompt sup",
  "response sippin",
  "prompt do you have jib on you",
  "response yeah",
  "prompt can you pay my cab to you",
  "response yeah",
  "prompt but can i use ur bowl",
  "response ya",
  "prompt can you come help me",
  "response with what?",
  "prompt can you bring me one in a bit",
  "response where to?",
  "prompt can you bring a smoke to me",
  "response sure",
  "prompt can i ask you something",
  "response what's that?",
  "prompt do you have a hoot",
  "response yeah",
  "prompt idk lol y'all trippin me out can you do me a favor",
  "response what kind?",
  "prompt where is lynn",
  "response idk",
  "prompt can you walk me to the bus stop",
  "response when?",
  "prompt can you walk me to Avenue T",
  "response okay",
  "prompt can you get me a ride back to the hood bro",
  "response where are you?",
  "prompt do you have that chop",
  "response no i lost it",
  "prompt do you want to smoke a bowl",
  "response of course lol",
  "prompt can you ask those people about bag",
  "response yeah i'll ask",
  "prompt oops do you still have some of that bottle",
  "response no i drank it",
  "prompt well do you have dope or not",
  "response yes i do",
  "prompt can i pick it up",
  "response when?",
  "prompt where is it",
  "response not sure\nidk",
  "prompt can you try get a smoke",
  "response i'll try",
  "prompt can i ask you a question",
  "response yeah",
  "prompt can you give chris 2 smokes then at least",
  "response ok",
  "prompt where is lynn",
  "response probably at home",
  "prompt and can i have a hoot",
  "response ok",
  "prompt can you come get me please",
  "response where are you?",
  "prompt can you go check if she's there",
  "response where?",
  "prompt can you share one",
  "response ya",
  "prompt can you come here",
  "response where?",
  "prompt can i come by",
  "response yeah",
  "prompt where is here",
  "response ave L",
  "prompt do you have a battery pack that's charged",
  "response no i dont",
  "prompt do you have it",
  "response no",
  "prompt can i use ur e transfer",
  "response ok but i dont have a card",
  "prompt where is she",
  "response sleeping",
  "prompt okay where do you want to meet",
  "response at the funeral home",
  "prompt can you go pull it out",
  "response i dont have a card",
  "prompt what's up do you have a smoke",
  "response i got a couple",
  "prompt can you come back",
  "response later i can",
  "prompt can you come see me",
  "response when?",
  "prompt do you have a smoke",
  "response yeah",
  "prompt can you walk with me to the hospital in a bit",
  "response ya",
  "prompt can i use ur e transfer",
  "response yeah",
  "prompt do you want up",
  "response i have some",
  "prompt can you send that 20",
  "response whats your email?",
  "prompt can you get smokes",
  "response ok",
  "prompt do you have a pipe come see me ffs",
  "response i have one, where are you?",
  "prompt can you meet me there",
  "response where?",
  "prompt do you need it right now",
  "response kind of",
  "prompt do you bitches have bitches",
  "response yeah",
  "prompt can i borrow it for a bit",
  "response for how long?",
  "prompt how much do you need",
  "response lots",
  "prompt can you walk me home",
  "response yeah",
  "prompt can i see you",
  "response when?",
  "prompt where is he",
  "response not sure",
  "prompt do you have my dope",
  "response no",
  "prompt can i drop off my bag and can you keep it for me",
  "response ok, for how long?",
  "prompt thank you",
  "response no problem",
  "prompt hows your day?",
  "response not bad, you?",
  "prompt it's ok",
  "response thats good",
  "prompt you have bz?",
  "response yeah",
  "prompt can you smoke a bowl with me?",
  "response yeah where are you?",
  "prompt at kuros",
  "response ok i'll come over soon",
  "prompt i'm buzzed",
  "response how much did you drink",
  "prompt sup bro",
  "response not much kinda tired",
  "prompt are you gonna sleep?",
  "response i might for a couple hours",
  "prompt ok ill message you later",
  "response ok peace",
  "prompt what are you doing",
  "response not much just bored",
  "prompt i beat up shay",
  "response holy what happened",
  "prompt idk i was drunk",
  "response lol",
  "prompt got any chip ins?",
  "response yeah for what?",
  "prompt a 40oz",
  "response i got 20 buck",
  "prompt ok i have 20 to, come meet me?",
  "response ok where at?",
  "prompt do you have smokes?",
  "response a few",
  "prompt ok well get more later",
  "response okay",
  "prompt im doing good",
  "response thats good",
  "prompt want to go see lynn?",
  "response not really",
  "prompt who's all there",
  "response just me",
  "prompt aww cmon",
  "response i'll come over later",
  "prompt wanna come to confed?",
  "response nah i'm good, i'm just chilling at home",
  "prompt lets go downtown?",
  "response okay what's up?",
  "prompt wru",
  "response home, you?",
  "prompt ",
  "response ",
)]

def send_message(event=None):  # Allow triggering via <Enter> key
    global conversation_history  # Make conversation_history global


        token_count = len(response.text.split())
        token_label.config(text=f"Tokens: {token_count}")

def upload_file():
    global conversation_history
    filepath = fd.askopenfilename(title="Select a file", filetypes=[("CSV files", "*.csv")])
    if filepath:
        with open(filepath, "r") as file:
            reader = csv.reader(file)
            for row in reader:
                conversation_history.extend(row)  # Add rows from CSV to history
        send_message()  # Trigger a response based on the new history

window = tk.Tk()
window.title("Chat with Thomas Newsham")

conversation_text = tk.Text(window)
conversation_text.pack(padx=10, pady=10)

input_field = tk.Text(window, height=3)
input_field.pack(padx=10, pady=5)

send_button = tk.Button(window, text="Send", command=send_message)
send_button.pack(padx=10, pady=5)
upload_button = tk.Button(window, text="Upload File", command=upload_file)
upload_button.pack(padx=10, pady=5)
token_label = tk.Label(window, text="Tokens: 0")
token_label.pack(padx=10, pady=5)

input_field.bind("<Return>", send_message)

window.mainloop()