-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This required a few more prompt updates to restrict random negations to supported negations. Later it shouldn't matter at all how a generated sentence is negated.
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
from ..database.engine import AsyncSession, get_async_session | ||
from .models import Pronoun, Sentence, Tense, DirectObject, IndirectPronoun, Negation | ||
|
||
async def get_sentence(verb_infinitive: str, | ||
pronoun: Pronoun = Pronoun.first_person, # Pronoun and tense will remain both random | ||
tense: Tense = Tense.present, # and correct for now. These values will be | ||
direct_object: DirectObject = DirectObject.none, # ignored. | ||
indirect_pronoun: IndirectPronoun = IndirectPronoun.none, | ||
negation: Negation = Negation.none, | ||
is_correct: bool = True, # This cannot be guaranteed until the AI has responded. | ||
openai_client: AsyncSession = get_async_session()): | ||
|
||
async with get_async_session() as session: | ||
# The sentence is returned as a DTO. | ||
pass | ||
|
||
async def save_sentence(sentence: Sentence): | ||
async with get_async_session() as session: | ||
session.add(sentence) | ||
await session.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters