Skip to content

Conversation

@StrongMonkey
Copy link
Contributor

@StrongMonkey StrongMonkey commented Aug 14, 2024

This PR fixes creating assistance where slug has to be unique. It makes sure user can create assistance with the same name.

It also fixes other bugs where page is unnecessarily rendered that causes other network traffic.

Ignore all the formatter issues, i am going to have a separate PR after conference to add prettier and eslint config to the project.

#141

}
}

export async function getNewScriptName() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic of magically delecting assistant name is removed. Right now it defaults to New Assistant where user can have multiple.

})
})
const defaultName = "New Assistant";
const slug = defaultName.toLowerCase().replace(" ", "-") + "-" + Math.random().toString(36).substring(2, 7);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic of creating a unique slug per assistant by appending random 5 charaters.

id: scriptId,
}
// Only update slug when displayName has changed
if (existing?.displayName !== root.name) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here we only update the slug when displayName has changed.


return (
<div className={`h-full w-full ${className}`}>
{showAssistantName && <h1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the title where chat can have assitant name on the top

image

…ssues

Signed-off-by: Daishan Peng <daishan@acorn.io>
@StrongMonkey StrongMonkey merged commit bcdfdac into gptscript-ai:main Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants