lets go
Browse files- .chainlit/config.toml +118 -0
- .chainlit/translations/en-US.json +229 -0
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +1 -1
- langsmith_df.ipynb +312 -0
- starters.py +0 -1
- trace_runs.csv +0 -0
.chainlit/config.toml
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
# Whether to enable telemetry (default: true). No personal data is collected.
|
| 3 |
+
enable_telemetry = true
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
# List of environment variables to be provided by each user to use the app.
|
| 7 |
+
user_env = []
|
| 8 |
+
|
| 9 |
+
# Duration (in seconds) during which the session is saved when the connection is lost
|
| 10 |
+
session_timeout = 3600
|
| 11 |
+
|
| 12 |
+
# Enable third parties caching (e.g LangChain cache)
|
| 13 |
+
cache = false
|
| 14 |
+
|
| 15 |
+
# Authorized origins
|
| 16 |
+
allow_origins = ["*"]
|
| 17 |
+
|
| 18 |
+
# Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
|
| 19 |
+
# follow_symlink = false
|
| 20 |
+
|
| 21 |
+
[features]
|
| 22 |
+
# Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)
|
| 23 |
+
unsafe_allow_html = false
|
| 24 |
+
|
| 25 |
+
# Process and display mathematical expressions. This can clash with "$" characters in messages.
|
| 26 |
+
latex = false
|
| 27 |
+
|
| 28 |
+
# Automatically tag threads with the current chat profile (if a chat profile is used)
|
| 29 |
+
auto_tag_thread = true
|
| 30 |
+
|
| 31 |
+
# Authorize users to spontaneously upload files with messages
|
| 32 |
+
[features.spontaneous_file_upload]
|
| 33 |
+
enabled = true
|
| 34 |
+
accept = ["*/*"]
|
| 35 |
+
max_files = 20
|
| 36 |
+
max_size_mb = 500
|
| 37 |
+
|
| 38 |
+
[features.audio]
|
| 39 |
+
# Threshold for audio recording
|
| 40 |
+
min_decibels = -45
|
| 41 |
+
# Delay for the user to start speaking in MS
|
| 42 |
+
initial_silence_timeout = 3000
|
| 43 |
+
# Delay for the user to continue speaking in MS. If the user stops speaking for this duration, the recording will stop.
|
| 44 |
+
silence_timeout = 1500
|
| 45 |
+
# Above this duration (MS), the recording will forcefully stop.
|
| 46 |
+
max_duration = 15000
|
| 47 |
+
# Duration of the audio chunks in MS
|
| 48 |
+
chunk_duration = 1000
|
| 49 |
+
# Sample rate of the audio
|
| 50 |
+
sample_rate = 44100
|
| 51 |
+
|
| 52 |
+
[UI]
|
| 53 |
+
# Name of the assistant.
|
| 54 |
+
name = "Assistant"
|
| 55 |
+
|
| 56 |
+
# Description of the assistant. This is used for HTML tags.
|
| 57 |
+
# description = ""
|
| 58 |
+
|
| 59 |
+
# Large size content are by default collapsed for a cleaner ui
|
| 60 |
+
default_collapse_content = true
|
| 61 |
+
|
| 62 |
+
# Hide the chain of thought details from the user in the UI.
|
| 63 |
+
hide_cot = false
|
| 64 |
+
|
| 65 |
+
# Link to your github repo. This will add a github button in the UI's header.
|
| 66 |
+
# github = ""
|
| 67 |
+
|
| 68 |
+
# Specify a CSS file that can be used to customize the user interface.
|
| 69 |
+
# The CSS file can be served from the public directory or via an external link.
|
| 70 |
+
# custom_css = "/public/test.css"
|
| 71 |
+
|
| 72 |
+
# Specify a Javascript file that can be used to customize the user interface.
|
| 73 |
+
# The Javascript file can be served from the public directory.
|
| 74 |
+
# custom_js = "/public/test.js"
|
| 75 |
+
|
| 76 |
+
# Specify a custom font url.
|
| 77 |
+
# custom_font = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
|
| 78 |
+
|
| 79 |
+
# Specify a custom meta image url.
|
| 80 |
+
# custom_meta_image_url = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"
|
| 81 |
+
|
| 82 |
+
# Specify a custom build directory for the frontend.
|
| 83 |
+
# This can be used to customize the frontend code.
|
| 84 |
+
# Be careful: If this is a relative path, it should not start with a slash.
|
| 85 |
+
# custom_build = "./public/build"
|
| 86 |
+
|
| 87 |
+
[UI.theme]
|
| 88 |
+
default = "dark"
|
| 89 |
+
#layout = "wide"
|
| 90 |
+
#font_family = "Inter, sans-serif"
|
| 91 |
+
# Override default MUI light theme. (Check theme.ts)
|
| 92 |
+
[UI.theme.light]
|
| 93 |
+
#background = "#FAFAFA"
|
| 94 |
+
#paper = "#FFFFFF"
|
| 95 |
+
|
| 96 |
+
[UI.theme.light.primary]
|
| 97 |
+
#main = "#F80061"
|
| 98 |
+
#dark = "#980039"
|
| 99 |
+
#light = "#FFE7EB"
|
| 100 |
+
[UI.theme.light.text]
|
| 101 |
+
#primary = "#212121"
|
| 102 |
+
#secondary = "#616161"
|
| 103 |
+
|
| 104 |
+
# Override default MUI dark theme. (Check theme.ts)
|
| 105 |
+
[UI.theme.dark]
|
| 106 |
+
#background = "#FAFAFA"
|
| 107 |
+
#paper = "#FFFFFF"
|
| 108 |
+
|
| 109 |
+
[UI.theme.dark.primary]
|
| 110 |
+
#main = "#F80061"
|
| 111 |
+
#dark = "#980039"
|
| 112 |
+
#light = "#FFE7EB"
|
| 113 |
+
[UI.theme.dark.text]
|
| 114 |
+
#primary = "#EEEEEE"
|
| 115 |
+
#secondary = "#BDBDBD"
|
| 116 |
+
|
| 117 |
+
[meta]
|
| 118 |
+
generated_by = "1.1.302"
|
.chainlit/translations/en-US.json
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": {
|
| 17 |
+
"newChat": "New Chat"
|
| 18 |
+
},
|
| 19 |
+
"tasklist": {
|
| 20 |
+
"TaskList": {
|
| 21 |
+
"title": "\ud83d\uddd2\ufe0f Task List",
|
| 22 |
+
"loading": "Loading...",
|
| 23 |
+
"error": "An error occurred"
|
| 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 |
+
"used": "Used"
|
| 45 |
+
},
|
| 46 |
+
"auth": {
|
| 47 |
+
"authLogin": {
|
| 48 |
+
"title": "Login to access the app.",
|
| 49 |
+
"form": {
|
| 50 |
+
"email": "Email address",
|
| 51 |
+
"password": "Password",
|
| 52 |
+
"noAccount": "Don't have an account?",
|
| 53 |
+
"alreadyHaveAccount": "Already have an account?",
|
| 54 |
+
"signup": "Sign Up",
|
| 55 |
+
"signin": "Sign In",
|
| 56 |
+
"or": "OR",
|
| 57 |
+
"continue": "Continue",
|
| 58 |
+
"forgotPassword": "Forgot password?",
|
| 59 |
+
"passwordMustContain": "Your password must contain:",
|
| 60 |
+
"emailRequired": "email is a required field",
|
| 61 |
+
"passwordRequired": "password is a required field"
|
| 62 |
+
},
|
| 63 |
+
"error": {
|
| 64 |
+
"default": "Unable to sign in.",
|
| 65 |
+
"signin": "Try signing in with a different account.",
|
| 66 |
+
"oauthsignin": "Try signing in with a different account.",
|
| 67 |
+
"redirect_uri_mismatch": "The redirect URI is not matching the oauth app configuration.",
|
| 68 |
+
"oauthcallbackerror": "Try signing in with a different account.",
|
| 69 |
+
"oauthcreateaccount": "Try signing in with a different account.",
|
| 70 |
+
"emailcreateaccount": "Try signing in with a different account.",
|
| 71 |
+
"callback": "Try signing in with a different account.",
|
| 72 |
+
"oauthaccountnotlinked": "To confirm your identity, sign in with the same account you used originally.",
|
| 73 |
+
"emailsignin": "The e-mail could not be sent.",
|
| 74 |
+
"emailverify": "Please verify your email, a new email has been sent.",
|
| 75 |
+
"credentialssignin": "Sign in failed. Check the details you provided are correct.",
|
| 76 |
+
"sessionrequired": "Please sign in to access this page."
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"authVerifyEmail": {
|
| 80 |
+
"almostThere": "You're almost there! We've sent an email to ",
|
| 81 |
+
"verifyEmailLink": "Please click on the link in that email to complete your signup.",
|
| 82 |
+
"didNotReceive": "Can't find the email?",
|
| 83 |
+
"resendEmail": "Resend email",
|
| 84 |
+
"goBack": "Go Back",
|
| 85 |
+
"emailSent": "Email sent successfully.",
|
| 86 |
+
"verifyEmail": "Verify your email address"
|
| 87 |
+
},
|
| 88 |
+
"providerButton": {
|
| 89 |
+
"continue": "Continue with {{provider}}",
|
| 90 |
+
"signup": "Sign up with {{provider}}"
|
| 91 |
+
},
|
| 92 |
+
"authResetPassword": {
|
| 93 |
+
"newPasswordRequired": "New password is a required field",
|
| 94 |
+
"passwordsMustMatch": "Passwords must match",
|
| 95 |
+
"confirmPasswordRequired": "Confirm password is a required field",
|
| 96 |
+
"newPassword": "New password",
|
| 97 |
+
"confirmPassword": "Confirm password",
|
| 98 |
+
"resetPassword": "Reset Password"
|
| 99 |
+
},
|
| 100 |
+
"authForgotPassword": {
|
| 101 |
+
"email": "Email address",
|
| 102 |
+
"emailRequired": "email is a required field",
|
| 103 |
+
"emailSent": "Please check the email address {{email}} for instructions to reset your password.",
|
| 104 |
+
"enterEmail": "Enter your email address and we will send you instructions to reset your password.",
|
| 105 |
+
"resendEmail": "Resend email",
|
| 106 |
+
"continue": "Continue",
|
| 107 |
+
"goBack": "Go Back"
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
},
|
| 111 |
+
"organisms": {
|
| 112 |
+
"chat": {
|
| 113 |
+
"history": {
|
| 114 |
+
"index": {
|
| 115 |
+
"showHistory": "Show history",
|
| 116 |
+
"lastInputs": "Last Inputs",
|
| 117 |
+
"noInputs": "Such empty...",
|
| 118 |
+
"loading": "Loading..."
|
| 119 |
+
}
|
| 120 |
+
},
|
| 121 |
+
"inputBox": {
|
| 122 |
+
"input": {
|
| 123 |
+
"placeholder": "Type your message here..."
|
| 124 |
+
},
|
| 125 |
+
"speechButton": {
|
| 126 |
+
"start": "Start recording",
|
| 127 |
+
"stop": "Stop recording"
|
| 128 |
+
},
|
| 129 |
+
"SubmitButton": {
|
| 130 |
+
"sendMessage": "Send message",
|
| 131 |
+
"stopTask": "Stop Task"
|
| 132 |
+
},
|
| 133 |
+
"UploadButton": {
|
| 134 |
+
"attachFiles": "Attach files"
|
| 135 |
+
},
|
| 136 |
+
"waterMark": {
|
| 137 |
+
"text": "Built with"
|
| 138 |
+
}
|
| 139 |
+
},
|
| 140 |
+
"Messages": {
|
| 141 |
+
"index": {
|
| 142 |
+
"running": "Running",
|
| 143 |
+
"executedSuccessfully": "executed successfully",
|
| 144 |
+
"failed": "failed",
|
| 145 |
+
"feedbackUpdated": "Feedback updated",
|
| 146 |
+
"updating": "Updating"
|
| 147 |
+
}
|
| 148 |
+
},
|
| 149 |
+
"dropScreen": {
|
| 150 |
+
"dropYourFilesHere": "Drop your files here"
|
| 151 |
+
},
|
| 152 |
+
"index": {
|
| 153 |
+
"failedToUpload": "Failed to upload",
|
| 154 |
+
"cancelledUploadOf": "Cancelled upload of",
|
| 155 |
+
"couldNotReachServer": "Could not reach the server",
|
| 156 |
+
"continuingChat": "Continuing previous chat"
|
| 157 |
+
},
|
| 158 |
+
"settings": {
|
| 159 |
+
"settingsPanel": "Settings panel",
|
| 160 |
+
"reset": "Reset",
|
| 161 |
+
"cancel": "Cancel",
|
| 162 |
+
"confirm": "Confirm"
|
| 163 |
+
}
|
| 164 |
+
},
|
| 165 |
+
"threadHistory": {
|
| 166 |
+
"sidebar": {
|
| 167 |
+
"filters": {
|
| 168 |
+
"FeedbackSelect": {
|
| 169 |
+
"feedbackAll": "Feedback: All",
|
| 170 |
+
"feedbackPositive": "Feedback: Positive",
|
| 171 |
+
"feedbackNegative": "Feedback: Negative"
|
| 172 |
+
},
|
| 173 |
+
"SearchBar": {
|
| 174 |
+
"search": "Search"
|
| 175 |
+
}
|
| 176 |
+
},
|
| 177 |
+
"DeleteThreadButton": {
|
| 178 |
+
"confirmMessage": "This will delete the thread as well as it's messages and elements.",
|
| 179 |
+
"cancel": "Cancel",
|
| 180 |
+
"confirm": "Confirm",
|
| 181 |
+
"deletingChat": "Deleting chat",
|
| 182 |
+
"chatDeleted": "Chat deleted"
|
| 183 |
+
},
|
| 184 |
+
"index": {
|
| 185 |
+
"pastChats": "Past Chats"
|
| 186 |
+
},
|
| 187 |
+
"ThreadList": {
|
| 188 |
+
"empty": "Empty...",
|
| 189 |
+
"today": "Today",
|
| 190 |
+
"yesterday": "Yesterday",
|
| 191 |
+
"previous7days": "Previous 7 days",
|
| 192 |
+
"previous30days": "Previous 30 days"
|
| 193 |
+
},
|
| 194 |
+
"TriggerButton": {
|
| 195 |
+
"closeSidebar": "Close sidebar",
|
| 196 |
+
"openSidebar": "Open sidebar"
|
| 197 |
+
}
|
| 198 |
+
},
|
| 199 |
+
"Thread": {
|
| 200 |
+
"backToChat": "Go back to chat",
|
| 201 |
+
"chatCreatedOn": "This chat was created on"
|
| 202 |
+
}
|
| 203 |
+
},
|
| 204 |
+
"header": {
|
| 205 |
+
"chat": "Chat",
|
| 206 |
+
"readme": "Readme"
|
| 207 |
+
}
|
| 208 |
+
}
|
| 209 |
+
},
|
| 210 |
+
"hooks": {
|
| 211 |
+
"useLLMProviders": {
|
| 212 |
+
"failedToFetchProviders": "Failed to fetch providers:"
|
| 213 |
+
}
|
| 214 |
+
},
|
| 215 |
+
"pages": {
|
| 216 |
+
"Design": {},
|
| 217 |
+
"Env": {
|
| 218 |
+
"savedSuccessfully": "Saved successfully",
|
| 219 |
+
"requiredApiKeys": "Required API Keys",
|
| 220 |
+
"requiredApiKeysInfo": "To use this app, the following API keys are required. The keys are stored on your device's local storage."
|
| 221 |
+
},
|
| 222 |
+
"Page": {
|
| 223 |
+
"notPartOfProject": "You are not part of this project."
|
| 224 |
+
},
|
| 225 |
+
"ResumeButton": {
|
| 226 |
+
"resumeChat": "Resume Chat"
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
}
|
__pycache__/app.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
|
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from langchain.schema.output_parser import StrOutputParser
|
|
| 11 |
from langchain.schema.runnable import RunnablePassthrough
|
| 12 |
from langchain.schema.runnable.config import RunnableConfig
|
| 13 |
|
| 14 |
-
from starters import set_starters
|
| 15 |
|
| 16 |
load_dotenv()
|
| 17 |
|
|
|
|
| 11 |
from langchain.schema.runnable import RunnablePassthrough
|
| 12 |
from langchain.schema.runnable.config import RunnableConfig
|
| 13 |
|
| 14 |
+
# from starters import set_starters
|
| 15 |
|
| 16 |
load_dotenv()
|
| 17 |
|
langsmith_df.ipynb
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"metadata": {},
|
| 6 |
+
"source": [
|
| 7 |
+
"# Capture LangSmith data in a Pandas DataFrame"
|
| 8 |
+
]
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"cell_type": "code",
|
| 12 |
+
"execution_count": 1,
|
| 13 |
+
"metadata": {},
|
| 14 |
+
"outputs": [],
|
| 15 |
+
"source": [
|
| 16 |
+
"import os\n",
|
| 17 |
+
"import pandas as pd\n",
|
| 18 |
+
"from langsmith import Client"
|
| 19 |
+
]
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"cell_type": "code",
|
| 23 |
+
"execution_count": 2,
|
| 24 |
+
"metadata": {},
|
| 25 |
+
"outputs": [],
|
| 26 |
+
"source": [
|
| 27 |
+
"# Initialize the client\n",
|
| 28 |
+
"client = Client(\n",
|
| 29 |
+
" api_key=os.getenv(\"LANGCHAIN_API_KEY\"),\n",
|
| 30 |
+
" api_url=os.getenv(\"LANGCHAIN_ENDPOINT\")\n",
|
| 31 |
+
")"
|
| 32 |
+
]
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"cell_type": "code",
|
| 36 |
+
"execution_count": 3,
|
| 37 |
+
"metadata": {},
|
| 38 |
+
"outputs": [],
|
| 39 |
+
"source": [
|
| 40 |
+
"# Retrieve trace runs\n",
|
| 41 |
+
"project_name = \"AirBnB RAG Evaluation\"\n",
|
| 42 |
+
"traces = client.list_runs(project_name=project_name)"
|
| 43 |
+
]
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"cell_type": "code",
|
| 47 |
+
"execution_count": 4,
|
| 48 |
+
"metadata": {},
|
| 49 |
+
"outputs": [],
|
| 50 |
+
"source": [
|
| 51 |
+
"# Convert trace data to DataFrame\n",
|
| 52 |
+
"trace_data = []\n",
|
| 53 |
+
"\n",
|
| 54 |
+
"for trace in traces:\n",
|
| 55 |
+
" trace_data.append({\n",
|
| 56 |
+
" 'trace_id': trace.id,\n",
|
| 57 |
+
" 'start_time': trace.start_time,\n",
|
| 58 |
+
" 'end_time': trace.end_time,\n",
|
| 59 |
+
" 'status': trace.status,\n",
|
| 60 |
+
" 'input': trace.inputs,\n",
|
| 61 |
+
" 'output': trace.outputs\n",
|
| 62 |
+
" })"
|
| 63 |
+
]
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"cell_type": "code",
|
| 67 |
+
"execution_count": 5,
|
| 68 |
+
"metadata": {},
|
| 69 |
+
"outputs": [],
|
| 70 |
+
"source": [
|
| 71 |
+
"df = pd.DataFrame(trace_data)"
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"cell_type": "code",
|
| 76 |
+
"execution_count": 6,
|
| 77 |
+
"metadata": {},
|
| 78 |
+
"outputs": [
|
| 79 |
+
{
|
| 80 |
+
"data": {
|
| 81 |
+
"text/html": [
|
| 82 |
+
"<div>\n",
|
| 83 |
+
"<style scoped>\n",
|
| 84 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 85 |
+
" vertical-align: middle;\n",
|
| 86 |
+
" }\n",
|
| 87 |
+
"\n",
|
| 88 |
+
" .dataframe tbody tr th {\n",
|
| 89 |
+
" vertical-align: top;\n",
|
| 90 |
+
" }\n",
|
| 91 |
+
"\n",
|
| 92 |
+
" .dataframe thead th {\n",
|
| 93 |
+
" text-align: right;\n",
|
| 94 |
+
" }\n",
|
| 95 |
+
"</style>\n",
|
| 96 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 97 |
+
" <thead>\n",
|
| 98 |
+
" <tr style=\"text-align: right;\">\n",
|
| 99 |
+
" <th></th>\n",
|
| 100 |
+
" <th>trace_id</th>\n",
|
| 101 |
+
" <th>start_time</th>\n",
|
| 102 |
+
" <th>end_time</th>\n",
|
| 103 |
+
" <th>status</th>\n",
|
| 104 |
+
" <th>input</th>\n",
|
| 105 |
+
" <th>output</th>\n",
|
| 106 |
+
" </tr>\n",
|
| 107 |
+
" </thead>\n",
|
| 108 |
+
" <tbody>\n",
|
| 109 |
+
" <tr>\n",
|
| 110 |
+
" <th>0</th>\n",
|
| 111 |
+
" <td>717ef090-359f-41c4-84b3-08bec6251185</td>\n",
|
| 112 |
+
" <td>2024-06-25 14:02:53.067707</td>\n",
|
| 113 |
+
" <td>2024-06-25 14:02:54.842210</td>\n",
|
| 114 |
+
" <td>success</td>\n",
|
| 115 |
+
" <td>{'messages': [{'lc': 1, 'type': 'constructor',...</td>\n",
|
| 116 |
+
" <td>{'llm_output': {'model_name': 'llama3-70b-8192...</td>\n",
|
| 117 |
+
" </tr>\n",
|
| 118 |
+
" <tr>\n",
|
| 119 |
+
" <th>1</th>\n",
|
| 120 |
+
" <td>97f1d6b5-17fa-4ebe-8438-2eabb33e6c12</td>\n",
|
| 121 |
+
" <td>2024-06-25 14:02:53.064911</td>\n",
|
| 122 |
+
" <td>2024-06-25 14:02:53.066843</td>\n",
|
| 123 |
+
" <td>success</td>\n",
|
| 124 |
+
" <td>{'context': [{'page_content': 'December 31, 20...</td>\n",
|
| 125 |
+
" <td>{'output': {'messages': [{'content': '<|begin_...</td>\n",
|
| 126 |
+
" </tr>\n",
|
| 127 |
+
" <tr>\n",
|
| 128 |
+
" <th>2</th>\n",
|
| 129 |
+
" <td>78165b64-3961-4b28-8d66-ca17763ff7df</td>\n",
|
| 130 |
+
" <td>2024-06-25 14:02:53.063469</td>\n",
|
| 131 |
+
" <td>2024-06-25 14:02:53.066525</td>\n",
|
| 132 |
+
" <td>success</td>\n",
|
| 133 |
+
" <td>{'context': [{'page_content': 'December 31, 20...</td>\n",
|
| 134 |
+
" <td>{'output': [{'page_content': 'December 31, 202...</td>\n",
|
| 135 |
+
" </tr>\n",
|
| 136 |
+
" <tr>\n",
|
| 137 |
+
" <th>3</th>\n",
|
| 138 |
+
" <td>6ba40755-4a55-4d8c-a824-7e8f855444cc</td>\n",
|
| 139 |
+
" <td>2024-06-25 14:02:53.062807</td>\n",
|
| 140 |
+
" <td>2024-06-25 14:02:54.844401</td>\n",
|
| 141 |
+
" <td>success</td>\n",
|
| 142 |
+
" <td>{'context': [{'page_content': 'December 31, 20...</td>\n",
|
| 143 |
+
" <td>{'output': {'content': '[BEGIN_SUMMARY]\n",
|
| 144 |
+
"The to...</td>\n",
|
| 145 |
+
" </tr>\n",
|
| 146 |
+
" <tr>\n",
|
| 147 |
+
" <th>4</th>\n",
|
| 148 |
+
" <td>3bcafa07-7bdd-48e0-a55a-47b3f8ee32c7</td>\n",
|
| 149 |
+
" <td>2024-06-25 14:02:53.060709</td>\n",
|
| 150 |
+
" <td>2024-06-25 14:02:54.845145</td>\n",
|
| 151 |
+
" <td>success</td>\n",
|
| 152 |
+
" <td>{'context': [{'page_content': 'December 31, 20...</td>\n",
|
| 153 |
+
" <td>{'response': {'content': '[BEGIN_SUMMARY]\n",
|
| 154 |
+
"The ...</td>\n",
|
| 155 |
+
" </tr>\n",
|
| 156 |
+
" <tr>\n",
|
| 157 |
+
" <th>...</th>\n",
|
| 158 |
+
" <td>...</td>\n",
|
| 159 |
+
" <td>...</td>\n",
|
| 160 |
+
" <td>...</td>\n",
|
| 161 |
+
" <td>...</td>\n",
|
| 162 |
+
" <td>...</td>\n",
|
| 163 |
+
" <td>...</td>\n",
|
| 164 |
+
" </tr>\n",
|
| 165 |
+
" <tr>\n",
|
| 166 |
+
" <th>555</th>\n",
|
| 167 |
+
" <td>1013e849-793d-46da-aeea-2a8c3eaa08d4</td>\n",
|
| 168 |
+
" <td>2024-06-20 19:35:54.492314</td>\n",
|
| 169 |
+
" <td>2024-06-20 19:35:54.498540</td>\n",
|
| 170 |
+
" <td>success</td>\n",
|
| 171 |
+
" <td>{'question': 'What is Airbnb's 'Description of...</td>\n",
|
| 172 |
+
" <td>{'output': 'What is Airbnb's 'Description of B...</td>\n",
|
| 173 |
+
" </tr>\n",
|
| 174 |
+
" <tr>\n",
|
| 175 |
+
" <th>556</th>\n",
|
| 176 |
+
" <td>88e7c281-436f-4cfd-9056-5e6954d2462c</td>\n",
|
| 177 |
+
" <td>2024-06-20 19:35:54.491579</td>\n",
|
| 178 |
+
" <td>2024-06-20 19:35:54.498051</td>\n",
|
| 179 |
+
" <td>success</td>\n",
|
| 180 |
+
" <td>{'question': 'What is Airbnb's 'Description of...</td>\n",
|
| 181 |
+
" <td>{'output': 'What is Airbnb's 'Description of B...</td>\n",
|
| 182 |
+
" </tr>\n",
|
| 183 |
+
" <tr>\n",
|
| 184 |
+
" <th>557</th>\n",
|
| 185 |
+
" <td>7ea55086-6ed9-4930-8ba4-0df7a406c8b8</td>\n",
|
| 186 |
+
" <td>2024-06-20 19:35:54.490744</td>\n",
|
| 187 |
+
" <td>2024-06-20 19:35:55.556579</td>\n",
|
| 188 |
+
" <td>success</td>\n",
|
| 189 |
+
" <td>{'question': 'What is Airbnb's 'Description of...</td>\n",
|
| 190 |
+
" <td>{'output': [{'page_content': 'Table of Content...</td>\n",
|
| 191 |
+
" </tr>\n",
|
| 192 |
+
" <tr>\n",
|
| 193 |
+
" <th>558</th>\n",
|
| 194 |
+
" <td>288e39cf-71e6-4574-bf48-8f902ec7a12f</td>\n",
|
| 195 |
+
" <td>2024-06-20 19:35:54.489031</td>\n",
|
| 196 |
+
" <td>2024-06-20 19:35:55.557354</td>\n",
|
| 197 |
+
" <td>success</td>\n",
|
| 198 |
+
" <td>{'question': 'What is Airbnb's 'Description of...</td>\n",
|
| 199 |
+
" <td>{'context': [{'page_content': 'Table of Conten...</td>\n",
|
| 200 |
+
" </tr>\n",
|
| 201 |
+
" <tr>\n",
|
| 202 |
+
" <th>559</th>\n",
|
| 203 |
+
" <td>073e10ba-0a34-4338-9ff0-a7c00584e6bb</td>\n",
|
| 204 |
+
" <td>2024-06-20 19:35:54.441022</td>\n",
|
| 205 |
+
" <td>2024-06-20 19:35:56.962382</td>\n",
|
| 206 |
+
" <td>success</td>\n",
|
| 207 |
+
" <td>{'question': 'What is Airbnb's 'Description of...</td>\n",
|
| 208 |
+
" <td>{'response': {'content': 'Airbnb's 'Descriptio...</td>\n",
|
| 209 |
+
" </tr>\n",
|
| 210 |
+
" </tbody>\n",
|
| 211 |
+
"</table>\n",
|
| 212 |
+
"<p>560 rows Γ 6 columns</p>\n",
|
| 213 |
+
"</div>"
|
| 214 |
+
],
|
| 215 |
+
"text/plain": [
|
| 216 |
+
" trace_id start_time \\\n",
|
| 217 |
+
"0 717ef090-359f-41c4-84b3-08bec6251185 2024-06-25 14:02:53.067707 \n",
|
| 218 |
+
"1 97f1d6b5-17fa-4ebe-8438-2eabb33e6c12 2024-06-25 14:02:53.064911 \n",
|
| 219 |
+
"2 78165b64-3961-4b28-8d66-ca17763ff7df 2024-06-25 14:02:53.063469 \n",
|
| 220 |
+
"3 6ba40755-4a55-4d8c-a824-7e8f855444cc 2024-06-25 14:02:53.062807 \n",
|
| 221 |
+
"4 3bcafa07-7bdd-48e0-a55a-47b3f8ee32c7 2024-06-25 14:02:53.060709 \n",
|
| 222 |
+
".. ... ... \n",
|
| 223 |
+
"555 1013e849-793d-46da-aeea-2a8c3eaa08d4 2024-06-20 19:35:54.492314 \n",
|
| 224 |
+
"556 88e7c281-436f-4cfd-9056-5e6954d2462c 2024-06-20 19:35:54.491579 \n",
|
| 225 |
+
"557 7ea55086-6ed9-4930-8ba4-0df7a406c8b8 2024-06-20 19:35:54.490744 \n",
|
| 226 |
+
"558 288e39cf-71e6-4574-bf48-8f902ec7a12f 2024-06-20 19:35:54.489031 \n",
|
| 227 |
+
"559 073e10ba-0a34-4338-9ff0-a7c00584e6bb 2024-06-20 19:35:54.441022 \n",
|
| 228 |
+
"\n",
|
| 229 |
+
" end_time status \\\n",
|
| 230 |
+
"0 2024-06-25 14:02:54.842210 success \n",
|
| 231 |
+
"1 2024-06-25 14:02:53.066843 success \n",
|
| 232 |
+
"2 2024-06-25 14:02:53.066525 success \n",
|
| 233 |
+
"3 2024-06-25 14:02:54.844401 success \n",
|
| 234 |
+
"4 2024-06-25 14:02:54.845145 success \n",
|
| 235 |
+
".. ... ... \n",
|
| 236 |
+
"555 2024-06-20 19:35:54.498540 success \n",
|
| 237 |
+
"556 2024-06-20 19:35:54.498051 success \n",
|
| 238 |
+
"557 2024-06-20 19:35:55.556579 success \n",
|
| 239 |
+
"558 2024-06-20 19:35:55.557354 success \n",
|
| 240 |
+
"559 2024-06-20 19:35:56.962382 success \n",
|
| 241 |
+
"\n",
|
| 242 |
+
" input \\\n",
|
| 243 |
+
"0 {'messages': [{'lc': 1, 'type': 'constructor',... \n",
|
| 244 |
+
"1 {'context': [{'page_content': 'December 31, 20... \n",
|
| 245 |
+
"2 {'context': [{'page_content': 'December 31, 20... \n",
|
| 246 |
+
"3 {'context': [{'page_content': 'December 31, 20... \n",
|
| 247 |
+
"4 {'context': [{'page_content': 'December 31, 20... \n",
|
| 248 |
+
".. ... \n",
|
| 249 |
+
"555 {'question': 'What is Airbnb's 'Description of... \n",
|
| 250 |
+
"556 {'question': 'What is Airbnb's 'Description of... \n",
|
| 251 |
+
"557 {'question': 'What is Airbnb's 'Description of... \n",
|
| 252 |
+
"558 {'question': 'What is Airbnb's 'Description of... \n",
|
| 253 |
+
"559 {'question': 'What is Airbnb's 'Description of... \n",
|
| 254 |
+
"\n",
|
| 255 |
+
" output \n",
|
| 256 |
+
"0 {'llm_output': {'model_name': 'llama3-70b-8192... \n",
|
| 257 |
+
"1 {'output': {'messages': [{'content': '<|begin_... \n",
|
| 258 |
+
"2 {'output': [{'page_content': 'December 31, 202... \n",
|
| 259 |
+
"3 {'output': {'content': '[BEGIN_SUMMARY]\n",
|
| 260 |
+
"The to... \n",
|
| 261 |
+
"4 {'response': {'content': '[BEGIN_SUMMARY]\n",
|
| 262 |
+
"The ... \n",
|
| 263 |
+
".. ... \n",
|
| 264 |
+
"555 {'output': 'What is Airbnb's 'Description of B... \n",
|
| 265 |
+
"556 {'output': 'What is Airbnb's 'Description of B... \n",
|
| 266 |
+
"557 {'output': [{'page_content': 'Table of Content... \n",
|
| 267 |
+
"558 {'context': [{'page_content': 'Table of Conten... \n",
|
| 268 |
+
"559 {'response': {'content': 'Airbnb's 'Descriptio... \n",
|
| 269 |
+
"\n",
|
| 270 |
+
"[560 rows x 6 columns]"
|
| 271 |
+
]
|
| 272 |
+
},
|
| 273 |
+
"metadata": {},
|
| 274 |
+
"output_type": "display_data"
|
| 275 |
+
}
|
| 276 |
+
],
|
| 277 |
+
"source": [
|
| 278 |
+
"# Save to CSV or display DataFrame\n",
|
| 279 |
+
"df.to_csv('trace_runs.csv', index=False)\n",
|
| 280 |
+
"display(df)"
|
| 281 |
+
]
|
| 282 |
+
},
|
| 283 |
+
{
|
| 284 |
+
"cell_type": "code",
|
| 285 |
+
"execution_count": null,
|
| 286 |
+
"metadata": {},
|
| 287 |
+
"outputs": [],
|
| 288 |
+
"source": []
|
| 289 |
+
}
|
| 290 |
+
],
|
| 291 |
+
"metadata": {
|
| 292 |
+
"kernelspec": {
|
| 293 |
+
"display_name": ".venv",
|
| 294 |
+
"language": "python",
|
| 295 |
+
"name": "python3"
|
| 296 |
+
},
|
| 297 |
+
"language_info": {
|
| 298 |
+
"codemirror_mode": {
|
| 299 |
+
"name": "ipython",
|
| 300 |
+
"version": 3
|
| 301 |
+
},
|
| 302 |
+
"file_extension": ".py",
|
| 303 |
+
"mimetype": "text/x-python",
|
| 304 |
+
"name": "python",
|
| 305 |
+
"nbconvert_exporter": "python",
|
| 306 |
+
"pygments_lexer": "ipython3",
|
| 307 |
+
"version": "3.11.8"
|
| 308 |
+
}
|
| 309 |
+
},
|
| 310 |
+
"nbformat": 4,
|
| 311 |
+
"nbformat_minor": 2
|
| 312 |
+
}
|
starters.py
CHANGED
|
@@ -16,4 +16,3 @@ async def set_starters():
|
|
| 16 |
message="What is the 'maximum number of shares to be sold under the 10b5-1 Trading plan' by Brian Chesky?",
|
| 17 |
),
|
| 18 |
]
|
| 19 |
-
# ...
|
|
|
|
| 16 |
message="What is the 'maximum number of shares to be sold under the 10b5-1 Trading plan' by Brian Chesky?",
|
| 17 |
),
|
| 18 |
]
|
|
|
trace_runs.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|