Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom Text Generation Support #148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aya-Abdellatif
Copy link

This PR introduces CustomTextGenerator

A new text generation class that allows users to define their own text generation function. This enables custom logic for generating text, making Lida more flexible for various use cases.

Changes Introduced

  • New CustomTextGenerator Class
    • Accepts a text_generation_function: Callable[[str], str] to generate text based on a user-defined function.
    • Implements caching to reuse previously generated responses.
    • Includes token counting functionality via num_tokens_from_messages().

Why This is Useful

  • Enables custom text generation logic beyond built-in providers.
  • Improves flexibility for users integrating external models or APIs.

@Aya-Abdellatif
Copy link
Author

@microsoft-github-policy-service agree

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.

1 participant