Skip to content

Convenient Function Wrappers #3

@cyl19970726

Description

@cyl19970726

Description

Create convenient function wrappers to simplify common use cases and improve developer experience when using the MiniAgent framework.

Tasks

StreamText Function

  • Create streamText() convenience function
  • Support simple text generation
  • Automatically select best Chat implementation
  • Provide configuration options

Target API Design

// Simple streaming text generation
const stream = streamText({
  prompt: "Hello, how are you?",
  model: "gpt-4",
  apiKey: "...",
});

for await (const chunk of stream) {
  console.log(chunk.text);
}

Other Convenience Functions

  • generateText() - Non-streaming text generation
  • chatWithTools() - Simplified tool calling
  • createAgent() - Quick agent creation

Benefits

  • Lower barrier to entry for new users
  • Reduced boilerplate code
  • Intuitive API design
  • Better developer experience

Implementation Notes

  • Functions should auto-detect and use appropriate Chat implementation (OpenAI, Gemini, etc.)
  • Provide sensible defaults while allowing customization
  • Maintain compatibility with existing framework

Priority

Medium 🔧

Labels

  • enhancement
  • developer-experience
  • api
  • documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions