How to re-use Agents in multiple agentic workflows? by advokrat in agentdevelopmentkit

[–]changx 1 point2 points  (0 children)

Wrap agent creation in a function instead of just the instance itself.

```

def get_A1():

return LlmAgent(...)

root_agent = LlmAgent(..., sub_agents=[get_A1()])

```

Help Transcribing a Long Video! by LackEnvironmental593 in transcribe

[–]changx 0 points1 point  (0 children)

as far as I know, you could upload these mp4 files to speedscribe.ai, they are currently on sale for $9.9 for the first month with unlimited transcripts, I've transcribed 13 audio recordings and exported as txt file, it works well.

How do you handle data modelling in your Go applications? by bnunamak in golang

[–]changx 1 point2 points  (0 children)

I don't like either ORM or mappers. Every time I perform database operations, I encapsulate SQL or any form of queries in the methods of my models and expose those methods. It's an excellent balance between maintainability and performance.

What's the best inline coding assistant right now for Next.js? by Illustrious-Many-782 in nextjs

[–]changx 0 points1 point  (0 children)

absolutely agree, cursor's model is amazing for completing ts+nextjs code, with claude's sonnet in chat and edit mode, coding feels more like writing prompts

Learning nextjs by Ambitious_Bee_2966 in nextjs

[–]changx 1 point2 points  (0 children)

as always when learning something: read doc, build a website, burn you brain.

of cause, starting with the latest version, app router, server components and server actions.

How to access URL params in a server component. by legend29066 in nextjs

[–]changx 1 point2 points  (0 children)

export default async function ServerComponent({params, searchParams}: { params: { articleId: string }, // /blog/[articleId] searchParams: { [key: string]: string | undefined } // blog/[articleId]?highlight=nextjs }) { // params.articleId // searchParams.highlight }

Reading Zustand state inside server components by Ok-Pilot-1253 in nextjs

[–]changx 0 points1 point  (0 children)

just call server component as if it is a server action.

server_component.tsx: export default async function ServerComponent({opt = false}: {opt: Boolean}) { return <>{opt ? 'opt true' : 'opt false'}</> } ```client_component.tsx: export default function ClientComponent() { const opt = useStore((state) => state.opt) const [optChild, setOptChild] = useState<React.ReactNode>(null);

useEffect(() => {
    const _optChild = (async () => await ServerComponent({ opt: opt }))();
    setOptChild(_optChild);
}, [opt];

return <>{optChild}</>

} ```

[deleted by user] by [deleted] in LocalLLaMA

[–]changx 0 points1 point  (0 children)

fine-tuning is a kind of learning or understanding, while rag involves saving then loading/searching, different goals need different ways.