Skip to content

Commit

Permalink
Merge pull request #234 from tylerslaton/random-default-name
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerslaton authored Oct 18, 2024
2 parents ef2aa89 + bc29cf4 commit 33cca9a
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
104 changes: 104 additions & 0 deletions ui/admin/app/lib/service/nameGenerator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
const adjectives = [
"Smart",
"Clever",
"Intelligent",
"Adaptive",
"Intuitive",
"Helpful",
"Efficient",
"Responsive",
"Quick",
"Analytical",
"Logical",
"Creative",
"Innovative",
"Insightful",
"Proactive",
"Versatile",
"Agile",
"Brilliant",
"Capable",
"Diligent",
"Eloquent",
"Focused",
"Graceful",
"Harmonious",
"Imaginative",
"Judicious",
"Knowledgeable",
"Luminous",
"Meticulous",
"Nimble",
"Observant",
"Perceptive",
"Qualified",
"Reliable",
"Skillful",
"Thorough",
"Unstoppable",
"Vigilant",
"Wise",
"Expert",
"Yielding",
"Zealous",
"Astute",
"Balanced",
"Competent",
"Dynamic",
];

const nouns = [
"Assistant",
"Copilot",
"Helper",
"Companion",
"Aide",
"Collaborator",
"Partner",
"Advisor",
"Guide",
"Sidekick",
"Ally",
"Supporter",
"Mentor",
"Coach",
"Facilitator",
"Buddy",
"Agent",
"Beacon",
"Counselor",
"Dynamo",
"Enhancer",
"Friend",
"Genius",
"Hotshot",
"Innovator",
"Juggler",
"Keeper",
"Luminary",
"Mastermind",
"Navigator",
"Optimizer",
"Pathfinder",
"Quartermaster",
"Resolver",
"Sage",
"Trailblazer",
"Utility",
"Virtuoso",
"Whiz",
"Savant",
"Yoda",
"Zealot",
"Ace",
"Brainiac",
"Catalyst",
"Dynamo",
];

export function generateRandomName(): string {
const randomAdjective =
adjectives[Math.floor(Math.random() * adjectives.length)];
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
return `${randomAdjective} ${randomNoun}`;
}
5 changes: 4 additions & 1 deletion ui/admin/app/routes/_auth.agents._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useSWR from "swr";
import { Agent } from "~/lib/model/agents";
import { AgentService } from "~/lib/service/api/agentService";
import { ThreadsService } from "~/lib/service/api/threadsService";
import { generateRandomName } from "~/lib/service/nameGenerator";
import { timeSince } from "~/lib/utils";

import { TypographyP } from "~/components/Typography";
Expand Down Expand Up @@ -64,7 +65,9 @@ export default function Threads() {
className="justify-start"
onClick={() => {
AgentService.createAgent({
agent: {} as Agent,
agent: {
name: generateRandomName(),
} as Agent,
}).then((agent) => {
navigate(
$path("/agents/:agent", {
Expand Down

0 comments on commit 33cca9a

Please sign in to comment.