langroid 0.32.1__py3-none-any.whl → 0.32.2__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.
Files changed (40) hide show
  1. langroid/language_models/openai_gpt.py +16 -1
  2. {langroid-0.32.1.dist-info → langroid-0.32.2.dist-info}/METADATA +2 -2
  3. {langroid-0.32.1.dist-info → langroid-0.32.2.dist-info}/RECORD +6 -40
  4. pyproject.toml +1 -1
  5. langroid/agent/.chainlit/config.toml +0 -121
  6. langroid/agent/.chainlit/translations/bn.json +0 -231
  7. langroid/agent/.chainlit/translations/en-US.json +0 -229
  8. langroid/agent/.chainlit/translations/gu.json +0 -231
  9. langroid/agent/.chainlit/translations/he-IL.json +0 -231
  10. langroid/agent/.chainlit/translations/hi.json +0 -231
  11. langroid/agent/.chainlit/translations/kn.json +0 -231
  12. langroid/agent/.chainlit/translations/ml.json +0 -231
  13. langroid/agent/.chainlit/translations/mr.json +0 -231
  14. langroid/agent/.chainlit/translations/ta.json +0 -231
  15. langroid/agent/.chainlit/translations/te.json +0 -231
  16. langroid/agent/.chainlit/translations/zh-CN.json +0 -229
  17. langroid/agent/helpers.py +0 -0
  18. langroid/agent/junk +0 -13
  19. langroid/agent/structured_message.py +0 -9
  20. langroid/agent/typed_task.py +0 -19
  21. langroid/agent_config.py +0 -0
  22. langroid/embedding_models/clustering.py +0 -189
  23. langroid/experimental/team-save.py +0 -391
  24. langroid/language_models/.chainlit/config.toml +0 -121
  25. langroid/language_models/.chainlit/translations/en-US.json +0 -231
  26. langroid/parsing/code-parsing.md +0 -86
  27. langroid/parsing/config.py +0 -0
  28. langroid/parsing/image_text.py +0 -32
  29. langroid/parsing/url_loader_cookies.py +0 -73
  30. langroid/prompts/chat-gpt4-system-prompt.md +0 -68
  31. langroid/utils/.chainlit/config.toml +0 -121
  32. langroid/utils/.chainlit/translations/en-US.json +0 -231
  33. langroid/utils/docker.py +0 -37
  34. langroid/utils/llms/__init__.py +0 -0
  35. langroid/utils/llms/strings.py +0 -8
  36. langroid/utils/web/__init__.py +0 -0
  37. langroid/utils/web/login.py +0 -83
  38. langroid/vector_store/qdrant_cloud.py +0 -6
  39. {langroid-0.32.1.dist-info → langroid-0.32.2.dist-info}/LICENSE +0 -0
  40. {langroid-0.32.1.dist-info → langroid-0.32.2.dist-info}/WHEEL +0 -0
