Skip to content

Commit

Permalink
WIP - Update the Function class
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Feb 22, 2024
1 parent 71d598d commit acdb206
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions outlines/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TYPE_CHECKING, Callable, Optional, Tuple, Union

import requests
from pydantic import RootModel

from outlines import generate, models

Expand All @@ -11,6 +12,30 @@
from outlines.prompts import Prompt


class NewFunction:
"""Represents an Outlines function.
Functions are a convenient way to encapsulate a prompt template, a language
model and a Pydantic model that define the output structure. Once defined,
the function can be called with arguments that will be used to render the
prompt template.
"""

model: str
prompt_template: Optional[Callable] = None
pydantic_schema: Optional[RootModel] = None

def prompt(self, fn: Callable):
pass

def schema(self, model: RootModel):
pass

def __call__(self, *args, **kwargs):
pass


@dataclass
class Function:
"""Represents an Outlines function.
Expand Down

0 comments on commit acdb206

Please sign in to comment.