When rendering class definitions for prompt, base classes are no longer included in the prompts. This allows a base class to have a large list of subclasses, and include the ones only requested from type annotations. For example:
class A(pg.Object):
x: int
class B(A):
y: int
class C(B):
z: int
When querying B, the definition of B and C will be present (both x and y will be shown as members of B, and A will not show as the base class for B).
Introduce decorator lf.include_method_in_prompt to allow users to selectively include methods in type definitions during prompting. For example:
class Foo(pg.Object):
y: int
@lf.include_method_in_prompt
def __call__(self, x: int) -> int:
return x + self.y
Enhancements to Langfun schema system.
When rendering class definitions for prompt, base classes are no longer included in the prompts. This allows a base class to have a large list of subclasses, and include the ones only requested from type annotations. For example:
When querying
B
, the definition of B and C will be present (bothx
andy
will be shown as members of B, and A will not show as the base class for B).Introduce decorator
lf.include_method_in_prompt
to allow users to selectively include methods in type definitions during prompting. For example: