microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
ed12545127aaf69f97bf70c583fb7babb8ce190f

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

python/ta/demo.py

21lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4import asyncio
5import os
6
7import dotenv
8
9from typeagent.knowpro import convknowledge
10
11
12async def main():
13 dotenv.load_dotenv(os.path.expanduser("~/TypeAgent/ts/.env")) # TODO: Only works in dev tree
14 # for k, v in os.environ.items():
15 # if "KEY" in k:
16 # print(f"{k}={v!r}")
17 ke = convknowledge.KnowledgeExtractor()
18 print(await ke.extract("There is a book about hobbits called the Lord of the Rings."))
19
20
21asyncio.run(main())
22