diff --git a/README.md b/README.md index 8b7932d..ff01f06 100644 --- a/README.md +++ b/README.md @@ -163,11 +163,11 @@ To support advanced capabilities such as branching, AgentKit offers API to dynam # Citing AgentKit ```bibtex -@article{wu2024agentkit, - title={AgentKit: Flow Engineering with Graphs, not Coding}, - author={Yue Wu and Yewen Fan and So Yeon Min and Shrimai Prabhumoye and Stephen McAleer and Yonatan Bisk and Ruslan Salakhutdinov and Yuanzhi Li and Tom Mitchell}, - year={2024}, - journal={arXiv preprint arXiv:2404.11483} +@inproceedings{agentkit, + title = {AgentKit: Flow Engineering with Graphs, not Coding}, + author = {Wu, Yue and Fan, Yewen and Min, So Yeon and Prabhumoye, Shrimai and McAleer, Stephen and Bisk, Yonatan and Salakhutdinov, Ruslan and Li, Yuanzhi and Mitchell, Tom}, + year = {2024}, + booktitle = {COLM}, } ``` diff --git a/docs/source/conf.py b/docs/source/conf.py index caac2bc..2076a27 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,7 @@ author = 'Yue Wu' release = '0.1' -version = '0.1.8' +version = '0.1.8.1' # -- General configuration diff --git a/setup.py b/setup.py index 981a06e..9c31b42 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import pathlib PKG_NAME = "agentkit-llm" -VERSION = "0.1.8" +VERSION = "0.1.8.1" EXTRAS = { "logging": ["wandb"], "proprietary": ["wandb", "openai", "anthropic", "tiktoken"], diff --git a/src/agentkit/base_node.py b/src/agentkit/base_node.py index 2a14d03..4d110a6 100644 --- a/src/agentkit/base_node.py +++ b/src/agentkit/base_node.py @@ -66,6 +66,7 @@ def __init__(self, key:str, prompt:str, graph:Graph, query_llm:Callable, compose self.after_query = after_query self.after_query.set_node(self) self.verbose = verbose + self.markdown = False self._add_error_msg = error_msg_fn if token_counter is not None: @@ -94,15 +95,24 @@ def compose_prompt(self): def _print_question(self): if self.verbose: - print(Fore.CYAN + "Prompt: " + Style.DIM + "{}".format(self.prompt) + Style.RESET_ALL) + if self.markdown: + print("\n### Prompt\n" + "\n{}\n".format(self.prompt)) + else: + print(Fore.CYAN + "Prompt: " + Style.DIM + "{}".format(self.prompt) + Style.RESET_ALL) def _print_answer(self, msg): if self.verbose: - print("Answer: " + Style.DIM + "{}".format(msg) + Style.RESET_ALL) + if self.markdown: + print("\n#### Answer\n" + "\n{}\n".format(msg)) + else: + print("Answer: " + Style.DIM + "{}".format(msg) + Style.RESET_ALL) def _print_skip(self): if self.verbose: - print("Skip: " + Style.DIM + "{}".format(self.prompt) + Style.RESET_ALL) + if self.markdown: + print("\n### Skip\n" + "{}".format(self.prompt)) + else: + print("Skip: " + Style.DIM + "{}".format(self.prompt) + Style.RESET_ALL) def skip_turn(self): """Temporarily skip the node evaluation. The previous result of the node will be reused. diff --git a/src/agentkit/node.py b/src/agentkit/node.py index edf8566..8d959c7 100644 --- a/src/agentkit/node.py +++ b/src/agentkit/node.py @@ -43,5 +43,11 @@ def compose_prompt(self): def _print_answer(self, msg): if self.verbose: if hasattr(self, 'db_retrieval_results') and len(self.db_retrieval_results) > 0: - print("DB operations: " + Style.DIM + Fore.BLUE + "{}".format(self.db_retrieval_results) + Style.RESET_ALL) - print("Answer: " + Style.DIM + "{}".format(msg) + Style.RESET_ALL) \ No newline at end of file + if self.markdown: + print(f"\n##### DB operations\n\n{self.db_retrieval_results}\n") + else: + print("DB operations: " + Style.DIM + Fore.BLUE + "{}".format(self.db_retrieval_results) + Style.RESET_ALL) + if self.markdown: + print("\n#### Answer\n\n{}\n".format(msg)) + else: + print("Answer: " + Style.DIM + "{}".format(msg) + Style.RESET_ALL) \ No newline at end of file