Skip to content

Commit

Permalink
Extract lf.Template class from lf.LangFunc.
Browse files Browse the repository at this point in the history
This CL allows users to use `lf.Template` for render-only purposes. Besides, it makes `lf.LangFunc` cleaner by decoupling the rendering logic from LM calling logics.

PiperOrigin-RevId: 566423646
  • Loading branch information
daiyip authored and langfun authors committed Sep 18, 2023
1 parent 57d8bb0 commit 15c9330
Show file tree
Hide file tree
Showing 7 changed files with 1,049 additions and 977 deletions.
7 changes: 4 additions & 3 deletions langfun/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

# Interface for all langfun components.
from langfun.core.component import Component

from langfun.core.template import Template
from langfun.core.langfunc import LangFunc

# Decorator for set the positional init args for component.
Expand Down Expand Up @@ -56,9 +58,8 @@
from langfun.core.subscription import subscriptions
from langfun.core.subscription import clear_subscriptions

# LangFunc events.
from langfun.core.langfunc import LangFuncEvent
from langfun.core.langfunc import LangFuncRenderEvent
# Events
from langfun.core.template import TemplateRenderEvent
from langfun.core.langfunc import LangFuncCallEvent

# Helper methods for concurrent sampling.
Expand Down
Loading

0 comments on commit 15c9330

Please sign in to comment.