Compare commits
2 Commits
46685112cf
...
fe4d28278d
| Author | SHA1 | Date | |
|---|---|---|---|
| fe4d28278d | |||
| 8dbe8b5f25 |
@ -33,18 +33,23 @@ class AI(Protocol):
|
|||||||
The base class for AI clients.
|
The base class for AI clients.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
ID: str
|
||||||
name: str
|
name: str
|
||||||
config: AIConfig
|
config: AIConfig
|
||||||
|
|
||||||
def request(self,
|
def request(self,
|
||||||
question: Message,
|
question: Message,
|
||||||
context: Chat,
|
chat: Chat,
|
||||||
num_answers: int = 1,
|
num_answers: int = 1,
|
||||||
otags: Optional[set[Tag]] = None) -> AIResponse:
|
otags: Optional[set[Tag]] = None) -> AIResponse:
|
||||||
"""
|
"""
|
||||||
Make an AI request, asking the given question with the given
|
Make an AI request. Parameters:
|
||||||
context (i. e. chat history). The nr. of requested answers
|
* question: the question to ask
|
||||||
corresponds to the nr. of messages in the 'AIResponse'.
|
* chat: the chat history to be added as context
|
||||||
|
* num_answers: nr. of requested answers (corresponds
|
||||||
|
to the nr. of messages in the 'AIResponse')
|
||||||
|
* otags: the output tags, i. e. the tags that all
|
||||||
|
returned messages should contain
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ def question_cmd(args: argparse.Namespace, config: Config) -> None:
|
|||||||
db_path=Path(config.db))
|
db_path=Path(config.db))
|
||||||
# if it's a new question, create and store it immediately
|
# if it's a new question, create and store it immediately
|
||||||
if args.ask or args.create:
|
if args.ask or args.create:
|
||||||
|
# FIXME: add sources to the question
|
||||||
message = Message(question=Question(args.question),
|
message = Message(question=Question(args.question),
|
||||||
tags=args.ouput_tags, # FIXME
|
tags=args.ouput_tags, # FIXME
|
||||||
ai=args.ai,
|
ai=args.ai,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user