prompt read from stdin
This commit is contained in:
@@ -48,6 +48,7 @@ def parse_args():
|
||||
mxg.add_argument("--pull")
|
||||
#mxg.add_argument("--chat", action=argparse.BooleanOptionalAction, default=True)
|
||||
mxg.add_argument("--response", action="store_true")
|
||||
mxg.add_argument("--instruct", action="store_true")
|
||||
mxg.add_argument("--endpoint",
|
||||
default="/api/chat",
|
||||
choices=[
|
||||
@@ -86,7 +87,7 @@ async def do_async_turn(conf):
|
||||
"""Do user->assistant turn streaming responses"""
|
||||
if not conf.prompt:
|
||||
prompt = Prompt.ask(f"[{str(bb.model)}]Ask {conf.model}»[/] [{str(bb.prompt)}]")
|
||||
if conf.response:
|
||||
if conf.response or conf.instruct:
|
||||
system_and_user = {
|
||||
"input": conf.prompt or prompt,
|
||||
"instructions": conf.system}
|
||||
@@ -143,6 +144,8 @@ async def do_async_turn(conf):
|
||||
|
||||
def main():
|
||||
conf = parse_args()
|
||||
if conf.prompt == "-"
|
||||
conf.prompt = sys.stdin.read()
|
||||
if conf.prompt:
|
||||
write(f"[{str(bb.model)}]Ask {conf.model}»[/] [{str(bb.prompt)}]{conf.prompt}[/]")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user