FunctionGUI 0.6.3__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,12 @@ from ttkbootstrap import Style
5
5
  from tkinter import font as tkfont
6
6
  from PIL import Image, ImageTk
7
7
  from tkinter import filedialog
8
-
9
-
8
+ import requests
9
+ from io import BytesIO
10
+ import csv
11
+ import sys
12
+ from tkinterdnd2 import TkinterDnD, DND_FILES
13
+ from tkinter import messagebox
10
14
  def Window():
11
15
  root = tk.Tk()
12
16
  return root
@@ -14,6 +18,10 @@ def Window():
14
18
  def Title(root, title = "New Window"):
15
19
  a = root.title(title)
16
20
  return a
21
+ def Dropdown(parent, textvariable, values):
22
+ dropdown = ttk.Combobox(parent, textvariable=textvariable, values=values)
23
+ return dropdown
24
+
17
25
 
18
26
  def ScrollBar(root, widget, side="right", fill="y"):
19
27
  a = widget
@@ -21,8 +29,24 @@ def ScrollBar(root, widget, side="right", fill="y"):
21
29
  scrollbar.pack(side=side, fill=fill)
22
30
  a.config(yscrollcommand=scrollbar.set)
23
31
 
24
- def Label(parent, textvariabl, text="Default Text", font="Helvetica", size=12, color="black", wraplenght=2):
25
- label = ttk.Label(parent, text=text, font = (font, size), foreground = color, wraplength=wraplenght, textvariable=textvariabl)
32
+
33
+
34
+ def DragDropArea(parent, text="Drag and Drop here!", width=40, height=10, padx=20, pady=20):
35
+ label = tk.Label(parent, text=text, width=width, height=height, relief="solid")
36
+ label.pack(padx=padx, pady=pady)
37
+
38
+ def on_drop(event):
39
+ dropped_file = event.data
40
+ messagebox.showinfo("File Dropped", f"You dropped the file: {dropped_file}")
41
+
42
+ label.drop_target_register(DND_FILES)
43
+ label.dnd_bind('<<Drop>>', on_drop)
44
+
45
+ return label
46
+
47
+
48
+ def Label(parent, textvariabl, text=None, font="Helvetica", size=12, color="black", wraplenght=2, width=50):
49
+ label = ttk.Label(parent, text=text, font = (font, size), foreground = color, wraplength=wraplenght, textvariable=textvariabl, width=width)
26
50
  return label
27
51
 
28
52
 
@@ -36,10 +60,19 @@ def Font(name = 'arial', size = 20, weight = "bold"):
36
60
  def StrVar(master, string):
37
61
  v = tk.StringVar(master, string)
38
62
  return v
39
-
40
63
  def OpenFile(title):
41
64
  file_path = filedialog.askopenfilename(title="Select a file")
42
65
  return file_path
66
+
67
+ def SaveFile(title):
68
+ file_save = filedialog.asksaveasfilename(
69
+ title=title,
70
+ defaultextension=".txt",
71
+ filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")]
72
+ )
73
+ return file_save
74
+
75
+
43
76
  def ChexBox(parent, text = 'check me', variable=None, command = None):
44
77
  checkbutton = ttk.Checkbutton(parent, text=text, variable=variable, command=command)
45
78
 
