LS Prompt Hub: Minor fixes

This commit is contained in:
vinodkiran
2023-12-06 12:53:43 +05:30
parent d397adb47a
commit 8122377bbb
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -1077,7 +1077,7 @@ export class App {
headers['x-api-key'] = decryptedCredentialData.langsmithApiKey
const tags = req.body.tags ? `tags=${req.body.tags}` : ''
const url = `https://web.hub.langchain.com/repos/?${tags}offset=0&limit=20&has_commits=true&sort_field=num_likes&sort_direction=desc&is_archived=false`
const url = `https://web.hub.langchain.com/repos/?${tags}has_commits=true&sort_field=num_likes&sort_direction=desc&is_archived=false`
axios.get(url, headers).then((response) => {
if (response.data.repos) {
return res.json({ status: 'OK', repos: response.data.repos })
@@ -181,7 +181,6 @@ const PromptLangsmithHubDialog = ({ promptType, show, onCancel, onSubmit }) => {
}
}
setSelectedPrompt(prompt)
await new Promise((resolve) => setTimeout(resolve, 500))
}
const fetchPrompts = async () => {
@@ -201,7 +200,7 @@ const PromptLangsmithHubDialog = ({ promptType, show, onCancel, onSubmit }) => {
})
if (createResp.data) {
setAvailablePrompNameList(createResp.data.repos)
if (createResp.data.repos?.length) handleListItemClick(0, createResp.data.repos)
if (createResp.data.repos?.length) await handleListItemClick(0, createResp.data.repos)
}
}