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

feat: prompt templates #335

Open
1 of 2 tasks
Tomas2D opened this issue Jan 28, 2025 · 2 comments · May be fixed by #380
Open
1 of 2 tasks

feat: prompt templates #335

Tomas2D opened this issue Jan 28, 2025 · 2 comments · May be fixed by #380
Assignees
Labels
python Python related functionality

Comments

@Tomas2D
Copy link
Contributor

Tomas2D commented Jan 28, 2025

Extend the current PromptTemplate class to match TS capabilities and mainly the interface.

TS version has the following features:

  • built on top of the Mustache templating system
  • supports for passing custom validation schema (zod, in Python it should be Pydantic)
  • add custom rendering/utility functions

TS implementation: https://github.com/i-am-bee/bee-agent-framework/blob/main/src/template.ts
TS test file: https://github.com/i-am-bee/bee-agent-framework/blob/main/src/template.test.ts

Checklist

  • unify interface
  • call the module template.py and PromptTemplate class
classDiagram
class PromptTemplate~T~ {
    #config: Required<PromptTemplateInput<T>>
    +validateInput(input: unknown): void
    +fork(customizer: Customizer<T, SchemaObject>): PromptTemplate<T>
    +fork(customizer: Customizer<T, R>): PromptTemplate<R>
    +fork(customizer: Inline): PromptTemplate<T | R>
    +render(input: PromptTemplateRenderInput<T, z.input<T>>): string
    +loadSnapshot(data: Inline): void
    +createSnapshot(): Inline
    +functions$: Inline
}
Loading
@michael-desmond michael-desmond self-assigned this Jan 31, 2025
@michael-desmond
Copy link
Contributor

This is done except for the ability to fork

@Tomas2D
Copy link
Contributor Author

Tomas2D commented Feb 18, 2025

Forking is needed for customization and for Agent Workflow that @xjacka is working on (PR: i-am-bee/bee-py#142)

@Tomas2D Tomas2D transferred this issue from another repository Feb 19, 2025
@Tomas2D Tomas2D assigned xjacka and unassigned michael-desmond Feb 19, 2025
@Tomas2D Tomas2D added the python Python related functionality label Feb 19, 2025
@Tomas2D Tomas2D added this to the Hackathon (python_v0.1.1) milestone Feb 19, 2025
@xjacka xjacka linked a pull request Feb 24, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python related functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants