Skip to content

Commit 56e9a40

Browse files
committed
finalizing 0.0.3
1 parent e98864b commit 56e9a40

File tree

13 files changed

+1052
-92
lines changed

13 files changed

+1052
-92
lines changed

buildflet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
flet build macos --build-version '0.0.2' --copyright 'Viswa Kumar 2024 ©' --project 'PyOllaMx' --company 'PyOllaMx'
2+
flet build macos --build-version '0.0.3' --copyright 'Viswa Kumar 2024 ©' --project 'PyOllaMx' --company 'PyOllaMx' --description 'Your Gateway to both Ollama & Apple MlX'

history.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,19 @@
6767

6868
history_data_view = ft.Container(content=history_mock_data)
6969

70+
coming_soon_view = ft.Column([
71+
ft.Text(value='Coming Soon!', style=ft.TextStyle(font_family='CabinSketch-Bold'), size=50)
72+
], alignment=ft.MainAxisAlignment.CENTER, horizontal_alignment=ft.CrossAxisAlignment.CENTER)
73+
74+
7075
def historyView(theme: str) -> ft.View:
7176

7277
return ft.View(
7378
"/history",
7479
controls = [
7580
ft.AppBar(title=""),
7681
history_banner_view,
77-
history_data_view
82+
coming_soon_view,
83+
#history_data_view
7884
]
7985
)

main.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def main(page: ft.Page) -> None:
1313
page.title = 'PyOllaMx'
14-
page.theme_mode = 'dark'
14+
page.theme_mode = 'light'
1515
page.scroll = ft.ScrollMode.ADAPTIVE
1616
#page.bgcolor = '#C7F9D6'
1717
page.window_resizable = False
@@ -37,7 +37,7 @@ def main(page: ft.Page) -> None:
3737
height=75,
3838
fit=ft.ImageFit.CONTAIN,
3939
)
40-
banner_text = ft.Text(value='pyOllaMx', style=ft.TextStyle(font_family='CabinSketch-Bold'), size=30)
40+
banner_text = ft.Text(value='PyOllaMx', style=ft.TextStyle(font_family='CabinSketch-Bold'), size=30)
4141
subbanner_text = ft.Text(value='Your gateway to both Ollama & Apple MlX models')
4242
chat_messages = ft.Column(
4343
alignment=ft.MainAxisAlignment.CENTER,
@@ -78,8 +78,8 @@ def main(page: ft.Page) -> None:
7878
user_text_field = ft.TextField(multiline=True,
7979
width=675, autofocus=True, label='Enter your prompt')
8080
user_text_field.border_color = 'white' if page.theme_mode == 'dark' else 'black'
81-
send_button = ft.ElevatedButton("Send", icon=ft.icons.ROCKET_LAUNCH)
82-
clear_button = ft.ElevatedButton("chats", icon=ft.icons.DELETE_FOREVER, icon_color="pink600")
81+
send_button = ft.ElevatedButton("Send", icon=ft.icons.ROCKET_LAUNCH, tooltip='Select a model in the settings menu & type in a prompt to enable this control')
82+
clear_button = ft.ElevatedButton("chats", icon=ft.icons.DELETE_FOREVER, icon_color="pink600", tooltip='Atleast one response from AI should be available to delete this conversation')
8383
pr = ft.ProgressRing(width=16, height=16, stroke_width=2)
8484
pr.value = 0
8585
pr_ph = ft.Text()
@@ -229,14 +229,14 @@ def showModelSettings(e: ControlEvent) -> None:
229229
def toggleTheme(e: ControlEvent) -> None:
230230
icon : ft.IconButton = e.control
231231
if icon.icon == ft.icons.DARK_MODE_SHARP:
232-
page.theme_mode = "light"
233-
icon.icon = ft.icons.DARK_MODE_OUTLINED
234-
user_text_field.border_color = 'black'
232+
page.theme_mode = "dark"
233+
icon.icon = ft.icons.SUNNY
234+
user_text_field.border_color = 'white'
235235
else:
236236
#icon.icon == ft.icons.DARK_MODE_OUTLINED
237-
page.theme_mode = "dark"
237+
page.theme_mode = "light"
238238
icon.icon = ft.icons.DARK_MODE_SHARP
239-
user_text_field.border_color = 'white'
239+
user_text_field.border_color = 'dark'
240240
page.update()
241241

242242
def view_pop(view):
@@ -297,7 +297,7 @@ def showHistory(e: ControlEvent):
297297
ft.IconButton(ft.icons.DARK_MODE_SHARP, on_click=toggleTheme, tooltip='Toggle Dark Mode'),
298298
ft.IconButton(ft.icons.INSTALL_DESKTOP, on_click=showModelHub, tooltip='Download Models'),
299299
ft.IconButton(ft.icons.HISTORY, on_click=showHistory, tooltip='Conversation History'),
300-
ft.PopupMenuButton()
300+
#ft.PopupMenuButton()
301301
], alignment="spacearound"),
302302
], alignment="spacebetween")
303303

mlxClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def chat(self, prompt:str, model: str, temp: float, system:str = 'default') -> s
2121
data = {'model': model, 'prompt': prompt, 'temp' : temp}
2222
try:
2323
response = requests.post(self.llmHost, data=json.dumps(data), headers={'Content-Type': 'application/json'})
24-
# print(f'response code {response.status_code}')
24+
print(f'response code {response.status_code}')
2525
if response.status_code != 200:
2626
raise requests.ConnectionError
2727
except Exception as e:

model_hub.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
settings_banner_text
1313
], alignment=ft.MainAxisAlignment.CENTER, vertical_alignment=ft.CrossAxisAlignment.CENTER)
1414

15+
coming_soon_view = ft.Column([
16+
ft.Text(value='Coming Soon!', style=ft.TextStyle(font_family='CabinSketch-Bold'), size=50)
17+
], alignment=ft.MainAxisAlignment.CENTER, horizontal_alignment=ft.CrossAxisAlignment.CENTER)
18+
1519
ollama_download_text = ft.Text('Download Ollama Model from ollama.ai')
1620
ollama_download_textField = ft.TextField(width=500, height=50)
1721
ollama_download_button = ft.IconButton(ft.icons.DOWNLOAD)
@@ -68,6 +72,7 @@ def modelHubView(theme: str) -> ft.View:
6872
controls = [
6973
ft.AppBar(title=""),
7074
settings_banner_view,
71-
model_tabs
75+
coming_soon_view,
76+
#model_tabs
7277
]
7378
)

ollama/__init__.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from ollama._client import Client, AsyncClient
2+
from ollama._types import (
3+
GenerateResponse,
4+
ChatResponse,
5+
ProgressResponse,
6+
Message,
7+
Options,
8+
RequestError,
9+
ResponseError,
10+
)
11+
12+
__all__ = [
13+
'Client',
14+
'AsyncClient',
15+
'GenerateResponse',
16+
'ChatResponse',
17+
'ProgressResponse',
18+
'Message',
19+
'Options',
20+
'RequestError',
21+
'ResponseError',
22+
'generate',
23+
'chat',
24+
'embeddings',
25+
'pull',
26+
'push',
27+
'create',
28+
'delete',
29+
'list',
30+
'copy',
31+
'show',
32+
]
33+
34+
_client = Client()
35+
36+
generate = _client.generate
37+
chat = _client.chat
38+
embeddings = _client.embeddings
39+
pull = _client.pull
40+
push = _client.push
41+
create = _client.create
42+
delete = _client.delete
43+
list = _client.list
44+
copy = _client.copy
45+
show = _client.show

0 commit comments

Comments
 (0)