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 tool decorator to automatically document tools #64

Merged
merged 4 commits into from
Apr 24, 2023
Merged

Add tool decorator to automatically document tools #64

merged 4 commits into from
Apr 24, 2023

Conversation

rlouf
Copy link
Member

@rlouf rlouf commented Apr 21, 2023

Solves #62

import outlines

@outlines.tool
def repeat(word: str, n: int):
    """Tool description."""
    return word * n

@text.prompt
def my_prompt(fn):
    """COMMAND: {{fn.name}}, {{fn.description}}, args: {{fn.args}}"""

my_prompt(repeat)
# COMMAND: repeat, Tool description, arg: word: str, n:int

@rlouf rlouf force-pushed the functions branch 3 times, most recently from 110598b to 270b425 Compare April 23, 2023 20:29
@rlouf rlouf changed the title Add function decorator to automatically document functions Add tool decorator to automatically document tools Apr 23, 2023
@rlouf rlouf merged commit 4843125 into main Apr 24, 2023
@rlouf rlouf deleted the functions branch April 24, 2023 07:35
@rlouf rlouf linked an issue Apr 24, 2023 that may be closed by this pull request
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.

Auto-document functions using a decorator
1 participant