@@ -66,6 +99,40 @@ def Button(parent, text="Button", command=None, font="Helvetica", size=12, bg="b
66
99
  def Entry(parent, width=20, font="Helvetica", size=12, bg="white", fg="black"):
67
100
  entry = ttk.Entry(parent, width=width, font=(font, size), background=bg, foreground=fg)
68
101
  return entry
102
+ def CVSREAD(filename):
103
+ with open(filename, newline='') as f:
104
+ reader = csv.reader(f)
105
+ return reader
106
+
107
+ def CVSWRITE(filename, data):
108
+ with open(filename, 'w', newline='') as f:
109
+ writer = csv.writer(f)
110
+ writer.writerows(data)
111
+
112
+ def Image(parent, path_or_url, width=None, height=None):
113
+ try:
114
+ # Load image from URL or file
115
+ if path_or_url.startswith('http'):
116
+ response = requests.get(path_or_url)
117
+ img_data = BytesIO(response.content)
118
+ else:
119
+ img_data = path_or_url
120
+
121
+ img = Image.open(img_data)
122
+
123
+ # Resize if needed
124
+ if width and height:
125
+ img = img.resize((width, height))
126
+
127
+ tk_img = ImageTk.PhotoImage(img)
128
+
129
+ label = tk.Label(parent, image=tk_img)
130
+ label.image = tk_img # Keep a reference to prevent garbage collection
131
+ label.pack()
132
+ return label
133
+ except Exception as e:
134
+ print("Error loading image:", e)
135
+ return None
69
136
 
70
137
  def GetEntry(entry):
71
138
  d = entry.get()
@@ -94,13 +161,14 @@ def BGImage(parent, bg_image_path = '', width=400 , height=300):
94
161
 
95
162
  def Button(parent, text="Button", command=None, font="Helvetica", size=12, bg="black", fg="black", width=20, height=20, padx = 10, pady = 10):
96
163
  button = tk.Button(parent, text=text, command=command, font=(font, size), bg=bg, fg=fg, width=width, height=height)
97
- button.pack(padx=padx, pady=pady)
98
164
  return button
99
165
 
100
166
  def Entry(parent, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10):
101
167
  entry = ttk.Entry(parent, width=width, font=(font, size), background=bg, foreground=fg)
102
- entry.pack(padx=padx, pady=pady)
103
168
  return entry
104
-
169
+ def Close(window):
170
+ window.destroy()
171
+ def Exit():
172
+ sys.exit()
105
173
  def Run(window):
106
174
  window.mainloop()
@@ -16,6 +16,15 @@ from .FunctionGUI import (
16
16
  add,
17
17
  Design,
18
18
  ScrollBar,
19
- StrVar
19
+ StrVar,
20
+ CVSREAD,
21
+ CVSWRITE,
22
+ Close,
23
+ Image,
24
+ Exit,
25
+ OpenFile,
26
+ SaveFile,
27
+ Dropdown,
28
+ DragDropArea
20
29
 
21
30
  )
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: FunctionGUI
3
+ Version: 0.7.0
4
+ Summary: A simple Tkinter GUI library with basic widgets and functionality.
5
+ Home-page: https://github.com/aa425/FunctionGUI
6
+ Author: Aaroh Charne
7
+ Author-email: aaroh.charne@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: Pillow
18
+ Requires-Dist: ttkbootstrap
19
+ Requires-Dist: tkinterdnd2
20
+ Requires-Dist: requests
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ # FunctionGUI
32
+
33
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
34
+
35
+ ## Installation
36
+
37
+ To install FunctionGUI, you can simply use pip:
38
+
39
+ ```bash
40
+ pip install functiongui
41
+ ```
42
+
43
+
44
+ # FunctionGUI
45
+
46
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
47
+
48
+
49
+
50
+ ## Usage
51
+ ```python
52
+ import functiongui as fg
53
+
54
+ # Create the main window
55
+ root = fg.Window()
56
+
57
+ # Set the title
58
+ fg.Title(root, "FunctionGUI Example")
59
+
60
+ # Set design/theme
61
+ theme = fg.Design("cosmo") # Uses ttkbootstrap
62
+
63
+ # Background Image
64
+ fg.BGImage(root, bg_image_path='your_image_path.jpg', width=500, height=400)
65
+
66
+ # BooleanVar for checkbox
67
+ check_var = fg.BulleanVar()
68
+
69
+ # Entry field
70
+ entry = fg.Entry(root, width=30, font="Helvetica", size=12, bg="white", fg="black", padx=5, pady=5)
71
+ fg.Place(entry)
72
+
73
+ # Button to print the entry value
74
+ def on_button_click():
75
+ value = fg.GetEntry(entry)
76
+ print("Entry value:", value)
77
+
78
+ button = fg.Button(root, text="Print Entry", command=on_button_click, font="Helvetica", size=12, bg="green", fg="white", width=20, height=2)
79
+ fg.Place(button, x=50, y=80)
80
+
81
+ # Label with StringVar
82
+ strvar = fg.StrVar(root, "Initial Text")
83
+ label = fg.Label(root, textvariabl=strvar, font="Arial", size=14, color="blue", wraplenght=200, width=30)
84
+ fg.Place(label)
85
+
86
+ # CheckBox
87
+ fg.ChexBox(root, text="Check me!", variable=check_var, command=lambda: print("Checkbox state:", check_var.get()))
88
+
89
+ # Dropdown
90
+ drop_var = fg.StrVar(root, "Option 1")
91
+ dropdown = fg.Dropdown(root, textvariable=drop_var, values=["Option 1", "Option 2", "Option 3"])
92
+ fg.Place(dropdown)
93
+
94
+ # Image display from file
95
+ fg.Image(root, "your_image_path.jpg", width=150, height=100)
96
+
97
+ # CSV functions (you can test separately)
98
+ fg.CVSWRITE("data.csv", [["Name", "Age"], ["Alice", 30]])
99
+ data = fg.CVSREAD("data.csv")
100
+ for row in data:
101
+ print(row)
102
+
103
+ # File dialogs
104
+ open_path = fg.OpenFile("Choose a file")
105
+ save_path = fg.SaveFile("Save your file")
106
+
107
+ # Drag and Drop area
108
+ drag_and_drop = fg.DragDropArea(root)
109
+
110
+ # Scrollable widget demo
111
+ text_widget = tk.Text(root, height=5, width=40)
112
+ fg.ScrollBar(root, text_widget)
113
+ text_widget.pack()
114
+
115
+ # Exit & Close examples (uncomment if needed)
116
+ fg.Exit()
117
+
118
+ # close a window
119
+ fg.Close(root)
120
+
121
+ # Start the GUI loop
122
+ fg.Run(root)
123
+
124
+ ```
125
+
126
+ ## Bugs
127
+
128
+ If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
129
+ Please include a snippet of your code as well the problem. Thank You
130
+
131
+ ## Please check out my other Library Calclab @https://pypi.org/project/Calclab/
132
+ ```
@@ -0,0 +1,4 @@
1
+ Pillow
2
+ ttkbootstrap
3
+ tkinterdnd2
4
+ requests
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: FunctionGUI
3
+ Version: 0.7.0
4
+ Summary: A simple Tkinter GUI library with basic widgets and functionality.
5
+ Home-page: https://github.com/aa425/FunctionGUI
6
+ Author: Aaroh Charne
7
+ Author-email: aaroh.charne@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: Pillow
18
+ Requires-Dist: ttkbootstrap
19
+ Requires-Dist: tkinterdnd2
20
+ Requires-Dist: requests
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ # FunctionGUI
32
+
33
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
34
+
35
+ ## Installation
36
+
37
+ To install FunctionGUI, you can simply use pip:
38
+
39
+ ```bash
40
+ pip install functiongui
41
+ ```
42
+
43
+
44
+ # FunctionGUI
45
+
46
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
47
+
48
+
49
+
50
+ ## Usage
51
+ ```python
52
+ import functiongui as fg
53
+
54
+ # Create the main window
55
+ root = fg.Window()
56
+
57
+ # Set the title
58
+ fg.Title(root, "FunctionGUI Example")
59
+
60
+ # Set design/theme
61
+ theme = fg.Design("cosmo") # Uses ttkbootstrap
62
+
63
+ # Background Image
64
+ fg.BGImage(root, bg_image_path='your_image_path.jpg', width=500, height=400)
65
+
66
+ # BooleanVar for checkbox
67
+ check_var = fg.BulleanVar()
68
+
69
+ # Entry field
70
+ entry = fg.Entry(root, width=30, font="Helvetica", size=12, bg="white", fg="black", padx=5, pady=5)
71
+ fg.Place(entry)
72
+
73
+ # Button to print the entry value
74
+ def on_button_click():
75
+ value = fg.GetEntry(entry)
76
+ print("Entry value:", value)
77
+
78
+ button = fg.Button(root, text="Print Entry", command=on_button_click, font="Helvetica", size=12, bg="green", fg="white", width=20, height=2)
79
+ fg.Place(button, x=50, y=80)
80
+
81
+ # Label with StringVar
82
+ strvar = fg.StrVar(root, "Initial Text")
83
+ label = fg.Label(root, textvariabl=strvar, font="Arial", size=14, color="blue", wraplenght=200, width=30)
84
+ fg.Place(label)
85
+
86
+ # CheckBox
87
+ fg.ChexBox(root, text="Check me!", variable=check_var, command=lambda: print("Checkbox state:", check_var.get()))
88
+
89
+ # Dropdown
90
+ drop_var = fg.StrVar(root, "Option 1")
91
+ dropdown = fg.Dropdown(root, textvariable=drop_var, values=["Option 1", "Option 2", "Option 3"])
92
+ fg.Place(dropdown)
93
+
94
+ # Image display from file
95
+ fg.Image(root, "your_image_path.jpg", width=150, height=100)
96
+
97
+ # CSV functions (you can test separately)
98
+ fg.CVSWRITE("data.csv", [["Name", "Age"], ["Alice", 30]])
99
+ data = fg.CVSREAD("data.csv")
100
+ for row in data:
101
+ print(row)
102
+
103
+ # File dialogs
104
+ open_path = fg.OpenFile("Choose a file")
105
+ save_path = fg.SaveFile("Save your file")
106
+
107
+ # Drag and Drop area
108
+ drag_and_drop = fg.DragDropArea(root)
109
+
110
+ # Scrollable widget demo
111
+ text_widget = tk.Text(root, height=5, width=40)
112
+ fg.ScrollBar(root, text_widget)
113
+ text_widget.pack()
114
+
115
+ # Exit & Close examples (uncomment if needed)
116
+ fg.Exit()
117
+
118
+ # close a window
119
+ fg.Close(root)
120
+
121
+ # Start the GUI loop
122
+ fg.Run(root)
123
+
124
+ ```
125
+
126
+ ## Bugs
127
+
128
+ If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
129
+ Please include a snippet of your code as well the problem. Thank You
130
+
131
+ ## Please check out my other Library Calclab @https://pypi.org/project/Calclab/
132
+ ```
@@ -0,0 +1,102 @@
1
+ # FunctionGUI
2
+
3
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
4
+
5
+ ## Installation
6
+
7
+ To install FunctionGUI, you can simply use pip:
8
+
9
+ ```bash
10
+ pip install functiongui
11
+ ```
12
+
13
+
14
+ # FunctionGUI
15
+
16
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
17
+
18
+
19
+
20
+ ## Usage
21
+ ```python
22
+ import functiongui as fg
23
+
24
+ # Create the main window
25
+ root = fg.Window()
26
+
27
+ # Set the title
28
+ fg.Title(root, "FunctionGUI Example")
29
+
30
+ # Set design/theme
31
+ theme = fg.Design("cosmo") # Uses ttkbootstrap
32
+
33
+ # Background Image
34
+ fg.BGImage(root, bg_image_path='your_image_path.jpg', width=500, height=400)
35
+
36
+ # BooleanVar for checkbox
37
+ check_var = fg.BulleanVar()
38
+
39
+ # Entry field
40
+ entry = fg.Entry(root, width=30, font="Helvetica", size=12, bg="white", fg="black", padx=5, pady=5)
41
+ fg.Place(entry)
42
+
43
+ # Button to print the entry value
44
+ def on_button_click():
45
+ value = fg.GetEntry(entry)
46
+ print("Entry value:", value)
47
+
48
+ button = fg.Button(root, text="Print Entry", command=on_button_click, font="Helvetica", size=12, bg="green", fg="white", width=20, height=2)
49
+ fg.Place(button, x=50, y=80)
50
+
51
+ # Label with StringVar
52
+ strvar = fg.StrVar(root, "Initial Text")
53
+ label = fg.Label(root, textvariabl=strvar, font="Arial", size=14, color="blue", wraplenght=200, width=30)
54
+ fg.Place(label)
55
+
56
+ # CheckBox
57
+ fg.ChexBox(root, text="Check me!", variable=check_var, command=lambda: print("Checkbox state:", check_var.get()))
58
+
59
+ # Dropdown
60
+ drop_var = fg.StrVar(root, "Option 1")
61
+ dropdown = fg.Dropdown(root, textvariable=drop_var, values=["Option 1", "Option 2", "Option 3"])
62
+ fg.Place(dropdown)
63
+
64
+ # Image display from file
65
+ fg.Image(root, "your_image_path.jpg", width=150, height=100)
66
+
67
+ # CSV functions (you can test separately)
68
+ fg.CVSWRITE("data.csv", [["Name", "Age"], ["Alice", 30]])
69
+ data = fg.CVSREAD("data.csv")
70
+ for row in data:
71
+ print(row)
72
+
73
+ # File dialogs
74
+ open_path = fg.OpenFile("Choose a file")
75
+ save_path = fg.SaveFile("Save your file")
76
+
77
+ # Drag and Drop area
78
+ drag_and_drop = fg.DragDropArea(root)
79
+
80
+ # Scrollable widget demo
81
+ text_widget = tk.Text(root, height=5, width=40)
82
+ fg.ScrollBar(root, text_widget)
83
+ text_widget.pack()
84
+
85
+ # Exit & Close examples (uncomment if needed)
86
+ fg.Exit()
87
+
88
+ # close a window
89
+ fg.Close(root)
90
+
91
+ # Start the GUI loop
92
+ fg.Run(root)
93
+
94
+ ```
95
+
96
+ ## Bugs
97
+
98
+ If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
99
+ Please include a snippet of your code as well the problem. Thank You
100
+
101
+ ## Please check out my other Library Calclab @https://pypi.org/project/Calclab/
102
+ ```
@@ -2,9 +2,9 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='FunctionGUI', # Replace with your library name
5
- version='0.6.3', # Start with an initial version
5
+ version='0.7.0', # Start with an initial version
6
6
  description='A simple Tkinter GUI library with basic widgets and functionality.',
7
- long_description=open('README.md').read(), # Make sure you have a README.md file
7
+ long_description=open(r'C:\Users\priti\OneDrive\Desktop\FunctionGUI\README.md').read(), # Make sure you have a README.md file
8
8
  long_description_content_type='text/markdown',
9
9
  author='Aaroh Charne', # Replace with your name
10
10
  author_email='aaroh.charne@gmail.com', # Replace with your email
@@ -12,7 +12,10 @@ setup(
12
12
  packages=find_packages(), # Automatically find packages in the directory
13
13
  install_requires=[
14
14
  'Pillow',
15
- 'ttkbootstrap'
15
+ 'ttkbootstrap',
16
+ "tkinterdnd2",
17
+ "requests",
18
+
16
19
  ],
17
20
  classifiers=[
18
21
 
@@ -1,53 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: FunctionGUI
3
- Version: 0.6.3
4
- Summary: A simple Tkinter GUI library with basic widgets and functionality.
5
- Home-page: https://github.com/aa425/FunctionGUI
6
- Author: Aaroh Charne
7
- Author-email: aaroh.charne@gmail.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Natural Language :: English
14
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
- Requires-Python: >=3.6
16
- Description-Content-Type: text/markdown
17
-
18
- ## Sentience
19
-
20
- Sentience is a basic AI library made to simplify the usage of the genai library by providing basic functions for chat at a higher level.
21
-
22
-
23
- ## Installation
24
-
25
- To install Sentience, you can simply use:
26
-
27
- ```bash
28
- pip install Sentience
29
- ```
30
-
31
- ## Usage
32
- ```python
33
- #Set your api (does not return in a variable)
34
- API(your_api_key)
35
- #Make the model, settings can be altered (returns the model in a variable), code example provides default settings
36
- model = Model(model = "gemini-1.5-pro", temperature = 1, top_p = 0.95, top_k = 40, max_output_tokens = 8192)
37
-
38
- #Uses model created above to make a chat (returns chat in a variable)
39
- chat = Chat(model)
40
-
41
- #Sends a message to your chat, replace chat with the varible you have named your chat
42
- response = Send(chat, "Hello, how are you?")
43
-
44
- print(response)
45
- ```
46
-
47
- # Bugs
48
-
49
- If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
50
- Please include a snippet of your code as well the problem. Thank You
51
-
52
-
53
- ```
@@ -1,2 +0,0 @@
1
- Pillow
2
- ttkbootstrap
@@ -1,53 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: FunctionGUI
3
- Version: 0.6.3
4
- Summary: A simple Tkinter GUI library with basic widgets and functionality.
5
- Home-page: https://github.com/aa425/FunctionGUI
6
- Author: Aaroh Charne
7
- Author-email: aaroh.charne@gmail.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Natural Language :: English
14
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
- Requires-Python: >=3.6
16
- Description-Content-Type: text/markdown
17
-
18
- ## Sentience
19
-
20
- Sentience is a basic AI library made to simplify the usage of the genai library by providing basic functions for chat at a higher level.
21
-
22
-
23
- ## Installation
24
-
25
- To install Sentience, you can simply use:
26
-
27
- ```bash
28
- pip install Sentience
29
- ```
30
-
31
- ## Usage
32
- ```python
33
- #Set your api (does not return in a variable)
34
- API(your_api_key)
35
- #Make the model, settings can be altered (returns the model in a variable), code example provides default settings
36
- model = Model(model = "gemini-1.5-pro", temperature = 1, top_p = 0.95, top_k = 40, max_output_tokens = 8192)
37
-
38
- #Uses model created above to make a chat (returns chat in a variable)
39
- chat = Chat(model)
40
-
41
- #Sends a message to your chat, replace chat with the varible you have named your chat
42
- response = Send(chat, "Hello, how are you?")
43
-
44
- print(response)
45
- ```
46
-
47
- # Bugs
48
-
49
- If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
50
- Please include a snippet of your code as well the problem. Thank You
51
-
52
-
53
- ```
@@ -1,36 +0,0 @@
1
- ## Sentience
2
-
3
- Sentience is a basic AI library made to simplify the usage of the genai library by providing basic functions for chat at a higher level.
4
-
5
-
6
- ## Installation
7
-
8
- To install Sentience, you can simply use:
9
-
10
- ```bash
11
- pip install Sentience
12
- ```
13
-
14
- ## Usage
15
- ```python
16
- #Set your api (does not return in a variable)
17
- API(your_api_key)
18
- #Make the model, settings can be altered (returns the model in a variable), code example provides default settings
19
- model = Model(model = "gemini-1.5-pro", temperature = 1, top_p = 0.95, top_k = 40, max_output_tokens = 8192)
20
-
21
- #Uses model created above to make a chat (returns chat in a variable)
22
- chat = Chat(model)
23
-
24
- #Sends a message to your chat, replace chat with the varible you have named your chat
25
- response = Send(chat, "Hello, how are you?")
26
-
27
- print(response)
28
- ```
29
-
30
- # Bugs
31
-
32
- If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
33
- Please include a snippet of your code as well the problem. Thank You
34
-
35
-
36
- ```
File without changes