google / langfun

OO for LLMs
Apache License 2.0
124 stars 18 forks source link

Introduce `lf.generate_class`. #154

Closed copybara-service[bot] closed 6 months ago

copybara-service[bot] commented 6 months ago

Introduce lf.generate_class.

Usage:

lm = lf.llms.GeminiPro()
cls = lf.generate_class('Person', 'The basic description of a celebrity.', lm=lm)
lf.query('Who is Larry Page', cls, lm=lm)

This CL also introduces:

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 90.90909% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 95.96%. Comparing base (b316e8c) to head (9a809ab).

Files Patch % Lines
langfun/core/structured/schema_generation.py 82.60% 4 Missing and 4 partials :warning:
langfun/core/structured/schema.py 95.83% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #154 +/- ## ========================================== - Coverage 96.08% 95.96% -0.13% ========================================== Files 54 55 +1 Lines 4371 4434 +63 Branches 948 775 -173 ========================================== + Hits 4200 4255 +55 - Misses 86 90 +4 - Partials 85 89 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.