add replacement requests and fix GetEmbeddingSimilarSymbolsRequest
This commit is contained in:
1 parent
e4930b791e
commit
9722a8b3fa
2 files changed
+17
-3
No files matched your search
@@ -23,6 +23,7 @@ __all__ = [
|
||||
"GetSimilarWordRequest",
|
||||
"GetAllPhrasesResponse",
|
||||
"GetSimilarSymbolsRequest",
|
||||
"GetEmbeddingSimilarSymbolsRequest",
|
||||
"SearchSymbolsRequest",
|
||||
"GetSymbolsResponse",
|
||||
"ReplaceFinishedRequest",
|
||||
|
||||
+16
-3
@@ -61,15 +61,24 @@ class GetFullPhrasesResponse(ModifiedBaseModel):
|
||||
phrases: Optional[List[Phrase]]
|
||||
|
||||
class GetSimilarSymbolsRequest(ModifiedBaseModel):
|
||||
"""/replace: symbols to offer instead of `symbol`, which was shown for `word` in `sentence`."""
|
||||
limit: int = 3
|
||||
symbol: Symbol
|
||||
word: str
|
||||
sentence:str
|
||||
|
||||
language: Optional[str] = None # fallback language for a caller with no account config (see ConfigFetcher)
|
||||
|
||||
class GetEmbeddingSimilarSymbolsRequest(ModifiedBaseModel):
|
||||
"""Symbols nearest an embedding, leaving out the given words and symbols."""
|
||||
embedding: Embedding
|
||||
limit: int = 3
|
||||
exclude_word_ids: List[int] = []
|
||||
exclude_symbol_ids: List[int] = []
|
||||
|
||||
class SearchSymbolsRequest(ModifiedBaseModel):
|
||||
query: str
|
||||
limit: int = 8
|
||||
language: Optional[str] = None # fallback language for a caller with no account config (see ConfigFetcher)
|
||||
|
||||
|
||||
|
||||
@@ -94,11 +103,15 @@ class TextToSymbolResponse(ModifiedBaseModel):
|
||||
symbols: List[Symbol]
|
||||
|
||||
class ReplaceFinishedRequest(ModifiedBaseModel):
|
||||
"""A correction: the sentence as heard, and the labels before and after."""
|
||||
"""A correction: the sentence as heard, the word, and the symbols before and after (images left empty)."""
|
||||
sentence: str
|
||||
word: str
|
||||
original: Symbol
|
||||
replacement: Symbol
|
||||
language: str
|
||||
source: Literal["alternative", "search"] # the /replace alternatives, or the /search results
|
||||
rank: int # the replacement's position in the list it was picked from, from 0
|
||||
query: Optional[str] = None # the search text, for source "search"
|
||||
language: Optional[str] = None # fallback language for a caller with no account config (see ConfigFetcher)
|
||||
|
||||
#### Symbol hierarchy (jev translator) ####
|
||||
|
||||
|
||||
Reference in new issue
Block a user