|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>Plugin_AI_Ollama.OllamaInterface.OllamaChatWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>Plugin_AI_Ollama.OllamaInterface.OllamaChatWidget</h1> |
|
10 <p> |
|
11 Module implementing a widget showing the chat with the 'ollama' server. |
|
12 </p> |
|
13 |
|
14 <h3>Global Attributes</h3> |
|
15 <table> |
|
16 <tr><td>None</td></tr> |
|
17 </table> |
|
18 |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#OllamaChatWidget">OllamaChatWidget</a></td> |
|
23 <td>Class implementing a widget showing the chat with the 'ollama' server.</td> |
|
24 </tr> |
|
25 </table> |
|
26 |
|
27 <h3>Functions</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 |
|
32 <hr /> |
|
33 <hr /> |
|
34 <a NAME="OllamaChatWidget" ID="OllamaChatWidget"></a> |
|
35 <h2>OllamaChatWidget</h2> |
|
36 <p> |
|
37 Class implementing a widget showing the chat with the 'ollama' server. |
|
38 </p> |
|
39 |
|
40 <h3>Derived from</h3> |
|
41 QWidget, Ui_OllamaChatWidget |
|
42 <h3>Class Attributes</h3> |
|
43 <table> |
|
44 <tr><td>None</td></tr> |
|
45 </table> |
|
46 |
|
47 <h3>Class Methods</h3> |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 |
|
52 <h3>Methods</h3> |
|
53 <table> |
|
54 <tr> |
|
55 <td><a href="#OllamaChatWidget.__init__">OllamaChatWidget</a></td> |
|
56 <td>Constructor</td> |
|
57 </tr> |
|
58 <tr> |
|
59 <td><a href="#OllamaChatWidget.__scrollChatToBottom">__scrollChatToBottom</a></td> |
|
60 <td>Private slot to scroll the chat scroll area to the bottom.</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#OllamaChatWidget.addMessage">addMessage</a></td> |
|
64 <td>Public method to add a new message.</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#OllamaChatWidget.appendMessage">appendMessage</a></td> |
|
68 <td>Public method to append a given message to the bottom most message box.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#OllamaChatWidget.getHistoryId">getHistoryId</a></td> |
|
72 <td>Public method to get the history ID of this chat.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#OllamaChatWidget.getRecentMessage">getRecentMessage</a></td> |
|
76 <td>Public method to get the message of the last message box.</td> |
|
77 </tr> |
|
78 </table> |
|
79 |
|
80 <h3>Static Methods</h3> |
|
81 <table> |
|
82 <tr><td>None</td></tr> |
|
83 </table> |
|
84 |
|
85 |
|
86 <a NAME="OllamaChatWidget.__init__" ID="OllamaChatWidget.__init__"></a> |
|
87 <h4>OllamaChatWidget (Constructor)</h4> |
|
88 <b>OllamaChatWidget</b>(<i>hid, title, model, parent=None</i>) |
|
89 <p> |
|
90 Constructor |
|
91 </p> |
|
92 |
|
93 <dl> |
|
94 |
|
95 <dt><i>hid</i> (str)</dt> |
|
96 <dd> |
|
97 ID of the chat history |
|
98 </dd> |
|
99 <dt><i>title</i> (str)</dt> |
|
100 <dd> |
|
101 title of the chat |
|
102 </dd> |
|
103 <dt><i>model</i> (str)</dt> |
|
104 <dd> |
|
105 model name used for the chat |
|
106 </dd> |
|
107 <dt><i>parent</i> (QWidget (optional))</dt> |
|
108 <dd> |
|
109 reference to the parent widget (defaults to None) |
|
110 </dd> |
|
111 </dl> |
|
112 <a NAME="OllamaChatWidget.__scrollChatToBottom" ID="OllamaChatWidget.__scrollChatToBottom"></a> |
|
113 <h4>OllamaChatWidget.__scrollChatToBottom</h4> |
|
114 <b>__scrollChatToBottom</b>(<i></i>) |
|
115 <p> |
|
116 Private slot to scroll the chat scroll area to the bottom. |
|
117 </p> |
|
118 |
|
119 <a NAME="OllamaChatWidget.addMessage" ID="OllamaChatWidget.addMessage"></a> |
|
120 <h4>OllamaChatWidget.addMessage</h4> |
|
121 <b>addMessage</b>(<i>role, message</i>) |
|
122 <p> |
|
123 Public method to add a new message. |
|
124 </p> |
|
125 |
|
126 <dl> |
|
127 |
|
128 <dt><i>role</i> (str)</dt> |
|
129 <dd> |
|
130 role of the message sender (one of 'user' or 'assistant') |
|
131 </dd> |
|
132 <dt><i>message</i> (str)</dt> |
|
133 <dd> |
|
134 message text |
|
135 </dd> |
|
136 </dl> |
|
137 <a NAME="OllamaChatWidget.appendMessage" ID="OllamaChatWidget.appendMessage"></a> |
|
138 <h4>OllamaChatWidget.appendMessage</h4> |
|
139 <b>appendMessage</b>(<i>message</i>) |
|
140 <p> |
|
141 Public method to append a given message to the bottom most message box. |
|
142 </p> |
|
143 |
|
144 <dl> |
|
145 |
|
146 <dt><i>message</i> (str)</dt> |
|
147 <dd> |
|
148 message text to be appended |
|
149 </dd> |
|
150 </dl> |
|
151 <a NAME="OllamaChatWidget.getHistoryId" ID="OllamaChatWidget.getHistoryId"></a> |
|
152 <h4>OllamaChatWidget.getHistoryId</h4> |
|
153 <b>getHistoryId</b>(<i></i>) |
|
154 <p> |
|
155 Public method to get the history ID of this chat. |
|
156 </p> |
|
157 |
|
158 <dl> |
|
159 <dt>Return:</dt> |
|
160 <dd> |
|
161 DESCRIPTION |
|
162 </dd> |
|
163 </dl> |
|
164 <dl> |
|
165 <dt>Return Type:</dt> |
|
166 <dd> |
|
167 TYPE |
|
168 </dd> |
|
169 </dl> |
|
170 <a NAME="OllamaChatWidget.getRecentMessage" ID="OllamaChatWidget.getRecentMessage"></a> |
|
171 <h4>OllamaChatWidget.getRecentMessage</h4> |
|
172 <b>getRecentMessage</b>(<i></i>) |
|
173 <p> |
|
174 Public method to get the message of the last message box. |
|
175 </p> |
|
176 |
|
177 <dl> |
|
178 <dt>Return:</dt> |
|
179 <dd> |
|
180 message content |
|
181 </dd> |
|
182 </dl> |
|
183 <dl> |
|
184 <dt>Return Type:</dt> |
|
185 <dd> |
|
186 str |
|
187 </dd> |
|
188 </dl> |
|
189 <div align="right"><a href="#top">Up</a></div> |
|
190 <hr /> |
|
191 </body></html> |