@@ -1,231 +0,0 @@
1
- {
2
- "components": {
3
- "atoms": {
4
- "buttons": {
5
- "userButton": {
6
- "menu": {
7
- "settings": "Settings",
8
- "settingsKey": "S",
9
- "APIKeys": "API Keys",
10
- "logout": "Logout"
11
- }
12
- }
13
- }
14
- },
15
- "molecules": {
16
- "newChatButton": {
17
- "newChat": "New Chat"
18
- },
19
- "tasklist": {
20
- "TaskList": {
21
- "title": "\ud83d\uddd2\ufe0f Task List",
22
- "loading": "Loading...",
23
- "error": "An error occured"
24
- }
25
- },
26
- "attachments": {
27
- "cancelUpload": "Cancel upload",
28
- "removeAttachment": "Remove attachment"
29
- },
30
- "newChatDialog": {
31
- "createNewChat": "Create new chat?",
32
- "clearChat": "This will clear the current messages and start a new chat.",
33
- "cancel": "Cancel",
34
- "confirm": "Confirm"
35
- },
36
- "settingsModal": {
37
- "settings": "Settings",
38
- "expandMessages": "Expand Messages",
39
- "hideChainOfThought": "Hide Chain of Thought",
40
- "darkMode": "Dark Mode"
41
- },
42
- "detailsButton": {
43
- "using": "Using",
44
- "running": "Running",
45
- "took_one": "Took {{count}} step",
46
- "took_other": "Took {{count}} steps"
47
- },
48
- "auth": {
49
- "authLogin": {
50
- "title": "Login to access the app.",
51
- "form": {
52
- "email": "Email address",
53
- "password": "Password",
54
- "noAccount": "Don't have an account?",
55
- "alreadyHaveAccount": "Already have an account?",
56
- "signup": "Sign Up",
57
- "signin": "Sign In",
58
- "or": "OR",
59
- "continue": "Continue",
60
- "forgotPassword": "Forgot password?",
61
- "passwordMustContain": "Your password must contain:",
62
- "emailRequired": "email is a required field",
63
- "passwordRequired": "password is a required field"
64
- },
65
- "error": {
66
- "default": "Unable to sign in.",
67
- "signin": "Try signing in with a different account.",
68
- "oauthsignin": "Try signing in with a different account.",
69
- "redirect_uri_mismatch": "The redirect URI is not matching the oauth app configuration.",
70
- "oauthcallbackerror": "Try signing in with a different account.",
71
- "oauthcreateaccount": "Try signing in with a different account.",
72
- "emailcreateaccount": "Try signing in with a different account.",
73
- "callback": "Try signing in with a different account.",
74
- "oauthaccountnotlinked": "To confirm your identity, sign in with the same account you used originally.",
75
- "emailsignin": "The e-mail could not be sent.",
76
- "emailverify": "Please verify your email, a new email has been sent.",
77
- "credentialssignin": "Sign in failed. Check the details you provided are correct.",
78
- "sessionrequired": "Please sign in to access this page."
79
- }
80
- },
81
- "authVerifyEmail": {
82
- "almostThere": "You're almost there! We've sent an email to ",
83
- "verifyEmailLink": "Please click on the link in that email to complete your signup.",
84
- "didNotReceive": "Can't find the email?",
85
- "resendEmail": "Resend email",
86
- "goBack": "Go Back",
87
- "emailSent": "Email sent successfully.",
88
- "verifyEmail": "Verify your email address"
89
- },
90
- "providerButton": {
91
- "continue": "Continue with {{provider}}",
92
- "signup": "Sign up with {{provider}}"
93
- },
94
- "authResetPassword": {
95
- "newPasswordRequired": "New password is a required field",
96
- "passwordsMustMatch": "Passwords must match",
97
- "confirmPasswordRequired": "Confirm password is a required field",
98
- "newPassword": "New password",
99
- "confirmPassword": "Confirm password",
100
- "resetPassword": "Reset Password"
101
- },
102
- "authForgotPassword": {
103
- "email": "Email address",
104
- "emailRequired": "email is a required field",
105
- "emailSent": "Please check the email address {{email}} for instructions to reset your password.",
106
- "enterEmail": "Enter your email address and we will send you instructions to reset your password.",
107
- "resendEmail": "Resend email",
108
- "continue": "Continue",
109
- "goBack": "Go Back"
110
- }
111
- }
112
- },
113
- "organisms": {
114
- "chat": {
115
- "history": {
116
- "index": {
117
- "showHistory": "Show history",
118
- "lastInputs": "Last Inputs",
119
- "noInputs": "Such empty...",
120
- "loading": "Loading..."
121
- }
122
- },
123
- "inputBox": {
124
- "input": {
125
- "placeholder": "Type your message here..."
126
- },
127
- "speechButton": {
128
- "start": "Start recording",
129
- "stop": "Stop recording"
130
- },
131
- "SubmitButton": {
132
- "sendMessage": "Send message",
133
- "stopTask": "Stop Task"
134
- },
135
- "UploadButton": {
136
- "attachFiles": "Attach files"
137
- },
138
- "waterMark": {
139
- "text": "Built with"
140
- }
141
- },
142
- "Messages": {
143
- "index": {
144
- "running": "Running",
145
- "executedSuccessfully": "executed successfully",
146
- "failed": "failed",
147
- "feedbackUpdated": "Feedback updated",
148
- "updating": "Updating"
149
- }
150
- },
151
- "dropScreen": {
152
- "dropYourFilesHere": "Drop your files here"
153
- },
154
- "index": {
155
- "failedToUpload": "Failed to upload",
156
- "cancelledUploadOf": "Cancelled upload of",
157
- "couldNotReachServer": "Could not reach the server",
158
- "continuingChat": "Continuing previous chat"
159
- },
160
- "settings": {
161
- "settingsPanel": "Settings panel",
162
- "reset": "Reset",
163
- "cancel": "Cancel",
164
- "confirm": "Confirm"
165
- }
166
- },
167
- "threadHistory": {
168
- "sidebar": {
169
- "filters": {
170
- "FeedbackSelect": {
171
- "feedbackAll": "Feedback: All",
172
- "feedbackPositive": "Feedback: Positive",
173
- "feedbackNegative": "Feedback: Negative"
174
- },
175
- "SearchBar": {
176
- "search": "Search"
177
- }
178
- },
179
- "DeleteThreadButton": {
180
- "confirmMessage": "This will delete the thread as well as it's messages and elements.",
181
- "cancel": "Cancel",
182
- "confirm": "Confirm",
183
- "deletingChat": "Deleting chat",
184
- "chatDeleted": "Chat deleted"
185
- },
186
- "index": {
187
- "pastChats": "Past Chats"
188
- },
189
- "ThreadList": {
190
- "empty": "Empty...",
191
- "today": "Today",
192
- "yesterday": "Yesterday",
193
- "previous7days": "Previous 7 days",
194
- "previous30days": "Previous 30 days"
195
- },
196
- "TriggerButton": {
197
- "closeSidebar": "Close sidebar",
198
- "openSidebar": "Open sidebar"
199
- }
200
- },
201
- "Thread": {
202
- "backToChat": "Go back to chat",
203
- "chatCreatedOn": "This chat was created on"
204
- }
205
- },
206
- "header": {
207
- "chat": "Chat",
208
- "readme": "Readme"
209
- }
210
- }
211
- },
212
- "hooks": {
213
- "useLLMProviders": {
214
- "failedToFetchProviders": "Failed to fetch providers:"
215
- }
216
- },
217
- "pages": {
218
- "Design": {},
219
- "Env": {
220
- "savedSuccessfully": "Saved successfully",
221
- "requiredApiKeys": "Required API Keys",
222
- "requiredApiKeysInfo": "To use this app, the following API keys are required. The keys are stored on your device's local storage."
223
- },
224
- "Page": {
225
- "notPartOfProject": "You are not part of this project."
226
- },
227
- "ResumeButton": {
228
- "resumeChat": "Resume Chat"
229
- }
230
- }
231
- }
langroid/utils/docker.py DELETED
@@ -1,37 +0,0 @@
1
- import logging
2
- import os
3
- import subprocess
4
-
5
- import docker
6
-
7
- logger = logging.getLogger(__name__)
8
-
9
-
10
- def docker_compose_up(file_path: str, name: str) -> None:
11
- """
12
- Launch docker-compose file with given name, using python SDK rather than CLI.
13
- This lets us eliminate the extra step of having to `run docker-compose up` on the
14
- command line before running the main script.
15
-
16
- Args:
17
- file_path: relative path to docker-compose file
18
- name: name of docker-compose project (i.e. container prefix)
19
-
20
- """
21
- # Load docker-compose file
22
- compose_file = os.path.abspath(file_path)
23
-
24
- # Connect to Docker daemon
25
- client = docker.from_env()
26
-
27
- # Get list of running containers
28
- containers = client.containers.list()
29
-
30
- # Check if containers defined in docker-compose file are already running
31
- for container in containers:
32
- if name in container.name:
33
- logging.info(f"Containers are already running, e.g.: {container.name}")
34
- return
35
-
36
- compose_command = ["docker-compose", "-f", compose_file, "up", "-d"]
37
- subprocess.run(compose_command)
File without changes
@@ -1,8 +0,0 @@
1
- import tiktoken
2
-
3
-
4
- def num_tokens_from_string(string: str, encoding_name: str) -> int:
5
- """Returns the number of tokens in a text string."""
6
- encoding = tiktoken.get_encoding(encoding_name)
7
- num_tokens = len(encoding.encode(string))
8
- return num_tokens
File without changes
@@ -1,83 +0,0 @@
1
- import requests
2
- from bs4 import BeautifulSoup
3
- from requests_oauthlib import OAuth2Session
4
-
5
-
6
- def login_and_navigate(
7
- url: str,
8
- login: str,
9
- pw: str,
10
- page_link: str,
11
- client_id=None,
12
- client_secret=None,
13
- redirect_uri=None,
14
- scope=None,
15
- token_url=None,
16
- oauth_password=None,
17
- ):
18
- session = requests.Session()
19
-
20
- # Check if OAuth is needed
21
- if client_id and client_secret and redirect_uri and scope and token_url:
22
- oauth = OAuth2Session(client_id, redirect_uri=redirect_uri, scope=scope)
23
- authorization_url, state = oauth.authorization_url(url)
24
- session = oauth
25
-
26
- print(
27
- f"Please go to the following URL and authorize the app:"
28
- f" {authorization_url}"
29
- )
30
- authorization_response = input("Enter the full callback URL: ")
31
-
32
- # If an additional OAuth password is required
33
- if oauth_password:
34
- # Add the required password field to the token request
35
- token_params = {
36
- "password": oauth_password,
37
- }
38
- else:
39
- token_params = {}
40
-
41
- token = oauth.fetch_token(
42
- token_url,
43
- authorization_response=authorization_response,
44
- client_secret=client_secret,
45
- **token_params,
46
- )
47
- session.headers.update({"Authorization": f"Bearer {token['access_token']}"})
48
-
49
- response = session.get(url)
50
- soup = BeautifulSoup(response.content, "html.parser")
51
-
52
- # Find the login form and fill in the username and password fields
53
- login_form = soup.find("form")
54
- if not login_form:
55
- raise ValueError("Login form not found")
56
-
57
- form_data = {
58
- field.get("name"): field.get("value")
59
- for field in login_form.find_all("input")
60
- if field.get("name")
61
- }
62
- form_data[login] = login
63
- form_data[pw] = pw
64
-
65
- # Submit the login form
66
- login_url = url + login_form["action"]
67
- response = session.post(login_url, data=form_data)
68
- response.raise_for_status()
69
-
70
- # Navigate to the desired page
71
- response = session.get(page_link)
72
- response.raise_for_status()
73
-
74
- return response.text
75
-
76
-
77
- # Example usage:
78
- # response_text = login_and_navigate("https://example.com",
79
- # "your_username_field_name",
80
- # "your_password_field_name",
81
- # "https://example.com/target-page",
82
- # oauth_password="your_oauth_password")
83
- # print(response_text)
@@ -1,6 +0,0 @@
1
- from qdrant_client import QdrantClient
2
-
3
- qdrant_client = QdrantClient(
4
- url="https://644cabc3-4141-4734-91f2-0cc3176514d4.us-east-1-0.aws.cloud.qdrant.io:6333",
5
- api_key="-7XJ3zw",
6
- )