lollms-client 0.20.10__py3-none-any.whl → 0.22.0__py3-none-any.whl
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.
Potentially problematic release.
This version of lollms-client might be problematic. Click here for more details.
- examples/console_discussion.py +448 -0
- examples/gradio_lollms_chat.py +259 -0
- examples/lollms_discussions_test.py +155 -0
- lollms_client/__init__.py +5 -2
- lollms_client/llm_bindings/ollama/__init__.py +1 -1
- lollms_client/lollms_core.py +86 -2
- lollms_client/lollms_discussion.py +638 -386
- lollms_client/lollms_personality.py +182 -0
- lollms_client/lollms_types.py +19 -16
- lollms_client/lollms_utilities.py +71 -57
- lollms_client/mcp_bindings/remote_mcp/__init__.py +2 -1
- {lollms_client-0.20.10.dist-info → lollms_client-0.22.0.dist-info}/METADATA +1 -1
- {lollms_client-0.20.10.dist-info → lollms_client-0.22.0.dist-info}/RECORD +17 -15
- {lollms_client-0.20.10.dist-info → lollms_client-0.22.0.dist-info}/top_level.txt +1 -0
- personalities/parrot.py +10 -0
- examples/personality_test/chat_test.py +0 -37
- examples/personality_test/chat_with_aristotle.py +0 -42
- examples/personality_test/tesks_test.py +0 -62
- {lollms_client-0.20.10.dist-info → lollms_client-0.22.0.dist-info}/WHEEL +0 -0
- {lollms_client-0.20.10.dist-info → lollms_client-0.22.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
from lollms_client import LollmsClient, LollmsDiscussion
|
|
2
|
-
from lollms_client import TasksLibrary
|
|
3
|
-
from ascii_colors import ASCIIColors
|
|
4
|
-
|
|
5
|
-
lc = LollmsClient("http://localhost:9600")
|
|
6
|
-
tl = TasksLibrary(lc)
|
|
7
|
-
|
|
8
|
-
# ======================================= Multichoice Q&A ==========================
|
|
9
|
-
# Define a multichoice question
|
|
10
|
-
question = "What is the capital city of France?"
|
|
11
|
-
|
|
12
|
-
# Define the possible answers
|
|
13
|
-
possible_answers = ["Paris", "Berlin", "London", "Madrid"]
|
|
14
|
-
|
|
15
|
-
# Call the multichoice_question function with the question and possible answers
|
|
16
|
-
selected_option = tl.multichoice_question(question, possible_answers)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ASCIIColors.yellow(question)
|
|
20
|
-
ASCIIColors.green(possible_answers[selected_option])
|
|
21
|
-
|
|
22
|
-
# ======================================= Yes no ==========================
|
|
23
|
-
# Define a yes or no question
|
|
24
|
-
question = "Is Paris the capital city of France?"
|
|
25
|
-
|
|
26
|
-
# Call the yes_no function with the question
|
|
27
|
-
answer = tl.yes_no(question)
|
|
28
|
-
ASCIIColors.yellow(question)
|
|
29
|
-
ASCIIColors.green("Yes" if answer else "No")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# ======================================= Code extraction ==========================
|
|
33
|
-
# Define a text with code blocks
|
|
34
|
-
text = """
|
|
35
|
-
Here is some text with a code block:
|
|
36
|
-
```python
|
|
37
|
-
def hello_world():
|
|
38
|
-
print("Hello, world!")
|
|
39
|
-
```
|
|
40
|
-
And here is another code block:
|
|
41
|
-
```java
|
|
42
|
-
public class HelloWorld {
|
|
43
|
-
public static void main(String[] args) {
|
|
44
|
-
System.out.println("Hello, World!");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
"""
|
|
49
|
-
|
|
50
|
-
# Call the extract_code_blocks function with the text
|
|
51
|
-
code_blocks = tl.extract_code_blocks(text)
|
|
52
|
-
|
|
53
|
-
# Print the extracted code blocks
|
|
54
|
-
for i, code_block in enumerate(code_blocks):
|
|
55
|
-
ASCIIColors.bold(f"Code block {i + 1}:")
|
|
56
|
-
ASCIIColors.bold(f"Index: {code_block['index']}")
|
|
57
|
-
ASCIIColors.bold(f"File name: {code_block['file_name']}")
|
|
58
|
-
ASCIIColors.bold(f"Content: {code_block['content']}")
|
|
59
|
-
ASCIIColors.bold(f"Type: {code_block['type']}")
|
|
60
|
-
print()
|
|
61
|
-
|
|
62
|
-
|
|
File without changes
|
|
File without changes
|