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.

@@ -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
-