Skip to content

Commit

Permalink
feat: add random initial names for agents
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Oct 18, 2024
1 parent 4530f71 commit f0a52e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions ui/admin/app/lib/nameGenerator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 @@ -21,6 +21,7 @@ import {
TooltipTrigger,
} from "~/components/ui/tooltip";
import { useAsync } from "~/hooks/useAsync";
import { generateRandomName } from "~/lib/nameGenerator";

export default function Threads() {
const navigate = useNavigate();
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 f0a52e9

Please sign in to comment.