MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / demo

Function demo

paperflow/cli.py:387–414  ·  view source on GitHub ↗

End-to-end demo using the bundled mock providers (no credentials needed).

()

Source from the content-addressed store, hash-verified

385
386@app.command()
387def demo() -> None:
388 """End-to-end demo using the bundled mock providers (no credentials needed)."""
389 os.environ.setdefault("PAPERFLOW_LLM_PROVIDER", "mock")
390 os.environ.setdefault("PAPERFLOW_EMBED_PROVIDER", "hash")
391
392 config = load_provider_config()
393 typer.echo("PaperFlow demo (deterministic, offline)")
394 typer.echo(f"Providers: {config.describe()}")
395
396 llm = build_llm_provider(config)
397 embed = build_embedding_provider(config)
398
399 response = llm.generate(
400 "Summarize PaperFlow in one sentence.",
401 system="You are a concise research assistant.",
402 )
403 typer.echo(f"\n[llm:{llm.name}:{llm.model}] {response.text}")
404
405 sample_texts = [
406 "Personalized paper recommendation with interest drift.",
407 "Multi-modal foundation models for scientific discovery.",
408 "Reinforcement learning from human feedback.",
409 ]
410 vectors = embed.embed_batch(sample_texts)
411 typer.echo(f"\n[embed:{embed.name}:{embed.model}] dim={embed.dimensions} batch={len(vectors)}")
412 for text, vector in zip(sample_texts, vectors):
413 preview = ", ".join(f"{value:+.3f}" for value in vector[:5])
414 typer.echo(f" - {text[:60]:<60} -> [{preview}, ...]")
415
416
417@app.command()

Callers

nothing calls this directly

Calls 6

load_provider_configFunction · 0.85
build_llm_providerFunction · 0.85
build_embedding_providerFunction · 0.85
describeMethod · 0.80
generateMethod · 0.45
embed_batchMethod · 0.45

Tested by

no test coverage detected