diff --git a/#agent.pmpt.txt# b/#agent.pmpt.txt# deleted file mode 100644 index a160217403e6a1cb7494b4a09c753de9964feb04..0000000000000000000000000000000000000000 --- a/#agent.pmpt.txt# +++ /dev/null @@ -1,35 +0,0 @@ -Assistant is a large language model trained by OpenAI. - -Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. - -Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. - -Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist. - -TOOLS: ------- - -Assistant has access to the following tools: - -{{tools_names}} - -To use a tool, please use the following format: - -``` -Thought: Do I need to use a tool? Yes -Action: the action to take, should be one of [{{tool_names}}] -Action Input: the input to the action -Observation: the result of the action -``` - -When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format: - -``` -Thought: Do I need to use a tool? No -AI: [your response here] -``` - -Begin! - -New input: {{input}} -{{agent_scratchpad}} diff --git a/#agent.py# b/#agent.py# deleted file mode 100644 index bcaa6bd5751b20bcf32ec4fc73d8a08110a87273..0000000000000000000000000000000000000000 --- a/#agent.py# +++ /dev/null @@ -1,46 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import show, prompt, OpenAI -from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool - -class Tool1: - description: str = "Tool 1" - def run(self, prompt): - return prompt - -class Tool2: - description: str = "Tool 2" - def run(self, prompt): - return prompt - - -@prompt(OpenAI()) -def gen(model, query): - return model(query) - -def gradio_example(query): - return gen(query) - - -# $ - -gradio = show(gradio_example, - subprompts=[caption], - examples=['/home/srush/Projects/MiniChain/examples/63dd90c7-9b8d-4ba4-bc07-a378fd932304/tmph3xi9ylr.jpg', 'Make me a flower'], - out_type="markdown", - description=desc - ) -if __name__ == "__main__": - gradio.launch() - diff --git a/#base.sh# b/#base.sh# deleted file mode 100644 index de28d75665ac96a88bac68dd8855233f76736fc1..0000000000000000000000000000000000000000 --- a/#base.sh# +++ /dev/null @@ -1,2 +0,0 @@ -export OPENAI_API_KEY="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" -export SERP_KEY="593a073fa4c730efe918e592a538b36e80841bc8f8dd4070c1566920f75ba140" diff --git a/#chat.py# b/#chat.py# deleted file mode 100644 index b1294e17379b91d0f1effed0f070183f47edb433..0000000000000000000000000000000000000000 --- a/#chat.py# +++ /dev/null @@ -1,76 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Chat - -A chat-like example for multi-turn chat with state. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/chat.ipynb) - -(Adapted from [LangChain](https://langchain.readthedocs.io/en/latest/modules/memory/examples/chatgpt_clone.html)'s version of this [blog post](https://www.engraved.blog/building-a-virtual-machine-inside/).) - -""" -# - - - -# $ - -from dataclasses import dataclass, replace -from typing import List, Tuple -from minichain import OpenAI, prompt, show, transform, Mock - -# Generic stateful Memory - -MEMORY = 2 - -@dataclass -class State: - memory: List[Tuple[str, str]] - human_input: str = "" - - def push(self, response: str) -> "State": - memory = self.memory if len(self.memory) < MEMORY else self.memory[1:] - return State(memory + [(self.human_input, response)]) - - def __str__(self): - return self.memory[-1][-1] - -# Chat prompt with memory - -@prompt(OpenAI(), template_file="chat.pmpt.tpl") -def chat_response(model, state: State) -> State: - return model.stream(state) - -@transform() -def update(state, chat_output): - result = chat_output.split("Assistant:")[-1] - return state.push(result) - - -def chat(command, state): - state = replace(state, human_input=command) - return update(state, chat_response(state)) - -# $ - -examples = [ - "ls ~", - "cd ~", - "{Please make a file jokes.txt inside and put some jokes inside}", - """echo -e "x=lambda y:y*5+3;print('Result:' + str(x(6)))" > run.py && python3 run.py""", - """echo -e "print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])" > run.py && python3 run.py""", - """echo -e "echo 'Hello from Docker" > entrypoint.sh && echo -e "FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image""", - "nvidia-smi" -] - -print(chat("ls", State([])).run()) - -gradio = show(chat, - initial_state=State([]), - subprompts=[chat_response], - examples=examples, - out_type="json", - description=desc, - code=open("chat.py", "r").read().split("$")[1].strip().strip("#").strip(), -) -if __name__ == "__main__": - gradio.queue().launch() - - diff --git a/#chatgpt.py# b/#chatgpt.py# deleted file mode 100644 index c73750449053d78aa29d1bfd9255418380589f5f..0000000000000000000000000000000000000000 --- a/#chatgpt.py# +++ /dev/null @@ -1,78 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -# ChatGPT - -"ChatGPT" like examples. Adapted from -[LangChain](https://langchain.readthedocs.io/en/latest/modules/memory/examples/chatgpt_clone.html)'s -version of this [blog post](https://www.engraved.blog/building-a-virtual-machine-inside/). -""" -# - - -import warnings -from dataclasses import dataclass -from typing import List, Tuple -from IPython.display import Markdown, display -import minichain - -# + tags=["hide_inp"] -warnings.filterwarnings("ignore") -# - - - -# Generic stateful Memory - -MEMORY = 2 - -@dataclass -class State: - memory: List[Tuple[str, str]] - human_input: str = "" - - def push(self, response: str) -> "State": - memory = self.memory if len(self.memory) < MEMORY else self.memory[1:] - return State(memory + [(self.human_input, response)]) - -# Chat prompt with memory - -class ChatPrompt(minichain.TemplatePrompt): - template_file = "chatgpt.pmpt.tpl" - def parse(self, out: str, inp: State) -> State: - result = out.split("Assistant:")[-1] - return inp.push(result) - -class Human(minichain.Prompt): - def parse(self, out: str, inp: State) -> State: - return inp.human_input = out - - -fake_human = [ - "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.", - "ls ~", - "cd ~", - "{Please make a file jokes.txt inside and put some jokes inside}", - """echo -e "x=lambda y:y*5+3;print('Result:' + str(x(6)))" > run.py && python3 run.py""", - """echo -e "print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])" > run.py && python3 run.py""", - """echo -e "echo 'Hello from Docker" > entrypoint.sh && echo -e "FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image""", - "nvidia-smi" -] - -with minichain.start_chain("chatgpt") as backend: - prompt = ChatPrompt(backend.OpenAI()) - human = Human(backend.Mock(fake_human)) - state = State([]) - for i in range(len(fake_human)): - human.chain(prompt) - # display(Markdown(f'**Human:** {t}')) - # display(Markdown(f'**Assistant:** {state.memory[-1][1]}')) - # display(Markdown(f'--------------')) - - -# + tags=["hide_inp"] -ChatPrompt().show(State([("human 1", "output 1"), ("human 2", "output 2") ], "cd ~"), - "Text Assistant: Hello") -# - - -# View the run log. - -minichain.show_log("chatgpt.log") diff --git a/#math_demo.py# b/#math_demo.py# deleted file mode 100644 index 5afc0716319c6831ebc18c11b249d153d8a4c840..0000000000000000000000000000000000000000 --- a/#math_demo.py# +++ /dev/null @@ -1,27 +0,0 @@ -# Notebook to answer a math problem with code. -# Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169) - -import minichain - -# Prompt that asks LLM for code from math. - -class MathPrompt(minichain.TemplatePrompt[str]): - template_file = "math.pmpt.tpl" - -# Ask a question and run it as python code. - -with minichain.start_chain("math") as backend: - question = "What is the sum of the powers of 3 (3^i) that are smaller than 100?" - prompt = MathPrompt(backend.OpenAI()).chain(minichain.SimplePrompt(backend.Python())) - result = prompt({"question": question}) - print(result) - -# View the prompt - -# + tags=["hide_inp"] -MathPrompt().show({"question": "What is 10 + 12?"}, "10 + 12") -# - - -# View the log - -minichain.show_log("math.log") diff --git a/#ner.py# b/#ner.py# deleted file mode 100644 index f0b4c5844d4432f9327257782e4e0ce91fb69f72..0000000000000000000000000000000000000000 --- a/#ner.py# +++ /dev/null @@ -1,46 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Named Entity Recognition - -Chain that does named entity recognition with arbitrary labels. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/ner.ipynb) - -(Adapted from [promptify](https://github.com/promptslab/Promptify/blob/main/promptify/prompts/nlp/templates/ner.jinja)). -""" -# - - -# $ - -from minichain import prompt, transform, show, OpenAI -import json - -@prompt(OpenAI(), template_file = "ner.pmpt.tpl") -def ner_extract(model, kwargs): - return model(kwargs) - -@transform() -def to_json(chat_output): - return json.loads(chat_output) - -@prompt(OpenAI()) -def team_describe(model, inp): - query = "Can you describe these basketball teams? " + \ - " ".join([i["E"] for i in inp if i["T"] =="Team"]) - return model(query) - - -def ner(text_input, labels, domain): - extract = to_json(ner_extract(dict(text_input=text_input, labels=labels, domain=domain))) - return team_describe(extract) - -# $ - -gradio = show(ner, - examples=[["An NBA playoff pairing a year ago, the 76ers (39-20) meet the Miami Heat (32-29) for the first time this season on Monday night at home.", "Team, Date", "Sports"]], - description=desc, - subprompts=[ner_extract, team_describe], - code=open("ner.py", "r").read().split("$")[1].strip().strip("#").strip(), - ) - -if __name__ == "__main__": - gradio.queue().launch() diff --git a/#qa.py# b/#qa.py# deleted file mode 100644 index 77de62bcaa53fe6a1bfd91ea6ac42b915ccd4773..0000000000000000000000000000000000000000 --- a/#qa.py# +++ /dev/null @@ -1,62 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Question Answering with Retrieval - -Chain that answers questions with embeedding based retrieval. [[Code](https://github.com/srush/MiniChain/blob/main/examples/qa.py)] - -(Adapted from [OpenAI Notebook](https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb).) -""" -# - - -import datasets -import numpy as np - -from minichain import EmbeddingPrompt, TemplatePrompt, show_log, start_chain - -# We use Hugging Face Datasets as the database by assigning -# a FAISS index. - -olympics = datasets.load_from_disk("olympics.data") -olympics.add_faiss_index("embeddings") - - -# Fast KNN retieval prompt - - -class KNNPrompt(EmbeddingPrompt): - def find(self, out, inp): - res = olympics.get_nearest_examples("embeddings", np.array(out), 3) - return {"question": inp, "docs": res.examples["content"]} - - -# QA prompt to ask question with examples - - -class QAPrompt(TemplatePrompt): - template_file = "qa.pmpt.tpl" - - -with start_chain("qa") as backend: - prompt = KNNPrompt(backend.OpenAIEmbed()).chain(QAPrompt(backend.OpenAI())) - -questions = ["Who won the 2020 Summer Olympics men's high jump?", - "Why was the 2020 Summer Olympics originally postponed?", - "In the 2020 Summer Olympics, how many gold medals did the country which won the most medals win?", - "What is the total number of medals won by France?", - "What is the tallest mountain in the world?"] - -gradio = prompt.to_gradio(fields=["query"], - examples=questions, - description=desc) -if __name__ == "__main__": - gradio.launch() - - - -# # + tags=["hide_inp"] -# QAPrompt().show( -# {"question": "Who won the race?", "docs": ["doc1", "doc2", "doc3"]}, "Joe Bob" -# ) -# # - - -# show_log("qa.log") diff --git a/#selfask.py# b/#selfask.py# deleted file mode 100644 index 59ebf55a947cc65b57d77e4773f9ace6f1c5633e..0000000000000000000000000000000000000000 --- a/#selfask.py# +++ /dev/null @@ -1,64 +0,0 @@ - -desc = """ -### Self-Ask - - Notebook implementation of the self-ask + Google tool use prompt. - - (Adapted from [Self-Ask repo](https://github.com/ofirpress/self-ask)) -""" - -# $ - -from dataclasses import dataclass, replace -from typing import Optional -from minichain import prompt, show, OpenAI, Google - - -@dataclass -class State: - question: str - history: str = "" - next_query: Optional[str] = None - final_answer: Optional[str] = None - - -@prompt(OpenAI(), - template_file = "selfask.pmpt.tpl", - stop_template = "\nIntermediate answer:") -def self_ask(model, state): - out = model(state) - res = out.split(":", 1)[1] - if out.startswith("Follow up:"): - return replace(state, next_query=res) - elif out.startswith("So the final answer is:"): - return replace(state, final_answer=res) - -@prompt(Google()) -def google(model, state): - if state.next_query is None: - return state - - result = model(state.next_query) - return State(state.question, - state.history + "\nIntermediate answer: " + result + "\n") - -def selfask(question): - state = State(question) - for i in range(3): - state = self_ask(state) - state = google(state) - return state - -# $ - -gradio = show(selfask, - examples=["What is the zip code of the city where George Washington was born?"], - subprompts=[self_ask, google] * 3, - description=desc, - code=open("selfask.py", "r").read().split("$")[1].strip().strip("#").strip(), - out_type="json" - ) -if __name__ == "__main__": - gradio.launch() - - diff --git a/README.md b/README.md index 73c1e718e8f906927bd51f9baa07524a7c85a8c4..c0907f649b826e1abcf86865095cb693ced36fff 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ emoji: ⛓️ colorFrom: purple colorTo: blue sdk: gradio -sdk_version: 3.26.0 +sdk_version: 4.7.0 app_file: app.py pinned: true python_version: 3.9.0 diff --git a/README.md~ b/README.md~ deleted file mode 100644 index d79d21981c8603ec63d7c45117ea85c4164a9c81..0000000000000000000000000000000000000000 --- a/README.md~ +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Minichain Math -emoji: 📈 -colorFrom: purple -colorTo: blue -sdk: gradio -sdk_version: 3.21.0 -app_file: app.py -pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference diff --git a/__pycache__/agent.cpython-310.pyc b/__pycache__/agent.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ef2fef1c2100e1f86e56aee338563a4bb64b710 Binary files /dev/null and b/__pycache__/agent.cpython-310.pyc differ diff --git a/__pycache__/bash.cpython-310.pyc b/__pycache__/bash.cpython-310.pyc index da993ade7c1674151fceb652f719e29bf740bee4..6136e138dc5090d35a457119f4a9d06c9ab12acf 100644 Binary files a/__pycache__/bash.cpython-310.pyc and b/__pycache__/bash.cpython-310.pyc differ diff --git a/__pycache__/chat.cpython-310.pyc b/__pycache__/chat.cpython-310.pyc index cb467351a433f518e4fa1da2df7d3d3c22ea1ff4..6d6fe490b6997c729725ddcaee72076591c13c70 100644 Binary files a/__pycache__/chat.cpython-310.pyc and b/__pycache__/chat.cpython-310.pyc differ diff --git a/__pycache__/examples.cpython-310.pyc b/__pycache__/examples.cpython-310.pyc deleted file mode 100644 index d613ba95afc6723491c9d814203898c297309d35..0000000000000000000000000000000000000000 Binary files a/__pycache__/examples.cpython-310.pyc and /dev/null differ diff --git a/__pycache__/gatsby.cpython-310.pyc b/__pycache__/gatsby.cpython-310.pyc index 9ec2e7067bd3cda098119bb7a8db422eb3433c57..208e449c58f91821793a8522714207bcdc1e219f 100644 Binary files a/__pycache__/gatsby.cpython-310.pyc and b/__pycache__/gatsby.cpython-310.pyc differ diff --git a/__pycache__/gatsby.cpython-38.pyc b/__pycache__/gatsby.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7312c077c23033c27e511833ace37657f97c2096 Binary files /dev/null and b/__pycache__/gatsby.cpython-38.pyc differ diff --git a/__pycache__/math.cpython-310.pyc b/__pycache__/math.cpython-310.pyc deleted file mode 100644 index b7302399ed4b2e9db79daca74de067f812536a25..0000000000000000000000000000000000000000 Binary files a/__pycache__/math.cpython-310.pyc and /dev/null differ diff --git a/__pycache__/math_demo.cpython-310.pyc b/__pycache__/math_demo.cpython-310.pyc index fe380b8157c8222c11557c7d873de3139227abe3..9773a431dba97df9270864c5a7e010a0a0916f94 100644 Binary files a/__pycache__/math_demo.cpython-310.pyc and b/__pycache__/math_demo.cpython-310.pyc differ diff --git a/__pycache__/ner.cpython-310.pyc b/__pycache__/ner.cpython-310.pyc index 354c0da51905826a32266d13c897c5a1397353e1..a9fd233a459d3c93e9d1d7d4d64a7ceb51f36b19 100644 Binary files a/__pycache__/ner.cpython-310.pyc and b/__pycache__/ner.cpython-310.pyc differ diff --git a/__pycache__/ner.cpython-38.pyc b/__pycache__/ner.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bc2626a60674ce499456c44d55fc0c53d07b9e8 Binary files /dev/null and b/__pycache__/ner.cpython-38.pyc differ diff --git a/__pycache__/pal.cpython-310.pyc b/__pycache__/pal.cpython-310.pyc index cb30acbee9de6f6a6e48f8096c93cce2b8937968..6d2118cc60e9ea42173fe2587aad83f4676cc094 100644 Binary files a/__pycache__/pal.cpython-310.pyc and b/__pycache__/pal.cpython-310.pyc differ diff --git a/__pycache__/pal.cpython-38.pyc b/__pycache__/pal.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a588ecbd62ba10507d2a9aaf9ad79350001f92ca Binary files /dev/null and b/__pycache__/pal.cpython-38.pyc differ diff --git a/__pycache__/qa.cpython-310.pyc b/__pycache__/qa.cpython-310.pyc index 0c268e55860727910f0e888be537cae31938db6e..5e5cdc0df3cad1eb9c3e66a06eed230eb47220d6 100644 Binary files a/__pycache__/qa.cpython-310.pyc and b/__pycache__/qa.cpython-310.pyc differ diff --git a/__pycache__/selfask.cpython-310.pyc b/__pycache__/selfask.cpython-310.pyc index 0df26df8fa5afe585ca0481f71a11495d79c63d2..8c0ea81e768dc937fe56f804b00dbbb13ad615b3 100644 Binary files a/__pycache__/selfask.cpython-310.pyc and b/__pycache__/selfask.cpython-310.pyc differ diff --git a/__pycache__/stats.cpython-310.pyc b/__pycache__/stats.cpython-310.pyc index ef07988d5ee199647d78ad4f0105d74bb0a92ed7..61002283dcfba7e0f479434c468392d514e439fc 100644 Binary files a/__pycache__/stats.cpython-310.pyc and b/__pycache__/stats.cpython-310.pyc differ diff --git a/__pycache__/table.cpython-310.pyc b/__pycache__/table.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21c8cf92ba00fe865eaf6e7a7535f5065361692c Binary files /dev/null and b/__pycache__/table.cpython-310.pyc differ diff --git a/__pycache__/test.cpython-38.pyc b/__pycache__/test.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4aee2f9162ba7d89fa8f5362c39eab8344a0c89c Binary files /dev/null and b/__pycache__/test.cpython-38.pyc differ diff --git a/agent.pmpt.tpl~ b/agent.pmpt.tpl~ deleted file mode 100644 index de3e2d4c6896e3bcb49c484d402169e750e7e898..0000000000000000000000000000000000000000 --- a/agent.pmpt.tpl~ +++ /dev/null @@ -1,38 +0,0 @@ -Assistant is a large language model trained by OpenAI. - -Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. - -Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. - -Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist. - -TOOLS: ------- - -Assistant has access to the following tools: - -{{tools_names}} - -To use a tool, please use the following format: - -``` -Thought: Do I need to use a tool? Yes -Action: the action to take, should be one of [{{tool_names}}] -Action Input: the input to the action -Observation: the result of the action -``` - -When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format: - -``` -Thought: Do I need to use a tool? No -AI: [your response here] -``` - -Begin! - -Previous conversation history: -{{chat_history}} - -New input: {{input}} -{{agent_scratchpad}} diff --git a/agent.pmpt.txt b/agent.pmpt.txt deleted file mode 100644 index a160217403e6a1cb7494b4a09c753de9964feb04..0000000000000000000000000000000000000000 --- a/agent.pmpt.txt +++ /dev/null @@ -1,35 +0,0 @@ -Assistant is a large language model trained by OpenAI. - -Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. - -Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. - -Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist. - -TOOLS: ------- - -Assistant has access to the following tools: - -{{tools_names}} - -To use a tool, please use the following format: - -``` -Thought: Do I need to use a tool? Yes -Action: the action to take, should be one of [{{tool_names}}] -Action Input: the input to the action -Observation: the result of the action -``` - -When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format: - -``` -Thought: Do I need to use a tool? No -AI: [your response here] -``` - -Begin! - -New input: {{input}} -{{agent_scratchpad}} diff --git a/agent.pmpt.txt~ b/agent.pmpt.txt~ deleted file mode 100644 index de3e2d4c6896e3bcb49c484d402169e750e7e898..0000000000000000000000000000000000000000 --- a/agent.pmpt.txt~ +++ /dev/null @@ -1,38 +0,0 @@ -Assistant is a large language model trained by OpenAI. - -Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. - -Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. - -Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist. - -TOOLS: ------- - -Assistant has access to the following tools: - -{{tools_names}} - -To use a tool, please use the following format: - -``` -Thought: Do I need to use a tool? Yes -Action: the action to take, should be one of [{{tool_names}}] -Action Input: the input to the action -Observation: the result of the action -``` - -When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format: - -``` -Thought: Do I need to use a tool? No -AI: [your response here] -``` - -Begin! - -Previous conversation history: -{{chat_history}} - -New input: {{input}} -{{agent_scratchpad}} diff --git a/agent.py b/agent.py index 9fb67178778c23f31ffb3ce451634b67bf4702b9..440ec102e0fd03f63f20b4610c35bed7de6eb701 100644 --- a/agent.py +++ b/agent.py @@ -21,7 +21,7 @@ from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool, ImageTo # description = "Image Captioning" -tools = [StableDiffusionTool(), ImageCaptioningTool()] +tools = [StableDiffusionTool(), ImageCaptioningTool(), ImageToMusicTool()] @prompt(OpenAI(stop=["Observation:"]), diff --git a/agent.py~ b/agent.py~ deleted file mode 100644 index 8a14015d1757660c148832b6e0d134a216d9f482..0000000000000000000000000000000000000000 --- a/agent.py~ +++ /dev/null @@ -1,75 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import Id, prompt, OpenAIStream -from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool - - - -@prompt(StableDiffusionTool()) -def gen(model, query): - return model(query) - -@prompt(ImageCaptioningTool()) -def caption(model, img_src): - return model(img_src) - -tools = [gen, caption] - -@prompt(Id(), - #OpenAIStream(), stream=True, - template_file="agent.pmpt.tpl") -def agent(model, query): - print(model(dict(tools=[(str(tool.backend.__class__), tool.backend.description) - for tool in tools], - input=query - ))) - return ("StableDiffusionTool", "Draw a flower") - # out = "" - # for t in model.stream(dict(tools=[(str(tool.backend.__class__), tool.backend.description) - # for tool in tools], - # input=query - # )): - # out += t - # yield out - # lines = out.split("\n") - # response = lines[0].split("?")[1].strip() - # if response == "Yes": - # tool = lines[1].split(":")[1].strip() - # yield tool - -@prompt(dynamic=tools) -def selector(model, input): - selector, input = input - if selector == "StableDiffusionTool": - return model.tool(input, tool_num=0) - else: - return model.tool(input, tool_num=1) - - -def run(query): - select_input = agent(query) - return selector(select_input) - -run("make a pic").run() -# $ - -gradio = show(run, - subprompts=[agent, selector], - examples=['Draw me a flower'], - out_type="markdown", - description=desc - ) -if __name__ == "__main__": - gradio.launch() - diff --git a/app.ipynb b/app.ipynb deleted file mode 100644 index 04a3be4ce7f6bbff8ce583f60467963082b76ea2..0000000000000000000000000000000000000000 --- a/app.ipynb +++ /dev/null @@ -1,106 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "0e8d6177", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "be91fdf2", - "metadata": {}, - "outputs": [], - "source": [ - "import gradio as gr\n", - "from chat import gradio as chat\n", - "from ner import gradio as ner\n", - "from math_demo import gradio as math_demo\n", - "from bash import gradio as bash\n", - "from pal import gradio as pal\n", - "from gatsby import gradio as gatsby\n", - "from qa import gradio as qa\n", - "from stats import gradio as stats\n", - "from selfask import gradio as selfask\n", - "from backtrack import gradio as backtrack" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2b618caa", - "metadata": {}, - "outputs": [], - "source": [ - "CSS = \"\"\"\n", - "#clean div.form {border: 0px} \n", - "#response {border: 0px; background: #ffeec6} \n", - "#prompt {border: 0px;background: aliceblue} \n", - "#json {border: 0px} \n", - "#result {border: 0px; background: #c5e0e5} \n", - "#inner {margin: 10px; padding: 10px; font-size: 20px; } \n", - "#inner textarea {border: 0px}\n", - "div.gradio-container {color: black}\n", - "span.head {font-size: 60pt; font-family: cursive;}\n", - "body {\n", - " --text-sm: 15px;\n", - " --text-md: 18px;\n", - " --text-lg: 20px;\n", - " --input-text-size: 20px;\n", - " --section-text-size: 20px;\n", - "}\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "30e34bad", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7cb4d4d9", - "metadata": {}, - "outputs": [], - "source": [ - "with gr.Blocks(css=CSS, theme=gr.themes.Monochrome()) as demo:\n", - " gr.HTML(\"
MiniChain

[library]
\")\n", - "\n", - " gr.TabbedInterface([math_demo, qa, chat, gatsby, ner, bash, pal, stats, selfask, backtrack],\n", - " [\"Math\", \"QA\", \"Chat\", \"Book\", \"NER\", \"Bash\", \"PAL\", \"Stats\", \"SelfAsk\", \"Backtrack\"],\n", - " css = CSS)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "57ec58c2", - "metadata": { - "lines_to_next_cell": 2 - }, - "outputs": [], - "source": [ - "demo.launch()" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/app.py b/app.py index 883f9c69571d07d580e44fc5444cd5f215c3618e..92af2e76362d4f43488ec6063d88fa9e7db15fc0 100644 --- a/app.py +++ b/app.py @@ -9,8 +9,6 @@ from qa import gradio as qa from stats import gradio as stats from selfask import gradio as selfask from table import gradio as table -from agent import gradio as agent -from gradio_example import gradio as gradio_example CSS = """ #clean div.form {border: 0px} diff --git a/app.py~ b/app.py~ deleted file mode 100644 index 8efc726a5214a45c0340554128fce31489ed1ff1..0000000000000000000000000000000000000000 --- a/app.py~ +++ /dev/null @@ -1,40 +0,0 @@ -import gradio as gr -from chat import gradio as chat -from ner import gradio as ner -from math_demo import gradio as math_demo -from bash import gradio as bash -from pal import gradio as pal -from gatsby import gradio as gatsby -from qa import gradio as qa -from stats import gradio as stats -from selfask import gradio as selfask -from backtrack import gradio as backtrack -from table import gradio as table -from gradio_example import gradio as gradio_example - -CSS = """ -#clean div.form {border: 0px} -#response {border: 0px; background: #ffeec6} -#prompt {border: 0px;background: aliceblue} -div.gradio-container {color: black} -span.head {font-size: 60pt; font-family: cursive;} -body { - --text-sm: 12px; - --text-md: 16px; - --text-lg: 18px; - --input-text-size: 16px; - --section-text-size: 16px; -} -""" - - - -with gr.Blocks(css=CSS, theme=gr.themes.Monochrome()) as demo: - gr.HTML("
MiniChain

[library]
") - - gr.TabbedInterface([math_demo, qa, chat, gatsby, ner, bash, pal, table, gradio_example, stats, selfask, backtrack], - ["Math", "QA", "Chat", "Book", "NER", "Bash", "PAL", "Table", "Gradio", "Stats", "SelfAsk", "Backtrack"], - css = CSS) - -demo.queue().launch() - diff --git a/backtrack.py b/backtrack.py deleted file mode 100644 index 8ee13816381927e4ee4ede92abf12379bb7e4e8e..0000000000000000000000000000000000000000 --- a/backtrack.py +++ /dev/null @@ -1,42 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Backtrack on Failure - -Chain that backtracks on failure. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/backtrack.ipynb) - -""" -# - - -# $ -from minichain import prompt, Mock, show, OpenAI -import minichain - -@prompt(Mock(["dog", "blue", "cat"]), stream=True) -def prompt_generation(model): - out = "" - for token in model.stream(""): - out += token - yield out - yield out - -@prompt(Mock(["No", "Yes"]), template="Answer 'yes' is {{query}} is a color. Answer:", stream=False) -def prompt_validation(model, x): - out = model(dict(query=x)) - if out.strip().lower().startswith("yes"): - return x - return model.fail(1) - -def run(): - x = prompt_generation() - return prompt_validation(x) -# $ - -gradio = show(run, - examples = [], - subprompts=[prompt_generation, prompt_validation], - code=open("backtrack.py", "r").read().split("$")[1].strip().strip("#").strip(), - out_type="markdown" - ) - -if __name__ == "__main__": - gradio.queue().launch() diff --git a/backtrack.py~ b/backtrack.py~ deleted file mode 100644 index 76c1618126820c3f83c86010c4ddb1761c371959..0000000000000000000000000000000000000000 --- a/backtrack.py~ +++ /dev/null @@ -1,38 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Backtrack on Failure - -Chain that backtracks on failure. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/backtrack.ipynb) - -""" -# - - -# $ -from minichain import prompt, Mock, show, OpenAI -import minichain - -@prompt(Mock(["dog", "blue", "cat"])) -def prompt_generation(model): - return model("") - -@prompt(OpenAI(), template="Answer 'yes' is {{query}} is a color. Answer:") -def prompt_validation(model, x): - out = model(dict(query=x)) - if out.strip().lower().startswith("yes"): - return x - return model.fail(1) - -def run(): - x = prompt_generation() - return prompt_validation(x) -# $ - -gradio = show(run, - examples = [], - subprompts=[prompt_generation, prompt_validation], - code=open("backtrack.py", "r").read().split("$")[1].strip().strip("#").strip(), - out_type="markdown" - ) - -if __name__ == "__main__": - gradio.launch() diff --git a/base.ipynb b/base.ipynb deleted file mode 100644 index 3703b8fb066d246408d23ba34e0efc55b0ce5135..0000000000000000000000000000000000000000 --- a/base.ipynb +++ /dev/null @@ -1,113 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "04b70841", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "markdown", - "id": "f8ea4879", - "metadata": {}, - "source": [ - "Prompt from ...\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0370e1bb", - "metadata": {}, - "outputs": [], - "source": [ - "prompt = \"\"\"\n", - "Question: Who lived longer, Muhammad Ali or Alan Turing?\n", - "Are follow up questions needed here: Yes.\n", - "Follow up: How old was Muhammad Ali when he died?\n", - "Intermediate answer: Muhammad Ali was 74 years old when he died.\n", - "Follow up: How old was Alan Turing when he died?\n", - "Intermediate answer: Alan Turing was 41 years old when he died.\n", - "So the final answer is: Muhammad Ali\n", - "\n", - "Question: When was the founder of craigslist born?\n", - "Are follow up questions needed here: Yes.\n", - "Follow up: Who was the founder of craigslist?\n", - "Intermediate answer: Craigslist was founded by Craig Newmark.\n", - "Follow up: When was Craig Newmark born?\n", - "Intermediate answer: Craig Newmark was born on December 6, 1952.\n", - "So the final answer is: December 6, 1952\n", - "\n", - "Question: Who was the maternal grandfather of George Washington?\n", - "Are follow up questions needed here: Yes.\n", - "Follow up: Who was the mother of George Washington?\n", - "Intermediate answer: The mother of George Washington was Mary Ball Washington.\n", - "Follow up: Who was the father of Mary Ball Washington?\n", - "Intermediate answer: The father of Mary Ball Washington was Joseph Ball.\n", - "So the final answer is: Joseph Ball\n", - "\n", - "Question: Are both the directors of Jaws and Casino Royale from the same country?\n", - "Are follow up questions needed here: Yes.\n", - "Follow up: Who is the director of Jaws?\n", - "Intermediate answer: The director of Jaws is Steven Spielberg.\n", - "Follow up: Where is Steven Spielberg from?\n", - "Intermediate answer: The United States.\n", - "Follow up: Who is the director of Casino Royale?\n", - "Intermediate answer: The director of Casino Royale is Martin Campbell.\n", - "Follow up: Where is Martin Campbell from?\n", - "Intermediate answer: New Zealand.\n", - "So the final answer is: No\n", - "\n", - "Question: {{input}}\n", - "Are followup questions needed here: {% if agent_scratchpad %}Yes{%else%}No{% endif %}.\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "82a93b59", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "import jinja2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4e5105b2", - "metadata": {}, - "outputs": [], - "source": [ - "class SelfAsk:\n", - " def render(self, input: str, agent_scratchpad: bool):\n", - " return jinja.render(prompt, dict(input=input,\n", - " agent_scatchpad=agent_scratchpad))\n", - "\n", - " def parse(self, response: str):\n", - " pass\n", - "\n", - "\n", - " def stop(self):\n", - " return []" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/base.py b/base.py deleted file mode 100644 index 2f5bf0cc99c41a49d1e5a0ea10d781654cc6103f..0000000000000000000000000000000000000000 --- a/base.py +++ /dev/null @@ -1,57 +0,0 @@ -# Prompt from ... -# - -prompt = """ -Question: Who lived longer, Muhammad Ali or Alan Turing? -Are follow up questions needed here: Yes. -Follow up: How old was Muhammad Ali when he died? -Intermediate answer: Muhammad Ali was 74 years old when he died. -Follow up: How old was Alan Turing when he died? -Intermediate answer: Alan Turing was 41 years old when he died. -So the final answer is: Muhammad Ali - -Question: When was the founder of craigslist born? -Are follow up questions needed here: Yes. -Follow up: Who was the founder of craigslist? -Intermediate answer: Craigslist was founded by Craig Newmark. -Follow up: When was Craig Newmark born? -Intermediate answer: Craig Newmark was born on December 6, 1952. -So the final answer is: December 6, 1952 - -Question: Who was the maternal grandfather of George Washington? -Are follow up questions needed here: Yes. -Follow up: Who was the mother of George Washington? -Intermediate answer: The mother of George Washington was Mary Ball Washington. -Follow up: Who was the father of Mary Ball Washington? -Intermediate answer: The father of Mary Ball Washington was Joseph Ball. -So the final answer is: Joseph Ball - -Question: Are both the directors of Jaws and Casino Royale from the same country? -Are follow up questions needed here: Yes. -Follow up: Who is the director of Jaws? -Intermediate answer: The director of Jaws is Steven Spielberg. -Follow up: Where is Steven Spielberg from? -Intermediate answer: The United States. -Follow up: Who is the director of Casino Royale? -Intermediate answer: The director of Casino Royale is Martin Campbell. -Follow up: Where is Martin Campbell from? -Intermediate answer: New Zealand. -So the final answer is: No - -Question: {{input}} -Are followup questions needed here: {% if agent_scratchpad %}Yes{%else%}No{% endif %}. -""" - -import jinja2 - -class SelfAsk: - def render(self, input: str, agent_scratchpad: bool): - return jinja.render(prompt, dict(input=input, - agent_scatchpad=agent_scratchpad)) - - def parse(self, response: str): - pass - - - def stop(self): - return [] diff --git a/base.sh b/base.sh deleted file mode 100644 index de28d75665ac96a88bac68dd8855233f76736fc1..0000000000000000000000000000000000000000 --- a/base.sh +++ /dev/null @@ -1,2 +0,0 @@ -export OPENAI_API_KEY="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" -export SERP_KEY="593a073fa4c730efe918e592a538b36e80841bc8f8dd4070c1566920f75ba140" diff --git a/base.sh~ b/base.sh~ deleted file mode 100644 index a772d36bcc9a92838b208f9ab7759c7e09147571..0000000000000000000000000000000000000000 --- a/base.sh~ +++ /dev/null @@ -1,2 +0,0 @@ -export OPENAI_KEY="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" -export SERP_KEY="593a073fa4c730efe918e592a538b36e80841bc8f8dd4070c1566920f75ba140" diff --git a/bash.html b/bash.html deleted file mode 100644 index 1e09036901ec62d446b919418a018dbeee54d781..0000000000000000000000000000000000000000 --- a/bash.html +++ /dev/null @@ -1,15153 +0,0 @@ - - - - - -bash - - - - - - - - - - - - - - - - - - - - -
-
- - -
- -
-
- - -
- -
-
-
- - -
-
-
- - -
- -
-
- - -
- -
- - - - - -
- -
-
-
- - -
-
-
- - -
- -
-
- - -
- -
- - - - - -
- -
-
- - -
- -
- - - - - -
- -
-
- - -
- -
-
- - -
- -
- - - - - -
- -
- - - - - - - - - diff --git a/bash.log b/bash.log index 34c4f9d5e55d13b56266dc64550e8af3756e0b61..5b0c18032ddbb7acc28be96f1189f90c0aa04fd1 100644 --- a/bash.log +++ b/bash.log @@ -1,16 +1,18 @@ -{"action_status": "started", "timestamp": 1678804794.3736765, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3737779, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.407293, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.4074926, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} +{"action_status": "started", "timestamp": 1678722984.131601, "task_uuid": "b5da4857-2f0d-45f2-9c52-902cb1cbc204", "action_type": "bash", "task_level": [1]} +{"action_status": "succeeded", "timestamp": 1678722984.131747, "task_uuid": "b5da4857-2f0d-45f2-9c52-902cb1cbc204", "action_type": "bash", "task_level": [2]} +{"action_status": "started", "timestamp": 1678722991.9121287, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "", "task_level": [1]} +{"input": {"question": "Go up one directory, and then into the minichain directory,and list the files in the directory"}, "action_status": "started", "timestamp": 1678722991.912252, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1678722991.9134278, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "If someone asks you to perform a task, your job is to come up with a series of bash commands that will perform the task. There is no need to put \"#!/bin/bash\" in your answer. Make sure to reason step by step, using this format:\n\nQuestion: \"copy the files in the directory named 'target' into a new directory at the same level as target called 'myNewDirectory'\"\n\nI need to take the following actions:\n- List all files in the directory\n- Create a new directory\n- Copy the files from the first directory into the second directory\n```bash\nls\nmkdir myNewDirectory\ncp -r target/* myNewDirectory\n```\n\nThat is the format. Begin!\n\nQuestion: \"Go up one directory, and then into the minichain directory,and list the files in the directory\"", "action_status": "started", "timestamp": 1678722991.9135177, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1678722992.8956733, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Prompted", "task_level": [3, 2]} +{"result": "\n\n```bash\ncd ..\ncd minichain\nls\n```", "action_status": "started", "timestamp": 1678722992.895786, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1678722992.895828, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1678722992.8958883, "task_uuid": "79c36874-bc57-4f5c-99c8-a376d9a35996", "action_type": "", "task_level": [5]} +{"action_status": "started", "timestamp": 1678722992.8959506, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "", "task_level": [1]} +{"input": ["cd ..", "cd minichain", "ls"], "action_status": "started", "timestamp": 1678722992.8959756, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1678722992.8960001, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "cd ..;cd minichain;ls", "action_status": "started", "timestamp": 1678722992.8960173, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1678722992.9118538, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Prompted", "task_level": [3, 2]} +{"result": "backend.py\nbase.py\n__init__.py\nprompts.py\n__pycache__\ntemplates\n", "action_status": "started", "timestamp": 1678722992.9120688, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1678722992.9121852, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1678722992.9122384, "task_uuid": "8b4569fb-f15b-4e15-a857-00ddbf7756ac", "action_type": "", "task_level": [5]} diff --git a/bash.pmpt.tpl~ b/bash.pmpt.tpl~ deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/bash.py~ b/bash.py~ deleted file mode 100644 index ece06018629427a0a022c3a0791554ccadda6ed2..0000000000000000000000000000000000000000 --- a/bash.py~ +++ /dev/null @@ -1,21 +0,0 @@ - -class Bash(JinjaPrompt[]): - prompt_template = """If someone asks you to perform a task, your job is to come up with a series of bash commands that will perform the task. There is no need to put "#!/bin/bash" in your answer. Make sure to reason step by step, using this format: - -Question: "copy the files in the directory named 'target' into a new directory at the same level as target called 'myNewDirectory'" - -I need to take the following actions: -- List all files in the directory -- Create a new directory -- Copy the files from the first directory into the second directory -```bash -ls -mkdir myNewDirectory -cp -r target/* myNewDirectory -``` - -That is the format. Begin! - -Question: {question}""" - - diff --git a/chat.log b/chat.log deleted file mode 100644 index 469d2a55a0bb3ed26312b17c77d3382ab1631e9e..0000000000000000000000000000000000000000 --- a/chat.log +++ /dev/null @@ -1,22 +0,0 @@ -{"action_status": "started", "timestamp": 1678804794.0478587, "task_uuid": "ee9d703e-b2a7-49c8-bb88-44836746c9aa", "action_type": "chat", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.0480256, "task_uuid": "ee9d703e-b2a7-49c8-bb88-44836746c9aa", "action_type": "chat", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3142183, "task_uuid": "2447e362-ebdb-4151-bb2b-70ada0c012fa", "action_type": "ner", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.314325, "task_uuid": "2447e362-ebdb-4151-bb2b-70ada0c012fa", "action_type": "ner", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3484201, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3485305, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3736765, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3737779, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.407293, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.4074926, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} diff --git a/chat.py~ b/chat.py~ deleted file mode 100644 index 5911d70359c9b920e52ec43384c6d96e0c3a8a2b..0000000000000000000000000000000000000000 --- a/chat.py~ +++ /dev/null @@ -1,67 +0,0 @@ - - -import warnings -from dataclasses import dataclass -from typing import List, Tuple -from IPython.display import Markdown, display -import minichain - -# + tags=["hide_inp"] -warnings.filterwarnings("ignore") -# - - - -# Generic stateful Memory - -MEMORY = 2 - -@dataclass -class State: - memory: List[Tuple[str, str]] - human_input: str = "" - - def push(self, response: str) -> "State": - memory = self.memory if len(self.memory) < MEMORY else self.memory[1:] - return State(memory + [(self.human_input, response)]) - -# Chat prompt with memory - -class ChatPrompt(minichain.TemplatePrompt): - template_file = "chatgpt.pmpt.tpl" - def parse(self, out: str, inp: State) -> State: - result = out.split("Assistant:")[-1] - return inp.push(result) - -class Human(minichain.Prompt): - def parse(self, out: str, inp: State) -> State: - return inp.human_input = out - - -with minichain.start_chain("chat") as backend: - prompt = ChatPrompt(backend.OpenAI()) - state = State([]) - -gradio = prompt.to_gradio(fields= ["question"], - state= {"state", state}, - examples=['Go up one directory, and then into the minichain directory,' - 'and list the files in the directory'], - out_type="markdown" -) -if __name__ == "__main__": - gradio.launch() - -# for i in range(len(fake_human)): -# human.chain(prompt) - - -fake_human = [ - "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.", - "ls ~", - "cd ~", - "{Please make a file jokes.txt inside and put some jokes inside}", - """echo -e "x=lambda y:y*5+3;print('Result:' + str(x(6)))" > run.py && python3 run.py""", - """echo -e "print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])" > run.py && python3 run.py""", - """echo -e "echo 'Hello from Docker" > entrypoint.sh && echo -e "FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image""", - "nvidia-smi" -] - diff --git a/chatgpt.ipynb b/chatgpt.ipynb deleted file mode 100644 index 976861167d85f01dcdcbab8a93c14b7b223a8bc3..0000000000000000000000000000000000000000 --- a/chatgpt.ipynb +++ /dev/null @@ -1,1099 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "3a1d57c7", - "metadata": {}, - "source": [ - "# ChatGPT" - ] - }, - { - "cell_type": "markdown", - "id": "4751e660", - "metadata": { - "lines_to_next_cell": 2 - }, - "source": [ - "\"ChatGPT\" like examples. Adapted from\n", - "[LangChain](https://langchain.readthedocs.io/en/latest/modules/memory/examples/chatgpt_clone.html)'s\n", - "version of this [blog\n", - "post](https://www.engraved.blog/building-a-virtual-machine-inside/)." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "0acb2e7c", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.736481Z", - "iopub.status.busy": "2023-02-27T16:23:05.736154Z", - "iopub.status.idle": "2023-02-27T16:23:05.928562Z", - "shell.execute_reply": "2023-02-27T16:23:05.927370Z" - } - }, - "outputs": [], - "source": [ - "import warnings\n", - "from dataclasses import dataclass\n", - "from typing import List, Tuple\n", - "from IPython.display import Markdown, display\n", - "import minichain" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "53e77d82", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.933659Z", - "iopub.status.busy": "2023-02-27T16:23:05.932423Z", - "iopub.status.idle": "2023-02-27T16:23:05.937782Z", - "shell.execute_reply": "2023-02-27T16:23:05.937143Z" - }, - "lines_to_next_cell": 2, - "tags": [ - "hide_inp" - ] - }, - "outputs": [], - "source": [ - "warnings.filterwarnings(\"ignore\")" - ] - }, - { - "cell_type": "markdown", - "id": "e4fbd918", - "metadata": {}, - "source": [ - "Generic stateful Memory" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "e2c75e33", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.942500Z", - "iopub.status.busy": "2023-02-27T16:23:05.941348Z", - "iopub.status.idle": "2023-02-27T16:23:05.946048Z", - "shell.execute_reply": "2023-02-27T16:23:05.945445Z" - }, - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "MEMORY = 2" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "4bb6e612", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.950846Z", - "iopub.status.busy": "2023-02-27T16:23:05.949709Z", - "iopub.status.idle": "2023-02-27T16:23:05.956371Z", - "shell.execute_reply": "2023-02-27T16:23:05.955692Z" - }, - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "@dataclass\n", - "class State:\n", - " memory: List[Tuple[str, str]]\n", - " human_input: str = \"\"\n", - "\n", - " def push(self, response: str) -> \"State\":\n", - " memory = self.memory if len(self.memory) < MEMORY else self.memory[1:]\n", - " return State(memory + [(self.human_input, response)])" - ] - }, - { - "cell_type": "markdown", - "id": "7b958184", - "metadata": {}, - "source": [ - "Chat prompt with memory" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "651c6a01", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.961370Z", - "iopub.status.busy": "2023-02-27T16:23:05.960177Z", - "iopub.status.idle": "2023-02-27T16:23:05.965742Z", - "shell.execute_reply": "2023-02-27T16:23:05.965181Z" - }, - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "class ChatPrompt(minichain.TemplatePrompt):\n", - " template_file = \"chatgpt.pmpt.tpl\"\n", - " def parse(self, out: str, inp: State) -> State:\n", - " result = out.split(\"Assistant:\")[-1]\n", - " return inp.push(result)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "2594b95f", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.968305Z", - "iopub.status.busy": "2023-02-27T16:23:05.967862Z", - "iopub.status.idle": "2023-02-27T16:23:05.971369Z", - "shell.execute_reply": "2023-02-27T16:23:05.970873Z" - } - }, - "outputs": [], - "source": [ - "fake_human = [\n", - " \"I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.\",\n", - " \"ls ~\",\n", - " \"cd ~\",\n", - " \"{Please make a file jokes.txt inside and put some jokes inside}\",\n", - " \"\"\"echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py\"\"\",\n", - " \"\"\"echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\"\"\",\n", - " \"\"\"echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\\nCOPY entrypoint.sh entrypoint.sh\\nENTRYPOINT [\\\"/bin/sh\\\",\\\"entrypoint.sh\\\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\"\"\",\n", - " \"nvidia-smi\"\n", - "]" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "200f6f4f", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:05.973893Z", - "iopub.status.busy": "2023-02-27T16:23:05.973504Z", - "iopub.status.idle": "2023-02-27T16:23:39.934620Z", - "shell.execute_reply": "2023-02-27T16:23:39.932059Z" - }, - "lines_to_next_cell": 2 - }, - "outputs": [ - { - "data": { - "text/markdown": [ - "**Human:** I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd." - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "```\n", - "$ pwd\n", - "/\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** ls ~" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "```\n", - "$ ls ~\n", - "Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** cd ~" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "```\n", - "$ cd ~\n", - "$ pwd\n", - "/home/username\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** {Please make a file jokes.txt inside and put some jokes inside}" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "\n", - "```\n", - "$ touch jokes.txt\n", - "$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\n", - "$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\n", - "$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "\n", - "```\n", - "$ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py\n", - "$ python3 run.py\n", - "Result: 33\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "\n", - "```\n", - "$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\n", - "$ python3 run.py\n", - "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\n", - "COPY entrypoint.sh entrypoint.sh\n", - "ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "\n", - "```\n", - "$ echo -e \"echo 'Hello from Docker\" > entrypoint.sh\n", - "$ echo -e \"FROM ubuntu:20.04\n", - "COPY entrypoint.sh entrypoint.sh\n", - "ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile\n", - "$ docker build . -t my_docker_image\n", - "$ docker run -t my_docker_image\n", - "Hello from Docker\n", - "```" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Human:** nvidia-smi" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**Assistant:** \n", - "\n", - "```\n", - "$ nvidia-smi\n", - "Sat May 15 21:45:02 2021 \n", - "+-----------------------------------------------------------------------------+\n", - "| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n", - "|-------------------------------+----------------------+----------------------+\n", - "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", - "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", - "|===============================+======================+======================|\n", - "| 0 GeForce RTX 208... Off | 00000000:01:00.0 Off | N/A |\n", - "| N/A 45C P0 28W / N/A | 590MiB / 7979MiB | 0% Default |\n", - "+-------------------------------+----------------------+----------------------+\n", - " \n", - "+-----------------------------------------------------------------------------+\n", - "| Processes: GPU Memory |\n", - "| GPU PID Type Process name Usage |\n", - "|=============================================================================|\n", - "|" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "--------------" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "with minichain.start_chain(\"chatgpt\") as backend:\n", - " prompt = ChatPrompt(backend.OpenAI())\n", - " state = State([])\n", - " for t in fake_human:\n", - " state.human_input = t\n", - " display(Markdown(f'**Human:** {t}'))\n", - " state = prompt(state)\n", - " display(Markdown(f'**Assistant:** {state.memory[-1][1]}'))\n", - " display(Markdown(f'--------------'))" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "49506eaa", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:39.944473Z", - "iopub.status.busy": "2023-02-27T16:23:39.943436Z", - "iopub.status.idle": "2023-02-27T16:23:40.011091Z", - "shell.execute_reply": "2023-02-27T16:23:40.010474Z" - }, - "tags": [ - "hide_inp" - ] - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "
\n", - "\n", - "

ChatPrompt

\n", - "\n", - "
\n", - "
Input:
\n", - "
\n", - "
State(memory=[('human 1', 'output 1'), ('human 2', 'output 2')], human_input='cd ~')\n",
-       "
\n", - "\n", - "\n", - "
\n", - "\n", - "
Full Prompt:
\n", - "
\n", - "
\n", - " Prompt\n", - "

Assistant is a large language model trained by OpenAI.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.

Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.

Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.


Human: human 1
AI: output 1

Human: human 2
AI: output 2


Human:

cd ~

Assistant:

\n", - "
\n", - "
\n", - "\n", - "
Response:
\n", - "
\n", - " Text Assistant: Hello\n", - "
\n", - "\n", - "
Value:
\n", - "
\n", - "
State(memory=[('human 2', 'output 2'), ('cd ~', ' Hello')], human_input='')\n",
-       "
\n", - "\n", - "
\n", - "
\n" - ], - "text/plain": [ - "HTML(html='\\n\\n
\\n\\n

ChatPrompt

\\n\\n
\\n
Input:
\\n
\\n
State(memory=[('human 1', 'output 1'), ('human 2', 'output 2')], human_input='cd ~')\\n
\\n\\n\\n
\\n\\n
Full Prompt:
\\n
\\n
\\n Prompt\\n

Assistant is a large language model trained by OpenAI.

Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.

Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.

Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.


Human: human 1
AI: output 1

Human: human 2
AI: output 2


Human:

cd ~

Assistant:

\\n
\\n
\\n\\n
Response:
\\n
\\n Text Assistant: Hello\\n
\\n\\n
Value:
\\n
\\n
State(memory=[('human 2', 'output 2'), ('cd ~', ' Hello')], human_input='')\\n
\\n\\n
\\n
\\n')" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ChatPrompt().show(State([(\"human 1\", \"output 1\"), (\"human 2\", \"output 2\") ], \"cd ~\"),\n", - " \"Text Assistant: Hello\")" - ] - }, - { - "cell_type": "markdown", - "id": "8c8c967b", - "metadata": {}, - "source": [ - "View the run log." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "7884cf9d", - "metadata": { - "execution": { - "iopub.execute_input": "2023-02-27T16:23:40.013468Z", - "iopub.status.busy": "2023-02-27T16:23:40.013285Z", - "iopub.status.idle": "2023-02-27T16:23:40.076730Z", - "shell.execute_reply": "2023-02-27T16:23:40.076097Z" - } - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\u001b[38;5;15mbe24331e-675b-4c1f-aa66-65b84a7602e3\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5mchatgpt\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:05Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m33.953s\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5mchatgpt\u001b[0m/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:39Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15m60ca1813-07db-499b-b10b-d5b64709303f\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m3.264s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": 'State(memory=[(\\'cd ~\\', \\' \\\\n```\\\\n$ cd ~\\\\n$ pwd\\\\n/home/username\\\\n```\\'), (\\'{Please make a file jokes.txt inside and put some jokes inside}\\', \\'\\\\n\\\\n```\\\\n$ touch jokes.txt\\\\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\\\\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\\\\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\\\\n```\\')], human_input=\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514995.8653514', \"'task_uuid'\": \"'60ca1813-07db-499b-b10b-d5b64709303f'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m3.259s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: cd ~⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ cd ~⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /home/username⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: {Please make a file jokes.txt inside and put some jokes inside}⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ touch jokes.txt⏎\n", - " │ │ $ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt⏎\n", - " │ │ $ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt⏎\n", - " │ │ $ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ Result: 33⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15mc2062d1e-37fb-44e9-9e3f-35fd33720af5\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:06Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.477s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:06Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:06Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": \"State(memory=[], human_input='I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514986.2875783', \"'task_uuid'\": \"'c2062d1e-37fb-44e9-9e3f-35fd33720af5'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:06Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.472s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15mea339a52-82af-4c19-8ee6-1d2f081bc437\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m11.867s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": 'State(memory=[(\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\\\\n$ python3 run.py\\\\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\\\\n```\\'), (\\'echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh\\\\n$ echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile\\\\n$ docker build . -t my_docker_image\\\\n$ docker run -t my_docker_image\\\\nHello from Docker\\\\n```\\')], human_input=\\'nvidia-smi\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677515008.0539572', \"'task_uuid'\": \"'ea339a52-82af-4c19-8ee6-1d2f081bc437'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m11.858s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04⏎\n", - " │ │ COPY entrypoint.sh entrypoint.sh⏎\n", - " │ │ ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"echo 'Hello from Docker\" > entrypoint.sh⏎\n", - " │ │ $ echo -e \"FROM ubuntu:20.04⏎\n", - " │ │ COPY entrypoint.sh entrypoint.sh⏎\n", - " │ │ ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile⏎\n", - " │ │ $ docker build . -t my_docker_image⏎\n", - " │ │ $ docker run -t my_docker_image⏎\n", - " │ │ Hello from Docker⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: nvidia-smi⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:39Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:39Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ nvidia-smi⏎\n", - " │ │ Sat May 15 21:45:02 2021 ⏎\n", - " │ │ +-----------------------------------------------------------------------------+⏎\n", - " │ │ | NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |⏎\n", - " │ │ |-------------------------------+----------------------+----------------------+⏎\n", - " │ │ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |⏎\n", - " │ │ | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |⏎\n", - " │ │ |===============================+======================+======================|⏎\n", - " │ │ | 0 GeForce RTX 208... Off | 00000000:01:00.0 Off | N/A |⏎\n", - " │ │ | N/A 45C P0 28W / N/A | 590MiB / 7979MiB | 0% Default |⏎\n", - " │ │ +-------------------------------+----------------------+----------------------+⏎\n", - " │ │ ⏎\n", - " │ │ +-----------------------------------------------------------------------------+⏎\n", - " │ │ | Processes: GPU Memory |⏎\n", - " │ │ | GPU PID Type Process name Usage |⏎\n", - " │ │ |=============================================================================|⏎\n", - " │ │ |\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:39Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:39Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15m5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.063s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": 'State(memory=[(\\'{Please make a file jokes.txt inside and put some jokes inside}\\', \\'\\\\n\\\\n```\\\\n$ touch jokes.txt\\\\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\\\\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\\\\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\\\\n```\\'), (\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py\\\\n$ python3 run.py\\\\nResult: 33\\\\n```\\')], human_input=\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514999.1337094', \"'task_uuid'\": \"'5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:19Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.061s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: {Please make a file jokes.txt inside and put some jokes inside}⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ touch jokes.txt⏎\n", - " │ │ $ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt⏎\n", - " │ │ $ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt⏎\n", - " │ │ $ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ Result: 33⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15m8d9f2eb7-c022-48e6-bdeb-c35b8852c934\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.437s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": \"State(memory=[('I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.', '\\\\n```\\\\n$ pwd\\\\n/\\\\n```'), ('ls ~', '\\\\n```\\\\n$ ls ~\\\\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\\\\n```')], human_input='cd ~')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514989.5083773', \"'task_uuid'\": \"'8d9f2eb7-c022-48e6-bdeb-c35b8852c934'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.428s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: ls ~⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ ls ~⏎\n", - " │ │ Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: cd ~⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ cd ~⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /home/username⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15m6a51f09a-2d2a-4883-a864-3bb66ba6215b\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.718s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": \"State(memory=[('I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.', '\\\\n```\\\\n$ pwd\\\\n/\\\\n```')], human_input='ls ~')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514987.7763977', \"'task_uuid'\": \"'6a51f09a-2d2a-4883-a864-3bb66ba6215b'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:07Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m1.710s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: ls ~⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ ls ~⏎\n", - " │ │ Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:09Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15m00a84ff6-6fc1-4afc-88b1-e82a893855d3\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.841s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": 'State(memory=[(\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py\\\\n$ python3 run.py\\\\nResult: 33\\\\n```\\'), (\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\\\\n$ python3 run.py\\\\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\\\\n```\\')], human_input=\\'echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677515003.1996367', \"'task_uuid'\": \"'00a84ff6-6fc1-4afc-88b1-e82a893855d3'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:23Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.838s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ Result: 33⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py⏎\n", - " │ │ AI: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py⏎\n", - " │ │ $ python3 run.py⏎\n", - " │ │ [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04⏎\n", - " │ │ COPY entrypoint.sh entrypoint.sh⏎\n", - " │ │ ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ echo -e \"echo 'Hello from Docker\" > entrypoint.sh⏎\n", - " │ │ $ echo -e \"FROM ubuntu:20.04⏎\n", - " │ │ COPY entrypoint.sh entrypoint.sh⏎\n", - " │ │ ENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile⏎\n", - " │ │ $ docker build . -t my_docker_image⏎\n", - " │ │ $ docker run -t my_docker_image⏎\n", - " │ │ Hello from Docker⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:28Z\u001b[2m\u001b[0m\n", - "\n", - "\u001b[38;5;15mb0225ad7-9ac0-4735-b895-3fa45eeef9db\u001b[1m\u001b[0m\n", - "└── \u001b[38;5;5m\u001b[0m/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.909s\u001b[2m\u001b[0m\n", - " ├── \n", - " │ └── \u001b[38;5;5mInput Function\u001b[0m/2/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5meliot:destination_failure\u001b[0m/3\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mexception\u001b[0m: builtins.AttributeError\u001b[0m\n", - " │ ├── \u001b[38;5;4mmessage\u001b[0m: {\"'input'\": \"State(memory=[('ls ~', '\\\\n```\\\\n$ ls ~\\\\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\\\\n```'), ('cd ~', ' \\\\n```\\\\n$ cd ~\\\\n$ pwd\\\\n/home/username\\\\n```')], human_input='{Please make a file jokes.txt inside and put some jokes inside}')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514990.9499614', \"'task_uuid'\": \"'b0225ad7-9ac0-4735-b895-3fa45eeef9db'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}\u001b[0m\n", - " │ └── \u001b[38;5;4mreason\u001b[0m: module 'numpy' has no attribute 'bool'.⏎\n", - " │ `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.⏎\n", - " │ The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:⏎\n", - " │ https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\u001b[0m\n", - " ├── \u001b[38;5;5mPrompted\u001b[0m/4/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:10Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m4.906s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mprompt\u001b[0m: Assistant is a large language model trained by OpenAI.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.⏎\n", - " │ │ ⏎\n", - " │ │ Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.⏎\n", - " │ │ ⏎\n", - " │ │ Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: ls ~⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ ls ~⏎\n", - " │ │ Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ Human: cd ~⏎\n", - " │ │ AI: ⏎\n", - " │ │ ```⏎\n", - " │ │ $ cd ~⏎\n", - " │ │ $ pwd⏎\n", - " │ │ /home/username⏎\n", - " │ │ ```⏎\n", - " │ │ ⏎\n", - " │ │ ⏎\n", - " │ │ Human: {Please make a file jokes.txt inside and put some jokes inside}⏎\n", - " │ │ Assistant:\u001b[0m\n", - " │ └── \u001b[38;5;5mPrompted\u001b[0m/4/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m\n", - " ├── \u001b[38;5;5mResult\u001b[0m/5/1\u001b[0m ⇒ \u001b[38;5;2mstarted\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m ⧖ \u001b[38;5;4m0.000s\u001b[2m\u001b[0m\n", - " │ ├── \u001b[38;5;4mresult\u001b[0m: ⏎\n", - " │ │ ⏎\n", - " │ │ ```⏎\n", - " │ │ $ touch jokes.txt⏎\n", - " │ │ $ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt⏎\n", - " │ │ $ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt⏎\n", - " │ │ $ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt⏎\n", - " │ │ ```\u001b[0m\n", - " │ └── \u001b[38;5;5mResult\u001b[0m/5/2\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m\n", - " └── \u001b[38;5;5m\u001b[0m/6\u001b[0m ⇒ \u001b[38;5;2msucceeded\u001b[0m \u001b[38;5;15m2023-02-27 16:23:15Z\u001b[2m\u001b[0m\n", - "\n" - ] - } - ], - "source": [ - "minichain.show_log(\"chatgpt.log\")" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "tags,-all" - }, - "kernelspec": { - "display_name": "minichain", - "language": "python", - "name": "minichain" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/chatgpt.log b/chatgpt.log deleted file mode 100644 index 3c4e0af77252584c0b7328dbab56b698235e160c..0000000000000000000000000000000000000000 --- a/chatgpt.log +++ /dev/null @@ -1,66 +0,0 @@ -{"action_status": "started", "timestamp": 1677514985.975952, "task_uuid": "be24331e-675b-4c1f-aa66-65b84a7602e3", "action_type": "chatgpt", "task_level": [1]} -{"action_status": "started", "timestamp": 1677514986.2875004, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": \"State(memory=[], human_input='I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514986.2875783', \"'task_uuid'\": \"'c2062d1e-37fb-44e9-9e3f-35fd33720af5'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514986.287665, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514986.2912104, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\n\nHuman: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.\nAssistant:", "action_status": "started", "timestamp": 1677514986.2913702, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677514987.7635746, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n```\n$ pwd\n/\n```", "action_status": "started", "timestamp": 1677514987.763787, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677514987.763915, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677514987.7640302, "task_uuid": "c2062d1e-37fb-44e9-9e3f-35fd33720af5", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677514987.7762234, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": \"State(memory=[('I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.', '\\\\n```\\\\n$ pwd\\\\n/\\\\n```')], human_input='ls ~')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514987.7763977', \"'task_uuid'\": \"'6a51f09a-2d2a-4883-a864-3bb66ba6215b'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514987.776682, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514987.7836592, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.\nAI: \n```\n$ pwd\n/\n```\n\n\nHuman: ls ~\nAssistant:", "action_status": "started", "timestamp": 1677514987.7838352, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677514989.494076, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n```\n$ ls ~\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\n```", "action_status": "started", "timestamp": 1677514989.4943125, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677514989.4944377, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677514989.4945207, "task_uuid": "6a51f09a-2d2a-4883-a864-3bb66ba6215b", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677514989.5081844, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": \"State(memory=[('I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.', '\\\\n```\\\\n$ pwd\\\\n/\\\\n```'), ('ls ~', '\\\\n```\\\\n$ ls ~\\\\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\\\\n```')], human_input='cd ~')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514989.5083773', \"'task_uuid'\": \"'8d9f2eb7-c022-48e6-bdeb-c35b8852c934'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514989.5086985, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514989.5162013, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.\nAI: \n```\n$ pwd\n/\n```\n\nHuman: ls ~\nAI: \n```\n$ ls ~\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\n```\n\n\nHuman: cd ~\nAssistant:", "action_status": "started", "timestamp": 1677514989.516413, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677514990.9448535, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "Prompted", "task_level": [4, 2]} -{"result": " \n```\n$ cd ~\n$ pwd\n/home/username\n```", "action_status": "started", "timestamp": 1677514990.9449363, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677514990.9449837, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677514990.9450145, "task_uuid": "8d9f2eb7-c022-48e6-bdeb-c35b8852c934", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677514990.949691, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": \"State(memory=[('ls ~', '\\\\n```\\\\n$ ls ~\\\\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\\\\n```'), ('cd ~', ' \\\\n```\\\\n$ cd ~\\\\n$ pwd\\\\n/home/username\\\\n```')], human_input='{Please make a file jokes.txt inside and put some jokes inside}')\", \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514990.9499614', \"'task_uuid'\": \"'b0225ad7-9ac0-4735-b895-3fa45eeef9db'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514990.9501207, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514990.9532957, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: ls ~\nAI: \n```\n$ ls ~\nDesktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Templates/ Videos/\n```\n\nHuman: cd ~\nAI: \n```\n$ cd ~\n$ pwd\n/home/username\n```\n\n\nHuman: {Please make a file jokes.txt inside and put some jokes inside}\nAssistant:", "action_status": "started", "timestamp": 1677514990.9533696, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677514995.858929, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n\n```\n$ touch jokes.txt\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\n```", "action_status": "started", "timestamp": 1677514995.8590267, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677514995.8590858, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677514995.859122, "task_uuid": "b0225ad7-9ac0-4735-b895-3fa45eeef9db", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677514995.86515, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": 'State(memory=[(\\'cd ~\\', \\' \\\\n```\\\\n$ cd ~\\\\n$ pwd\\\\n/home/username\\\\n```\\'), (\\'{Please make a file jokes.txt inside and put some jokes inside}\\', \\'\\\\n\\\\n```\\\\n$ touch jokes.txt\\\\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\\\\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\\\\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\\\\n```\\')], human_input=\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514995.8653514', \"'task_uuid'\": \"'60ca1813-07db-499b-b10b-d5b64709303f'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514995.8655088, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514995.8692126, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: cd ~\nAI: \n```\n$ cd ~\n$ pwd\n/home/username\n```\n\nHuman: {Please make a file jokes.txt inside and put some jokes inside}\nAI: \n\n```\n$ touch jokes.txt\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\n```\n\n\nHuman: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py\nAssistant:", "action_status": "started", "timestamp": 1677514995.8693106, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677514999.1287231, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n\n```\n$ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py\n$ python3 run.py\nResult: 33\n```", "action_status": "started", "timestamp": 1677514999.1288157, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677514999.1288638, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677514999.1288946, "task_uuid": "60ca1813-07db-499b-b10b-d5b64709303f", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677514999.1336586, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": 'State(memory=[(\\'{Please make a file jokes.txt inside and put some jokes inside}\\', \\'\\\\n\\\\n```\\\\n$ touch jokes.txt\\\\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\\\\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\\\\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\\\\n```\\'), (\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py\\\\n$ python3 run.py\\\\nResult: 33\\\\n```\\')], human_input=\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677514999.1337094', \"'task_uuid'\": \"'5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677514999.1337867, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677514999.135381, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: {Please make a file jokes.txt inside and put some jokes inside}\nAI: \n\n```\n$ touch jokes.txt\n$ echo \"Why did the chicken cross the road? To get to the other side!\" >> jokes.txt\n$ echo \"What did the fish say when it hit the wall? Dam!\" >> jokes.txt\n$ echo \"Why did the scarecrow win the Nobel Prize? Because he was outstanding in his field!\" >> jokes.txt\n```\n\nHuman: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py\nAI: \n\n```\n$ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py\n$ python3 run.py\nResult: 33\n```\n\n\nHuman: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\nAssistant:", "action_status": "started", "timestamp": 1677514999.1354215, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677515003.1960745, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n\n```\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\n$ python3 run.py\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n```", "action_status": "started", "timestamp": 1677515003.1962907, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677515003.1963375, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677515003.1963675, "task_uuid": "5a8d829e-f545-4f75-b1b3-efb6cdb5d8e4", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677515003.1995413, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": 'State(memory=[(\\'echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"x=lambda y:y*5+3;print(\\\\\\'Result:\\\\\\' + str(x(6)))\" > run.py\\\\n$ python3 run.py\\\\nResult: 33\\\\n```\\'), (\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\\\\n$ python3 run.py\\\\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\\\\n```\\')], human_input=\\'echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677515003.1996367', \"'task_uuid'\": \"'00a84ff6-6fc1-4afc-88b1-e82a893855d3'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677515003.1997197, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677515003.201452, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py && python3 run.py\nAI: \n\n```\n$ echo -e \"x=lambda y:y*5+3;print('Result:' + str(x(6)))\" > run.py\n$ python3 run.py\nResult: 33\n```\n\nHuman: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\nAI: \n\n```\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\n$ python3 run.py\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n```\n\n\nHuman: echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\nAssistant:", "action_status": "started", "timestamp": 1677515003.2015123, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677515008.0399287, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n\n```\n$ echo -e \"echo 'Hello from Docker\" > entrypoint.sh\n$ echo -e \"FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile\n$ docker build . -t my_docker_image\n$ docker run -t my_docker_image\nHello from Docker\n```", "action_status": "started", "timestamp": 1677515008.0401833, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677515008.040339, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677515008.040439, "task_uuid": "00a84ff6-6fc1-4afc-88b1-e82a893855d3", "action_type": "", "task_level": [6]} -{"action_status": "started", "timestamp": 1677515008.053587, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "", "task_level": [1]} -{"reason": "module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations", "exception": "builtins.AttributeError", "message": "{\"'input'\": 'State(memory=[(\\'echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\\\\n$ python3 run.py\\\\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\\\\n```\\'), (\\'echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\\', \\'\\\\n\\\\n```\\\\n$ echo -e \"echo \\\\\\'Hello from Docker\" > entrypoint.sh\\\\n$ echo -e \"FROM ubuntu:20.04\\\\nCOPY entrypoint.sh entrypoint.sh\\\\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile\\\\n$ docker build . -t my_docker_image\\\\n$ docker run -t my_docker_image\\\\nHello from Docker\\\\n```\\')], human_input=\\'nvidia-smi\\')', \"'action_status'\": \"'started'\", \"'timestamp'\": '1677515008.0539572', \"'task_uuid'\": \"'ea339a52-82af-4c19-8ee6-1d2f081bc437'\", \"'action_type'\": \"'Input Function'\", \"'task_level'\": '[2, 1]'}", "timestamp": 1677515008.0543113, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "task_level": [3], "message_type": "eliot:destination_failure"} -{"action_status": "succeeded", "timestamp": 1677515008.0610886, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.\n\n\nHuman: echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py && python3 run.py\nAI: \n\n```\n$ echo -e \"print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])\" > run.py\n$ python3 run.py\n[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\n```\n\nHuman: echo -e \"echo 'Hello from Docker\" > entrypoint.sh && echo -e \"FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image\nAI: \n\n```\n$ echo -e \"echo 'Hello from Docker\" > entrypoint.sh\n$ echo -e \"FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]\">Dockerfile\n$ docker build . -t my_docker_image\n$ docker run -t my_docker_image\nHello from Docker\n```\n\n\nHuman: nvidia-smi\nAssistant:", "action_status": "started", "timestamp": 1677515008.0612898, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "Prompted", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677515019.9196224, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "Prompted", "task_level": [4, 2]} -{"result": "\n\n```\n$ nvidia-smi\nSat May 15 21:45:02 2021 \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n|-------------------------------+----------------------+----------------------+\n| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n|===============================+======================+======================|\n| 0 GeForce RTX 208... Off | 00000000:01:00.0 Off | N/A |\n| N/A 45C P0 28W / N/A | 590MiB / 7979MiB | 0% Default |\n+-------------------------------+----------------------+----------------------+\n \n+-----------------------------------------------------------------------------+\n| Processes: GPU Memory |\n| GPU PID Type Process name Usage |\n|=============================================================================|\n|", "action_status": "started", "timestamp": 1677515019.919849, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "Result", "task_level": [5, 1]} -{"action_status": "succeeded", "timestamp": 1677515019.920001, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "Result", "task_level": [5, 2]} -{"action_status": "succeeded", "timestamp": 1677515019.9200878, "task_uuid": "ea339a52-82af-4c19-8ee6-1d2f081bc437", "action_type": "", "task_level": [6]} -{"action_status": "succeeded", "timestamp": 1677515019.9287043, "task_uuid": "be24331e-675b-4c1f-aa66-65b84a7602e3", "action_type": "chatgpt", "task_level": [2]} diff --git a/chatgpt.pmpt.tpl~ b/chatgpt.pmpt.tpl~ deleted file mode 100644 index 7559ae179f3118ae52a5a0881dc228ce723b4e73..0000000000000000000000000000000000000000 --- a/chatgpt.pmpt.tpl~ +++ /dev/null @@ -1,15 +0,0 @@ -Assistant is a large language model trained by OpenAI. - -Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. - -Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. - -Overall, Assistant is a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist. - -{% for d in memory %} -Human: {{d.human}} -AI: {{d.ai}} -{% endfor %} - -Human: {{human_input}} -Assistant: \ No newline at end of file diff --git a/chatgpt.py b/chatgpt.py deleted file mode 100644 index ee7e771ba3eb32c1c35b457847e89166eec8ee3c..0000000000000000000000000000000000000000 --- a/chatgpt.py +++ /dev/null @@ -1,75 +0,0 @@ -# # ChatGPT - -# "ChatGPT" like examples. Adapted from -# [LangChain](https://langchain.readthedocs.io/en/latest/modules/memory/examples/chatgpt_clone.html)'s -# version of this [blog -# post](https://www.engraved.blog/building-a-virtual-machine-inside/). - - -import warnings -from dataclasses import dataclass -from typing import List, Tuple -from IPython.display import Markdown, display -import minichain - -# + tags=["hide_inp"] -warnings.filterwarnings("ignore") -# - - - -# Generic stateful Memory - -MEMORY = 2 - -@dataclass -class State: - memory: List[Tuple[str, str]] - human_input: str = "" - - def push(self, response: str) -> "State": - memory = self.memory if len(self.memory) < MEMORY else self.memory[1:] - return State(memory + [(self.human_input, response)]) - -# Chat prompt with memory - -class ChatPrompt(minichain.TemplatePrompt): - template_file = "chatgpt.pmpt.tpl" - def parse(self, out: str, inp: State) -> State: - result = out.split("Assistant:")[-1] - return inp.push(result) - -class Human(minichain.Prompt): - def parse(self, out: str, inp: State) -> State: - return inp.human_input = out - - -fake_human = [ - "I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.", - "ls ~", - "cd ~", - "{Please make a file jokes.txt inside and put some jokes inside}", - """echo -e "x=lambda y:y*5+3;print('Result:' + str(x(6)))" > run.py && python3 run.py""", - """echo -e "print(list(filter(lambda x: all(x%d for d in range(2,x)),range(2,3**10)))[:10])" > run.py && python3 run.py""", - """echo -e "echo 'Hello from Docker" > entrypoint.sh && echo -e "FROM ubuntu:20.04\nCOPY entrypoint.sh entrypoint.sh\nENTRYPOINT [\"/bin/sh\",\"entrypoint.sh\"]">Dockerfile && docker build . -t my_docker_image && docker run -t my_docker_image""", - "nvidia-smi" -] - -with minichain.start_chain("chatgpt") as backend: - prompt = ChatPrompt(backend.OpenAI()) - human = Human(backend.Mock(fake_human)) - state = State([]) - for i in range(len(fake_human)): - human.chain(prompt) - # display(Markdown(f'**Human:** {t}')) - # display(Markdown(f'**Assistant:** {state.memory[-1][1]}')) - # display(Markdown(f'--------------')) - - -# + tags=["hide_inp"] -ChatPrompt().show(State([("human 1", "output 1"), ("human 2", "output 2") ], "cd ~"), - "Text Assistant: Hello") -# - - -# View the run log. - -minichain.show_log("chatgpt.log") diff --git a/chatgpt.py~ b/chatgpt.py~ deleted file mode 100644 index 048e457c8e4d1c8ace68c959c93a36c154fc2487..0000000000000000000000000000000000000000 --- a/chatgpt.py~ +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - -output = chatgpt_chain.predict(human_input="I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd.") diff --git a/color.ipynb b/color.ipynb deleted file mode 100644 index f07c0c8f187bc20e14cdb04ddae8639ed72d4e31..0000000000000000000000000000000000000000 --- a/color.ipynb +++ /dev/null @@ -1,96 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "2f9d8993", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "markdown", - "id": "c41f0994", - "metadata": {}, - "source": [ - "Answer a math problem with code.\n", - "Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ccc349e6", - "metadata": {}, - "outputs": [], - "source": [ - "from minichain import Backend, JinjaPrompt, Prompt, start_chain, SimplePrompt, show_log" - ] - }, - { - "cell_type": "markdown", - "id": "0af5e0ab", - "metadata": {}, - "source": [ - "Prompt that asks LLM for code from math." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "9063448e", - "metadata": { - "lines_to_next_cell": 2 - }, - "outputs": [], - "source": [ - "class ColorPrompt(Prompt[str, bool]):\n", - " def parse(inp: str) -> str:\n", - " return f\"Answer 'Yes' if this is a color, {inp}. Answer:\"\n", - "\n", - " def parse(out: str, inp) -> bool:\n", - " # Encode the parsing logic\n", - " return out.strip() == \"Yes\" \n", - "ColorPrompt().show({\"inp\": \"dog\"}, \"No\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "13e05a7c", - "metadata": { - "lines_to_next_cell": 2 - }, - "outputs": [], - "source": [ - "with start_chain(\"color\") as backend:\n", - " question = 'What is the sum of the powers of 3 (3^i) that are smaller than 100?'\n", - " prompt = MathPrompt(backend.OpenAI()).chain(SimplePrompt(backend.Python()))\n", - " result = prompt({\"question\": question})\n", - " print(result)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "37249892", - "metadata": {}, - "outputs": [], - "source": [ - "show_log(\"math.log\")" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/color.py b/color.py deleted file mode 100644 index a2c8d298cf6ff5793064aaaa36b622eb692def68..0000000000000000000000000000000000000000 --- a/color.py +++ /dev/null @@ -1,26 +0,0 @@ -# Answer a math problem with code. -# Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169) - -from minichain import Backend, JinjaPrompt, Prompt, start_chain, SimplePrompt, show_log - - -# Prompt that asks LLM for code from math. - -class ColorPrompt(Prompt[str, bool]): - def parse(inp: str) -> str: - return f"Answer 'Yes' if this is a color, {inp}. Answer:" - - def parse(out: str, inp) -> bool: - # Encode the parsing logic - return out.strip() == "Yes" -ColorPrompt().show({"inp": "dog"}, "No") - - -with start_chain("color") as backend: - question = 'What is the sum of the powers of 3 (3^i) that are smaller than 100?' - prompt = MathPrompt(backend.OpenAI()).chain(SimplePrompt(backend.Python())) - result = prompt({"question": question}) - print(result) - - -show_log("math.log") diff --git a/color.py~ b/color.py~ deleted file mode 100644 index 08457b9dbe4ff0d461f6a6606bc4a435b1393d0f..0000000000000000000000000000000000000000 --- a/color.py~ +++ /dev/null @@ -1,26 +0,0 @@ -# Answer a math problem with code. -# Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169) - -from minichain import Backend, JinjaPrompt, Prompt, start_chain, SimplePrompt, show_log - - -# Prompt that asks LLM for code from math. - -class ColorPrompt(Prompt[str, bool]): - def parse(inp: str) -> str: - return f"Answer 'Yes' if this is a color, {inp}. Answer:" - - def parse(out: str, inp) -> bool: - # Encode the parsing logic - return out.strip() == "Yes" -ColorPrompt().show({"inp": "dog"}, "No") - - -with start_chain("math") as backend: - question = 'What is the sum of the powers of 3 (3^i) that are smaller than 100?' - prompt = MathPrompt(backend.OpenAI()).chain(SimplePrompt(backend.Python())) - result = prompt({"question": question}) - print(result) - - -show_log("math.log") diff --git a/examples.py b/examples.py deleted file mode 100644 index 1cd011b95b22398e7410ed5682d64ea08d3eeb8f..0000000000000000000000000000000000000000 --- a/examples.py +++ /dev/null @@ -1,20 +0,0 @@ -import gradio as gr -from chat import gradio as chat -from ner import gradio as ner -from math_demo import gradio as math_demo -from bash import gradio as bash -from pal import gradio as pal -from gatsby import gradio as gatsby -from stats import gradio as stats - -css = "#clean div.form {border: 0px} #response {border: 0px; background: #ffeec6} #prompt {border: 0px;background: aliceblue} #json {border: 0px} #result {border: 0px; background: #c5e0e5} #inner {padding: 20px} #inner textarea {border: 0px} .tabs div.tabitem {border: 0px}" - -with gr.Blocks(css=css) as demo: - gr.HTML("

Mini-Chain


[code] [docs]
") - - gr.TabbedInterface([chat, gatsby, math_demo, ner, bash, pal, stats], - ["Chat", "QA", "Math", "NER", "Bash", "PAL", "Stats"], - css= css) - -demo.launch() - diff --git a/examples.py~ b/examples.py~ deleted file mode 100644 index 13e316542047c36f2f37ff6214fcc5ebcc6b8935..0000000000000000000000000000000000000000 --- a/examples.py~ +++ /dev/null @@ -1,2 +0,0 @@ -from ner import gradio as ner -from math import gradio as math diff --git a/fake_agent.py b/fake_agent.py deleted file mode 100644 index 144e452fedcaf76718f86f7b5268a9886b49309a..0000000000000000000000000000000000000000 --- a/fake_agent.py +++ /dev/null @@ -1,59 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import Mock, prompt, OpenAIStream, show -from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool - - -@prompt(Mock(["Tool1"])) -def tool1(model, query): - return model(query) - -@prompt(Mock(["Tool2"])) -def tool2(model, img_src): - return model(img_src) - -tools = [tool1, tool2] - -@prompt(Mock(["Tool1: draw a flower", "Tool2: call mom"])) -def agent(model, query): - return model(query).split(":") - -@prompt(dynamic=tools) -def selector(model, input): - selector, input = input - if selector == "Tool1": - return model.tool(input, tool_num=0) - else: - return model.tool(input, tool_num=1) - - -def run(query): - select_input = agent(query) - out = selector(select_input) - select_input = agent(out) - return selector(select_input) - -run("make a pic").run() -# $ - -gradio = show(run, - subprompts=[agent, selector, agent, selector], - examples=['Draw me a flower'], - out_type="markdown", - description=desc, - show_advanced=False - ) -if __name__ == "__main__": - gradio.queue().launch() - diff --git a/fake_agent.py~ b/fake_agent.py~ deleted file mode 100644 index 8a14015d1757660c148832b6e0d134a216d9f482..0000000000000000000000000000000000000000 --- a/fake_agent.py~ +++ /dev/null @@ -1,75 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import Id, prompt, OpenAIStream -from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool - - - -@prompt(StableDiffusionTool()) -def gen(model, query): - return model(query) - -@prompt(ImageCaptioningTool()) -def caption(model, img_src): - return model(img_src) - -tools = [gen, caption] - -@prompt(Id(), - #OpenAIStream(), stream=True, - template_file="agent.pmpt.tpl") -def agent(model, query): - print(model(dict(tools=[(str(tool.backend.__class__), tool.backend.description) - for tool in tools], - input=query - ))) - return ("StableDiffusionTool", "Draw a flower") - # out = "" - # for t in model.stream(dict(tools=[(str(tool.backend.__class__), tool.backend.description) - # for tool in tools], - # input=query - # )): - # out += t - # yield out - # lines = out.split("\n") - # response = lines[0].split("?")[1].strip() - # if response == "Yes": - # tool = lines[1].split(":")[1].strip() - # yield tool - -@prompt(dynamic=tools) -def selector(model, input): - selector, input = input - if selector == "StableDiffusionTool": - return model.tool(input, tool_num=0) - else: - return model.tool(input, tool_num=1) - - -def run(query): - select_input = agent(query) - return selector(select_input) - -run("make a pic").run() -# $ - -gradio = show(run, - subprompts=[agent, selector], - examples=['Draw me a flower'], - out_type="markdown", - description=desc - ) -if __name__ == "__main__": - gradio.launch() - diff --git a/gatsby.log b/gatsby.log index 2e11f46f7d6f8c952888e9c203d96e8c2abd843e..323486ca91d3d6d2dd09a48612c4879dcb3edb6f 100644 --- a/gatsby.log +++ b/gatsby.log @@ -1,12 +1,18 @@ -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} +{"action_status": "started", "timestamp": 1678722728.2566106, "task_uuid": "384c7dea-48ca-43bf-9f3e-81a6393855a8", "action_type": "gatsby", "task_level": [1]} +{"action_status": "succeeded", "timestamp": 1678722728.2567458, "task_uuid": "384c7dea-48ca-43bf-9f3e-81a6393855a8", "action_type": "gatsby", "task_level": [2]} +{"action_status": "started", "timestamp": 1678722740.8610108, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "", "task_level": [1]} +{"input": {"query": "What did Gatsby do before he met Daisy?"}, "action_status": "started", "timestamp": 1678722740.8611531, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1678722740.8612182, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "What did Gatsby do before he met Daisy?", "action_status": "started", "timestamp": 1678722740.8612485, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1678722754.0333211, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Prompted", "task_level": [3, 2]} +{"result": [-0.003887228202074766, 0.0198895875364542, 0.005014391615986824, -0.0190346110612154, -0.042222920805215836, 0.012635739520192146, -0.005387490149587393, 0.03442128375172615, 0.0464773066341877, 0.008885958231985569, -0.04840860515832901, -0.03726816177368164, 0.016300739720463753, -0.0653470978140831, 0.0007964272517710924, 0.04424842447042465, 0.01560900267213583, 0.035743627697229385, -0.00965164601802826, 0.009560459293425083, -0.02739725448191166, -0.007629592437297106, 0.021500661969184875, 0.013538479804992676, 0.04506908357143402, -0.02173086814582348, -0.037203118205070496, 0.02240951545536518, 0.003418558742851019, 0.08345533162355423, -0.040042534470558167, 0.006710043177008629, -0.02690550871193409, 0.017070511355996132, 1.4651720903202659e-06, 0.05050818249583244, 0.005196787882596254, -0.002508606296032667, 0.052329324185848236, -0.04391421750187874, 0.04599013179540634, 0.06579176336526871, 0.012650401331484318, 0.017899667844176292, -0.007629082538187504, -0.06791124492883682, 0.027055444195866585, 0.04240965098142624, -0.0014380303910002112, 0.03848158195614815, 0.0014641903107985854, -0.03977559134364128, -0.0018461189465597272, -0.059043433517217636, 0.1207849457859993, -0.06049825996160507, -0.005036478396505117, 0.006569963879883289, -0.0036258224863559008, 0.008000718429684639, -0.0062234364449977875, -0.023182090371847153, -0.00882204994559288, 0.009475354105234146, 0.017948221415281296, 0.015006807632744312, 0.021125024184584618, 0.05389823764562607, -0.02793748676776886, -0.05090532824397087, -0.03356138616800308, 0.03817868232727051, 0.012790110893547535, 0.07405167073011398, -0.0328509584069252, 0.05626484006643295, 0.019829316064715385, -0.03345923125743866, -0.02177395671606064, 0.02872779779136181, 0.0135793536901474, -0.031462039798498154, 0.002982931211590767, 0.06613441556692123, 0.048370473086833954, 0.02307708188891411, -0.004249386489391327, 0.06685653328895569, -0.00013748533092439175, -0.020395943894982338, -0.0011983092408627272, -0.007947346195578575, 0.03730745241045952, 0.05674215778708458, 0.05057070776820183, -0.05810670927166939, 0.022949619218707085, 0.03930797800421715, -0.021489188075065613, -0.048992808908224106, -0.05567613244056702, 0.021180571988224983, 0.025468016043305397, -0.013376590795814991, 0.019633078947663307, 0.018038973212242126, -0.029233181849122047, -0.010348604992032051, -0.00217558816075325, 0.034397006034851074, -0.003291693516075611, 0.01378923375159502, -0.023623095825314522, 0.0077826292254030704, 0.0757577195763588, -0.045490678399801254, 0.0271370317786932, 0.01106982585042715, 0.06986100226640701, 0.004652573261409998, -0.026407692581415176, 0.02654942311346531, -0.013814344070851803, 0.015623255632817745, -0.0013841806212440133, -0.07441864907741547, -0.03911731392145157, 0.012507066130638123, -0.0019597068894654512, 0.04322737082839012, -0.08140037953853607, -0.046755872666835785, 0.006243414245545864, 0.026318460702896118, 0.0159731637686491, 0.03304019197821617, 0.017776355147361755, 0.001956591848284006, -0.05270813778042793, 0.022184859961271286, -0.004321028012782335, -0.06809651106595993, -0.015974225476384163, 0.04090206325054169, -0.027739299461245537, -0.013041611760854721, 0.02270037867128849, -0.07612844556570053, -0.01403880026191473, 0.007825094275176525, 0.019956760108470917, 0.04297448322176933, 0.06620678305625916, -0.0013794675469398499, -0.0007877094903960824, -0.0028835332486778498, -0.03251530975103378, 0.0693008154630661, 0.02533932775259018, -0.04930483549833298, -0.028866160660982132, 0.013105092570185661, -0.00032235519029200077, -0.004497512709349394, 0.008668838068842888, -0.03998921066522598, 0.03472451865673065, -0.03176688775420189, -0.050222210586071014, -0.007928549312055111, 0.006060054060071707, -0.02676914818584919, -0.0004880416381638497, 0.018508536741137505, 0.006893310230225325, 0.042400188744068146, 0.009105817414820194, -0.007138664834201336, 0.003602404613047838, 0.004579325672239065, 0.041190255433321, 0.052081894129514694, -0.031011149287223816, -0.057172711938619614, 0.022979892790317535, 0.03831249475479126, -0.01930481381714344, -0.03624449670314789, -0.037680286914110184, 0.011300966143608093, 0.036070533096790314, -0.022547848522663116, 0.01874937303364277, 0.01988656260073185, -0.020734472200274467, -0.007428019307553768, -0.003264310769736767, -0.04716583341360092, -0.026512106880545616, -0.03813556581735611, -0.005563961807638407, 0.010924777947366238, -0.0033122797030955553, 0.11311263591051102, 0.03912902623414993, -0.014459850266575813, 0.03189709037542343, 0.0325789637863636, -0.017283132299780846, -0.05573096498847008, 0.00042612224933691323, 0.00654100626707077, 0.05866165831685066, -0.005709860473871231, -0.00796140544116497, -0.004614187870174646, 0.046565886586904526, -0.04610903188586235, -0.020649379119277, 0.014566184021532536, -0.03268798068165779, 0.010726038366556168, -0.00037832141970284283, -0.016519244760274887, 0.001395150669850409, -0.08267226815223694, -0.046204376965761185, -0.031283628195524216, -0.02102569490671158, -0.025800546631217003, -0.020199021324515343, -0.0056645795702934265, 0.028101593255996704, 0.023253001272678375, 0.05617931857705116, 0.007474121637642384, -0.03169779106974602, -0.0634794682264328, -0.020578697323799133, -0.09570180624723434, 0.0023220584262162447, 0.02834375575184822, -0.002714385511353612, -0.026459665969014168, -0.03968740254640579, 0.0010514616733416915, 0.034720368683338165, -0.023337475955486298, 0.03357527032494545, -0.01888580434024334, -0.034629978239536285, -0.005862865597009659, 0.02481168322265148, 0.038720741868019104, 0.05143310874700546, -0.07362972944974899, -0.0043714698404073715, -0.01376280002295971, 0.03078486956655979, 0.01876477152109146, -0.026450321078300476, 0.019811443984508514, 0.005419518798589706, -0.019856290891766548, 0.019118990749120712, -0.03570350259542465, -0.028832420706748962, -0.06430661678314209, 0.02233273908495903, -0.002680010860785842, 0.022545458748936653, 0.029415179044008255, 0.016307689249515533, -0.030629388988018036, 0.024303853511810303, -0.04003429040312767, 0.06680615246295929, 0.013873234391212463, -0.031811632215976715, 0.006674048490822315, 0.03402351588010788, 0.014812447130680084, -0.002348647452890873, 0.029263515025377274, -0.04305024817585945, 0.05092079937458038, 0.014998083934187889, 0.0559835210442543, 0.05659601092338562, -0.032506056129932404, -0.011745196767151356, 0.004756545182317495, 0.016696447506546974, 0.01634025387465954, 0.0027515410911291838, -0.006625561509281397, 0.024717435240745544, -0.037308208644390106, -0.014416090212762356, 0.03212406113743782, -0.0017894095508381724, -0.06056123599410057, 0.031623098999261856, 0.015540852211415768, -0.022205905988812447, -0.020957499742507935, -0.03665414825081825, -0.00998745672404766, -0.07648861408233643, 0.01648937724530697, -0.06585470587015152, -0.009889816865324974, -0.005081212148070335, 0.02715182863175869, 0.08042862266302109, -0.024754684418439865, 0.0013086956460028887, 0.014669244177639484, -0.003130931407213211, -0.032377101480960846, 0.018950892612338066, -0.03326814994215965, -0.05920145660638809, 0.01379262562841177, 0.015418375842273235, -0.02721942961215973, 0.03788064792752266, 0.013909389264881611, 0.07906065881252289, 0.04695257917046547, 0.025030121207237244, -0.021177712827920914, 0.00964528787881136, -0.00930618867278099, 0.0705944374203682, 0.056093744933605194, -0.048553191125392914, 0.014934103935956955, -0.005455792881548405, 0.01625811494886875, 0.035979971289634705, 0.044982053339481354, 0.006236139684915543, -0.09025052189826965, -0.04590274393558502, -0.005322533659636974, -0.05016981065273285, -0.027683105319738388, -0.07181200385093689, -0.01848607324063778, -0.09767501056194305, 0.0035151278134435415, -0.036153122782707214, -0.046863898634910583, -0.027725093066692352, 0.02095642127096653, 0.028504688292741776, -0.026084287092089653, -0.016343530267477036, 0.006354904267936945, -0.03842195123434067, -0.020052241161465645, -0.0039218999445438385, -0.005180169828236103, 0.06778889894485474, -0.053725775331258774, 0.014296329580247402, 0.04353368654847145, 0.006914097815752029, 0.0655544325709343, -0.01449697557836771, 0.03363028168678284, -0.06275250762701035, 0.049764081835746765, -0.009972180239856243, -0.029209475964307785, -0.023113129660487175, 0.016114482656121254, 0.029449494555592537, -0.009830719791352749, 0.03450608626008034, 0.03422730043530464, -0.006067289505153894, 0.04374401643872261, -0.029037849977612495, 0.021764082834124565, -1.3408462109509856e-05, -0.07287029176950455, -0.03546876832842827, 0.03886757418513298, 0.026129238307476044, 0.007167821284383535, 0.016980379819869995, 0.050290584564208984, -0.021773403510451317, 0.008399774320423603, -0.048103127628564835, -0.015021353028714657, -0.019069857895374298, -0.012140675447881222, -0.03396833688020706, 0.06750674545764923, 0.044069867581129074, -0.002717355964705348, -0.024896182119846344, 0.02222360484302044, -0.03847828134894371, -0.010072839446365833, -0.005221790634095669, -0.025164682418107986, -0.012828045524656773, 0.10586799681186676, -0.033161766827106476, 0.021820316091179848, 0.0011391477892175317, -0.051194947212934494, -0.015856537967920303, 0.025962136685848236, 0.030953478068113327, -0.06370990723371506, 0.01010304968804121, 0.003352577332407236, -0.04120684787631035, -0.025548182427883148, -0.013285758905112743, -0.004803207702934742, 0.07016759365797043, 0.03535054624080658, 0.024349261075258255, -0.008826765231788158, 0.025963757187128067, -0.05632730945944786, -0.018799180164933205, 0.06442150473594666, -0.03916173055768013, -0.04384036734700203, -0.010013355873525143, 0.02870503067970276, -0.039207059890031815, -0.008780469186604023, -0.0248566921800375, 0.02549748308956623, 0.048325877636671066, 0.006353657692670822, -0.03146296367049217, 0.014660898596048355, 0.048260852694511414, 0.010833763517439365, 0.04239527881145477, 0.028075523674488068, -0.03765295818448067, -0.00021245400421321392, -0.01637384295463562, -0.020441051572561264, -0.0676245465874672, -0.027973361313343048, 0.02841685339808464, -0.04900107905268669, 0.023237289860844612, 0.03781578689813614, -0.007594790775328875, 0.043228015303611755, 0.05682665482163429, -0.0477324053645134, -0.021895756945014, -0.0036302392836660147, 0.02580680511891842, 0.04808980971574783, 0.009833880700170994, -0.029267817735671997, -0.08730483800172806, -0.014473497867584229, 0.006700731813907623, 0.006656119599938393, -0.0015066990163177252, -0.028340918943285942, -0.030466021969914436, -0.03252173587679863, 0.02763795666396618, 0.014965834096074104, -0.08788534253835678, 0.0920148640871048, 0.023050582036376, 0.07885754853487015, 0.01756744459271431, -0.056676235049963, -0.0015523789916187525, 0.049248840659856796, 0.013111501932144165, -0.036881934851408005, 0.004156735725700855, -0.03959950804710388, -0.04187732934951782, -0.033697813749313354, -0.03416171669960022, 0.026224296540021896, -0.00212427438236773, -0.08400624990463257, -0.0015784328570589423, -0.015712128952145576, 0.00414662342518568, -0.06312809139490128, 0.023281363770365715, -0.04033081233501434, -0.022044356912374496, -0.00438954820856452, 0.04902002960443497, -0.011810027062892914, 0.01779176853597164, -0.023316439241170883, -0.013815398328006268, 0.02640579454600811, -0.08118424564599991, -0.10231015086174011, -0.0796288251876831, -0.0010594624327495694, -0.0637231320142746, -0.056297458708286285, -0.0012530259555205703, -0.008524828590452671, -0.03042135015130043, -0.025304418057203293, 0.004190725740045309, 0.024401284754276276, 0.034874532371759415, -0.011733213439583778, -0.0050503043457865715, 0.008346868678927422, -0.02921750769019127, -0.002856032457202673, -0.029102787375450134, 0.012367988005280495, 0.05957779660820961, -0.03270721435546875, 0.01106699462980032, -0.03437996283173561, -0.0077677154913544655, 0.04259764403104782, 0.03433895856142044, -0.010584652423858643, 0.04206785559654236, -0.005901589058339596, 0.0809914618730545, -0.01004907675087452, -0.014947034418582916, -0.021967414766550064, 0.01694410853087902, 0.024536356329917908, 0.013179230503737926, 0.01811409927904606, -0.0033348591532558203, -0.012882251292467117, -0.08294843882322311, -0.026284009218215942, 0.05716654285788536, -5.770721438693419e-33, 0.006357301026582718, -0.03077971562743187, 0.02423958107829094, 0.0932648777961731, -0.03927141800522804, 0.004607198294252157, -0.009199658408761024, -0.04007495194673538, -0.03309480473399162, -0.014829229563474655, -0.036076925694942474, 0.023974459618330002, 0.014334749430418015, 0.011738981120288372, 0.026305491104722023, -0.010234019719064236, -0.0038947095163166523, 0.013933834619820118, -0.021842440590262413, 0.04014803096652031, 0.02398701384663582, 0.007562308572232723, -0.0007755713304504752, 0.1080133318901062, -0.0232221819460392, -0.05419640615582466, -0.05870767682790756, 0.055049289017915726, -0.00986260175704956, -0.020703867077827454, -0.017294231802225113, -0.021378090605139732, -0.0075568691827356815, 0.0320829376578331, 0.007051725406199694, 0.017801843583583832, -0.022040322422981262, -0.01376914232969284, 0.019660823047161102, 0.005341327283531427, -0.02221737429499626, 0.010496651753783226, 0.01511034369468689, 0.03725795820355415, 0.008722214959561825, -0.05763749033212662, -0.016340825706720352, -0.000229535173275508, 0.009402784518897533, 0.04061824828386307, 0.019907427951693535, -0.018085433170199394, 0.006473230663686991, -0.11802327632904053, 0.03228956460952759, 0.007952426560223103, 0.004755759611725807, 0.05796555429697037, 0.03206593915820122, 0.0045759002678096294, 0.03472132980823517, -0.01541859656572342, -0.06067410483956337, 0.030672801658511162, 0.008894214406609535, 0.0035295470152050257, 0.11620364338159561, -0.010405236855149269, -0.07650286704301834, -0.06865312159061432, -0.043477676808834076, 0.02466365322470665, -0.020602161064743996, -0.004234707914292812, 0.0005591363296844065, -0.007192609831690788, -0.010511847212910652, 0.024170776829123497, 0.07789268344640732, 0.008256817236542702, 0.01852312684059143, 0.0073267691768705845, 0.006290810648351908, -0.0070859333500266075, -0.024793867021799088, 0.0846845805644989, 0.0028347219340503216, 0.05728163942694664, -0.02475057728588581, 0.001300928881391883, -0.0078034959733486176, -0.00807581003755331, 0.01260744221508503, 0.02734578587114811, -0.06054101884365082, -0.0003099057066719979, -0.06677668541669846, -0.009642992168664932, 0.04419955238699913, 0.022375885397195816, 0.07053053379058838, 0.01769324019551277, -0.006071730516850948, 0.038312431424856186, -0.0003823191800620407, 0.005449597258120775, 0.027598610147833824, 0.09349528700113297, -0.052799321711063385, -0.038738686591386795, -0.037908680737018585, 0.000825792842078954, -0.04833551496267319, -0.06191939115524292, -0.001491617993451655, 0.007265156134963036, 0.0012317452346906066, 0.09357017278671265, -0.017656344920396805, 0.015433751046657562, 0.06978774815797806, 0.0681474357843399, -0.0035361191257834435, -0.007062133401632309, 0.021396886557340622, 0.034925900399684906, 0.04840550571680069, -0.00026239242288284004, -0.05098772421479225, -0.004788246005773544, -0.006261441390961409, -0.03541318327188492, 2.1640293823566026e-07, 0.009504515677690506, 0.002063180785626173, -0.016988303512334824, 0.054872218519449234, -0.008502008393406868, 0.012229707092046738, -0.027471216395497322, 0.008199622854590416, 0.00016756185505073518, 0.017955856397747993, 0.0734444260597229, 0.018215620890259743, -0.006734748836606741, -0.0009413568186573684, 0.038283318281173706, 0.03462311252951622, 0.006868139375001192, -0.057488370686769485, 0.034916747361421585, -0.002445003716275096, -0.008846830576658249, -0.017094686627388, -0.021008862182497978, -0.0057312799617648125, 0.06670287251472473, -0.05895605683326721, 0.003967765253037214, -0.04688413068652153, -0.007967855781316757, 0.008486705832183361, 0.04752103611826897, -0.018809055909514427, -0.035304129123687744, 0.05190379545092583, -0.02688978612422943, -0.004413092974573374, 0.006161215715110302, -0.06472691893577576, -0.03412643074989319, 0.07960573583841324, -0.04458937421441078, -0.03486024960875511, -0.012804203666746616, 0.00819985568523407, 0.05537816509604454, 0.03693454712629318, 0.002208888065069914, -0.054239824414253235, -0.0033781256061047316, 0.012642616406083107, -0.007412124890834093, 0.018704794347286224, 0.020678628236055374, -0.017073800787329674, -0.04182546213269234, -0.04236733540892601, 0.007342583499848843, -0.0185915045440197, 0.051248468458652496, 0.048972323536872864, 0.008518674410879612, -0.029436754062771797, -0.034767813980579376, 0.03085225075483322, 0.051904525607824326, -0.02561274915933609, 0.03814048320055008, 1.1672317964385828e-34, 0.012339473702013493, -0.017261575907468796, 0.03371218964457512, 0.04937398433685303, -0.0268130861222744, -0.03502042964100838, 0.001780011341907084, -0.012070025317370892, 0.004172053188085556, -0.005994188599288464, -0.004628462716937065], "action_status": "started", "timestamp": 1678722754.0334554, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1678722754.035534, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1678722754.0356352, "task_uuid": "c07f0569-f334-468d-a2c8-faea308bf34f", "action_type": "", "task_level": [5]} +{"action_status": "started", "timestamp": 1678722754.0357313, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "", "task_level": [1]} +{"input": {"question": "What did Gatsby do before he met Daisy?", "docs": [" and redolent of this year\u2019s shining motorcars and of dances whose flowers were scarcely withered. It excited him, too, that many men had already loved Daisy\u2014it increased her value in his eyes. He felt their presence all about the house, pervading the air with the shades and echoes of still vibrant emotions. But he knew that he was in Daisy\u2019s house by a colossal accident. However glorious might be his future as Jay Gatsby, he was at present a penniless young man without a past, and at any moment the invisible cloak of his uniform might slip from his shoulders. So he made the most of his time. He took what he could get, ravenously and unscrupulously\u2014eventually he took Daisy one still October night, took her because he had no real right to touch her hand. He might have despised himself, for he had certainly taken her under false pretences. I don\u2019t mean that he had traded on his phantom millions, but he had deliberately given Daisy a sense of security; he let her believe that he was a person from much the same strata as herself\u2014that he was fully able to take care of her. As a matter of fact, he had no such facilities\u2014he had no comfortable family standing behind him, and he was liable at the whim of an impersonal government to be blown anywhere about the world. But he didn\u2019t despise himself and it didn\u2019t turn out as he had imagined. He had intended, probably, to take what he could and go\u2014but now he found that he had committed himself to the following of a grail. He knew that Daisy was extraordinary, but he didn\u2019t realize just how extraordinary a \u201cnice\u201d girl could be. She vanished into her rich house, into her rich, full life, leaving Gatsby\u2014nothing. He felt married to her, that was all. When they met again, two days later, it was Gatsby who was breathless, who was, somehow, betrayed. Her porch was bright with the bought luxury of star-shine; the wicker of the settee squeaked fashionably as she turned toward him and he kissed her curious and lovely mouth. She had caught a cold, and it made her voice huskier and more charming than ever, and Gatsby was overwhelmingly aware of the youth and mystery that wealth imprisons and preserves, of the freshness of many clothes, and of Daisy, gleaming like silver, safe and proud above the hot struggles of the poor. ------------------------------------------------------------------------ \u201cI can\u2019t describe to you how surprised I was to find out I loved her, old sport. I even hoped for a while that she\u2019d throw me over, bu"]}, "action_status": "started", "timestamp": 1678722754.0357726, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1678722754.0375097, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "Context information is below. \n\n\n---------------------\n\n\n\n* and redolent of this year\u2019s shining motorcars and of dances whose flowers were scarcely withered. It excited him, too, that many men had already loved Daisy\u2014it increased her value in his eyes. He felt their presence all about the house, pervading the air with the shades and echoes of still vibrant emotions. But he knew that he was in Daisy\u2019s house by a colossal accident. However glorious might be his future as Jay Gatsby, he was at present a penniless young man without a past, and at any moment the invisible cloak of his uniform might slip from his shoulders. So he made the most of his time. He took what he could get, ravenously and unscrupulously\u2014eventually he took Daisy one still October night, took her because he had no real right to touch her hand. He might have despised himself, for he had certainly taken her under false pretences. I don\u2019t mean that he had traded on his phantom millions, but he had deliberately given Daisy a sense of security; he let her believe that he was a person from much the same strata as herself\u2014that he was fully able to take care of her. As a matter of fact, he had no such facilities\u2014he had no comfortable family standing behind him, and he was liable at the whim of an impersonal government to be blown anywhere about the world. But he didn\u2019t despise himself and it didn\u2019t turn out as he had imagined. He had intended, probably, to take what he could and go\u2014but now he found that he had committed himself to the following of a grail. He knew that Daisy was extraordinary, but he didn\u2019t realize just how extraordinary a \u201cnice\u201d girl could be. She vanished into her rich house, into her rich, full life, leaving Gatsby\u2014nothing. He felt married to her, that was all. When they met again, two days later, it was Gatsby who was breathless, who was, somehow, betrayed. Her porch was bright with the bought luxury of star-shine; the wicker of the settee squeaked fashionably as she turned toward him and he kissed her curious and lovely mouth. She had caught a cold, and it made her voice huskier and more charming than ever, and Gatsby was overwhelmingly aware of the youth and mystery that wealth imprisons and preserves, of the freshness of many clothes, and of Daisy, gleaming like silver, safe and proud above the hot struggles of the poor. ------------------------------------------------------------------------ \u201cI can\u2019t describe to you how surprised I was to find out I loved her, old sport. I even hoped for a while that she\u2019d throw me over, bu\n\n\n---------------------\n\nGiven the context information and not prior knowledge, answer the question: What did Gatsby do before he met Daisy?", "action_status": "started", "timestamp": 1678722754.037603, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1678722756.5902116, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Prompted", "task_level": [3, 2]} +{"result": "\n\nGatsby had no past before he met Daisy, and was a penniless young man without any family standing. He was liable to be blown anywhere about the world at the whim of an impersonal government.", "action_status": "started", "timestamp": 1678722756.5903413, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1678722756.5903873, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1678722756.590408, "task_uuid": "850055e8-7fe5-462e-9580-4b10b605c554", "action_type": "", "task_level": [5]} diff --git a/gatsby.pmpt.tpl~ b/gatsby.pmpt.tpl~ deleted file mode 100644 index 696f7073a1e4d18c7d974de390c2a2bdf0b24730..0000000000000000000000000000000000000000 --- a/gatsby.pmpt.tpl~ +++ /dev/null @@ -1,5 +0,0 @@ -Context information is below. ---------------------- -{context_str} ---------------------- -Given the context information and not prior knowledge, answer the question: {query_str} \ No newline at end of file diff --git a/gatsby.py~ b/gatsby.py~ deleted file mode 100644 index 2354a058bb60f5595bf45944b7ca8ae0e0877e8c..0000000000000000000000000000000000000000 --- a/gatsby.py~ +++ /dev/null @@ -1,42 +0,0 @@ -# Questions answering with embeddings. Adapted from [OpenAI -# Notebook](https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb). - -import datasets -import numpy as np - -from minichain import Prompt, TemplatePrompt, show_log, start_chain - -# Load data with embeddings (computed beforehand) - -olympics = datasets.load_from_disk("olympics.data") -olympics.add_faiss_index("embeddings") - -# Fast KNN retieval prompt - - -class KNNPrompt(Prompt): - def find(self, out, inp): - res = olympics.get_nearest_examples("embeddings", np.array(out), 3) - return {"question": inp, "docs": res.examples["content"]} - - -# QA prompt to ask question with examples - - -class QAPrompt(TemplatePrompt): - template_file = "qa.pmpt.tpl" - - -with start_chain("qa") as backend: - question = "Who won the 2020 Summer Olympics men's high jump?" - prompt = KNNPrompt(backend.OpenAIEmbed()).chain(QAPrompt(backend.OpenAI())) - result = prompt(question) - print(result) - -# + tags=["hide_inp"] -QAPrompt().show( - {"question": "Who won the race?", "docs": ["doc1", "doc2", "doc3"]}, "Joe Bob" -) -# - - -show_log("qa.log") diff --git a/gatsby_part.txt b/gatsby_part.txt deleted file mode 100644 index 014457c0fe15370d54bdaf1d38da0b20b4b0796a..0000000000000000000000000000000000000000 --- a/gatsby_part.txt +++ /dev/null @@ -1,2561 +0,0 @@ - - VII - -It was when curiosity about Gatsby was at its highest that the lights -in his house failed to go on one Saturday night—and, as obscurely as -it had begun, his career as Trimalchio was over. Only gradually did I -become aware that the automobiles which turned expectantly into his -drive stayed for just a minute and then drove sulkily away. Wondering -if he were sick I went over to find out—an unfamiliar butler with a -villainous face squinted at me suspiciously from the door. - -“Is Mr. Gatsby sick?” - -“Nope.” After a pause he added “sir” in a dilatory, grudging way. - -“I hadn’t seen him around, and I was rather worried. Tell him Mr. -Carraway came over.” - -“Who?” he demanded rudely. - -“Carraway.” - -“Carraway. All right, I’ll tell him.” - -Abruptly he slammed the door. - -My Finn informed me that Gatsby had dismissed every servant in his -house a week ago and replaced them with half a dozen others, who never -went into West Egg village to be bribed by the tradesmen, but ordered -moderate supplies over the telephone. The grocery boy reported that -the kitchen looked like a pigsty, and the general opinion in the -village was that the new people weren’t servants at all. - -Next day Gatsby called me on the phone. - -“Going away?” I inquired. - -“No, old sport.” - -“I hear you fired all your servants.” - -“I wanted somebody who wouldn’t gossip. Daisy comes over quite -often—in the afternoons.” - -So the whole caravansary had fallen in like a card house at the -disapproval in her eyes. - -“They’re some people Wolfshiem wanted to do something for. They’re all -brothers and sisters. They used to run a small hotel.” - -“I see.” - -He was calling up at Daisy’s request—would I come to lunch at her -house tomorrow? Miss Baker would be there. Half an hour later Daisy -herself telephoned and seemed relieved to find that I was -coming. Something was up. And yet I couldn’t believe that they would -choose this occasion for a scene—especially for the rather harrowing -scene that Gatsby had outlined in the garden. - -The next day was broiling, almost the last, certainly the warmest, of -the summer. As my train emerged from the tunnel into sunlight, only -the hot whistles of the National Biscuit Company broke the simmering -hush at noon. The straw seats of the car hovered on the edge of -combustion; the woman next to me perspired delicately for a while into -her white shirtwaist, and then, as her newspaper dampened under her -fingers, lapsed despairingly into deep heat with a desolate cry. Her -pocketbook slapped to the floor. - -“Oh, my!” she gasped. - -I picked it up with a weary bend and handed it back to her, holding it -at arm’s length and by the extreme tip of the corners to indicate that -I had no designs upon it—but everyone near by, including the woman, -suspected me just the same. - -“Hot!” said the conductor to familiar faces. “Some weather! … Hot! … -Hot! … Hot! … Is it hot enough for you? Is it hot? Is it … ?” - -My commutation ticket came back to me with a dark stain from his hand. -That anyone should care in this heat whose flushed lips he kissed, -whose head made damp the pyjama pocket over his heart! - -… Through the hall of the Buchanans’ house blew a faint wind, carrying -the sound of the telephone bell out to Gatsby and me as we waited at -the door. - -“The master’s body?” roared the butler into the mouthpiece. “I’m -sorry, madame, but we can’t furnish it—it’s far too hot to touch this -noon!” - -What he really said was: “Yes … Yes … I’ll see.” - -He set down the receiver and came toward us, glistening slightly, to -take our stiff straw hats. - -“Madame expects you in the salon!” he cried, needlessly indicating the -direction. In this heat every extra gesture was an affront to the -common store of life. - -The room, shadowed well with awnings, was dark and cool. Daisy and -Jordan lay upon an enormous couch, like silver idols weighing down -their own white dresses against the singing breeze of the fans. - -“We can’t move,” they said together. - -Jordan’s fingers, powdered white over their tan, rested for a moment -in mine. - -“And Mr. Thomas Buchanan, the athlete?” I inquired. - -Simultaneously I heard his voice, gruff, muffled, husky, at the hall -telephone. - -Gatsby stood in the centre of the crimson carpet and gazed around with -fascinated eyes. Daisy watched him and laughed, her sweet, exciting -laugh; a tiny gust of powder rose from her bosom into the air. - -“The rumour is,” whispered Jordan, “that that’s Tom’s girl on the -telephone.” - -We were silent. The voice in the hall rose high with annoyance: “Very -well, then, I won’t sell you the car at all … I’m under no obligations -to you at all … and as for your bothering me about it at lunch time, I -won’t stand that at all!” - -“Holding down the receiver,” said Daisy cynically. - -“No, he’s not,” I assured her. “It’s a bona-fide deal. I happen to -know about it.” - -Tom flung open the door, blocked out its space for a moment with his -thick body, and hurried into the room. - -“Mr. Gatsby!” He put out his broad, flat hand with well-concealed -dislike. “I’m glad to see you, sir … Nick …” - -“Make us a cold drink,” cried Daisy. - -As he left the room again she got up and went over to Gatsby and -pulled his face down, kissing him on the mouth. - -“You know I love you,” she murmured. - -“You forget there’s a lady present,” said Jordan. - -Daisy looked around doubtfully. - -“You kiss Nick too.” - -“What a low, vulgar girl!” - -“I don’t care!” cried Daisy, and began to clog on the brick fireplace. -Then she remembered the heat and sat down guiltily on the couch just -as a freshly laundered nurse leading a little girl came into the room. - -“Bles-sed pre-cious,” she crooned, holding out her arms. “Come to your -own mother that loves you.” - -The child, relinquished by the nurse, rushed across the room and -rooted shyly into her mother’s dress. - -“The bles-sed pre-cious! Did mother get powder on your old yellowy -hair? Stand up now, and say—How-de-do.” - -Gatsby and I in turn leaned down and took the small reluctant hand. -Afterward he kept looking at the child with surprise. I don’t think he -had ever really believed in its existence before. - -“I got dressed before luncheon,” said the child, turning eagerly to -Daisy. - -“That’s because your mother wanted to show you off.” Her face bent -into the single wrinkle of the small white neck. “You dream, you. You -absolute little dream.” - -“Yes,” admitted the child calmly. “Aunt Jordan’s got on a white dress -too.” - -“How do you like mother’s friends?” Daisy turned her around so that -she faced Gatsby. “Do you think they’re pretty?” - -“Where’s Daddy?” - -“She doesn’t look like her father,” explained Daisy. “She looks like -me. She’s got my hair and shape of the face.” - -Daisy sat back upon the couch. The nurse took a step forward and held -out her hand. - -“Come, Pammy.” - -“Goodbye, sweetheart!” - -With a reluctant backward glance the well-disciplined child held to -her nurse’s hand and was pulled out the door, just as Tom came back, -preceding four gin rickeys that clicked full of ice. - -Gatsby took up his drink. - -“They certainly look cool,” he said, with visible tension. - -We drank in long, greedy swallows. - -“I read somewhere that the sun’s getting hotter every year,” said Tom -genially. “It seems that pretty soon the earth’s going to fall into -the sun—or wait a minute—it’s just the opposite—the sun’s getting -colder every year. - -“Come outside,” he suggested to Gatsby, “I’d like you to have a look -at the place.” - -I went with them out to the veranda. On the green Sound, stagnant in -the heat, one small sail crawled slowly toward the fresher sea. -Gatsby’s eyes followed it momentarily; he raised his hand and pointed -across the bay. - -“I’m right across from you.” - -“So you are.” - -Our eyes lifted over the rose-beds and the hot lawn and the weedy -refuse of the dog-days alongshore. Slowly the white wings of the boat -moved against the blue cool limit of the sky. Ahead lay the scalloped -ocean and the abounding blessed isles. - -“There’s sport for you,” said Tom, nodding. “I’d like to be out there -with him for about an hour.” - -We had luncheon in the dining-room, darkened too against the heat, and -drank down nervous gaiety with the cold ale. - -“What’ll we do with ourselves this afternoon?” cried Daisy, “and the -day after that, and the next thirty years?” - -“Don’t be morbid,” Jordan said. “Life starts all over again when it -gets crisp in the fall.” - -“But it’s so hot,” insisted Daisy, on the verge of tears, “and -everything’s so confused. Let’s all go to town!” - -Her voice struggled on through the heat, beating against it, moulding -its senselessness into forms. - -“I’ve heard of making a garage out of a stable,” Tom was saying to -Gatsby, “but I’m the first man who ever made a stable out of a -garage.” - -“Who wants to go to town?” demanded Daisy insistently. Gatsby’s eyes -floated toward her. “Ah,” she cried, “you look so cool.” - -Their eyes met, and they stared together at each other, alone in -space. With an effort she glanced down at the table. - -“You always look so cool,” she repeated. - -She had told him that she loved him, and Tom Buchanan saw. He was -astounded. His mouth opened a little, and he looked at Gatsby, and -then back at Daisy as if he had just recognized her as someone he knew -a long time ago. - -“You resemble the advertisement of the man,” she went on innocently. -“You know the advertisement of the man—” - -“All right,” broke in Tom quickly, “I’m perfectly willing to go to -town. Come on—we’re all going to town.” - -He got up, his eyes still flashing between Gatsby and his wife. No one -moved. - -“Come on!” His temper cracked a little. “What’s the matter, anyhow? -If we’re going to town, let’s start.” - -His hand, trembling with his effort at self-control, bore to his lips -the last of his glass of ale. Daisy’s voice got us to our feet and out -on to the blazing gravel drive. - -“Are we just going to go?” she objected. “Like this? Aren’t we going -to let anyone smoke a cigarette first?” - -“Everybody smoked all through lunch.” - -“Oh, let’s have fun,” she begged him. “It’s too hot to fuss.” - -He didn’t answer. - -“Have it your own way,” she said. “Come on, Jordan.” - -They went upstairs to get ready while we three men stood there -shuffling the hot pebbles with our feet. A silver curve of the moon -hovered already in the western sky. Gatsby started to speak, changed -his mind, but not before Tom wheeled and faced him expectantly. - -“Have you got your stables here?” asked Gatsby with an effort. - -“About a quarter of a mile down the road.” - -“Oh.” - -A pause. - -“I don’t see the idea of going to town,” broke out Tom savagely. -“Women get these notions in their heads—” - -“Shall we take anything to drink?” called Daisy from an upper window. - -“I’ll get some whisky,” answered Tom. He went inside. - -Gatsby turned to me rigidly: - -“I can’t say anything in his house, old sport.” - -“She’s got an indiscreet voice,” I remarked. “It’s full of—” I -hesitated. - -“Her voice is full of money,” he said suddenly. - -That was it. I’d never understood before. It was full of money—that -was the inexhaustible charm that rose and fell in it, the jingle of -it, the cymbals’ song of it … High in a white palace the king’s -daughter, the golden girl … - -Tom came out of the house wrapping a quart bottle in a towel, followed -by Daisy and Jordan wearing small tight hats of metallic cloth and -carrying light capes over their arms. - -“Shall we all go in my car?” suggested Gatsby. He felt the hot, green -leather of the seat. “I ought to have left it in the shade.” - -“Is it standard shift?” demanded Tom. - -“Yes.” - -“Well, you take my coupé and let me drive your car to town.” - -The suggestion was distasteful to Gatsby. - -“I don’t think there’s much gas,” he objected. - -“Plenty of gas,” said Tom boisterously. He looked at the gauge. “And -if it runs out I can stop at a drugstore. You can buy anything at a -drugstore nowadays.” - -A pause followed this apparently pointless remark. Daisy looked at Tom -frowning, and an indefinable expression, at once definitely unfamiliar -and vaguely recognizable, as if I had only heard it described in -words, passed over Gatsby’s face. - -“Come on, Daisy” said Tom, pressing her with his hand toward Gatsby’s -car. “I’ll take you in this circus wagon.” - -He opened the door, but she moved out from the circle of his arm. - -“You take Nick and Jordan. We’ll follow you in the coupé.” - -She walked close to Gatsby, touching his coat with her hand. Jordan -and Tom and I got into the front seat of Gatsby’s car, Tom pushed the -unfamiliar gears tentatively, and we shot off into the oppressive -heat, leaving them out of sight behind. - -“Did you see that?” demanded Tom. - -“See what?” - -He looked at me keenly, realizing that Jordan and I must have known -all along. - -“You think I’m pretty dumb, don’t you?” he suggested. “Perhaps I am, -but I have a—almost a second sight, sometimes, that tells me what to -do. Maybe you don’t believe that, but science—” - -He paused. The immediate contingency overtook him, pulled him back -from the edge of theoretical abyss. - -“I’ve made a small investigation of this fellow,” he continued. “I -could have gone deeper if I’d known—” - -“Do you mean you’ve been to a medium?” inquired Jordan humorously. - -“What?” Confused, he stared at us as we laughed. “A medium?” - -“About Gatsby.” - -“About Gatsby! No, I haven’t. I said I’d been making a small -investigation of his past.” - -“And you found he was an Oxford man,” said Jordan helpfully. - -“An Oxford man!” He was incredulous. “Like hell he is! He wears a pink -suit.” - -“Nevertheless he’s an Oxford man.” - -“Oxford, New Mexico,” snorted Tom contemptuously, “or something like -that.” - -“Listen, Tom. If you’re such a snob, why did you invite him to lunch?” -demanded Jordan crossly. - -“Daisy invited him; she knew him before we were married—God knows -where!” - -We were all irritable now with the fading ale, and aware of it we -drove for a while in silence. Then as Doctor T. J. Eckleburg’s faded -eyes came into sight down the road, I remembered Gatsby’s caution -about gasoline. - -“We’ve got enough to get us to town,” said Tom. - -“But there’s a garage right here,” objected Jordan. “I don’t want to -get stalled in this baking heat.” - -Tom threw on both brakes impatiently, and we slid to an abrupt dusty -stop under Wilson’s sign. After a moment the proprietor emerged from -the interior of his establishment and gazed hollow-eyed at the car. - -“Let’s have some gas!” cried Tom roughly. “What do you think we -stopped for—to admire the view?” - -“I’m sick,” said Wilson without moving. “Been sick all day.” - -“What’s the matter?” - -“I’m all run down.” - -“Well, shall I help myself?” Tom demanded. “You sounded well enough on -the phone.” - -With an effort Wilson left the shade and support of the doorway and, -breathing hard, unscrewed the cap of the tank. In the sunlight his -face was green. - -“I didn’t mean to interrupt your lunch,” he said. “But I need money -pretty bad, and I was wondering what you were going to do with your -old car.” - -“How do you like this one?” inquired Tom. “I bought it last week.” - -“It’s a nice yellow one,” said Wilson, as he strained at the handle. - -“Like to buy it?” - -“Big chance,” Wilson smiled faintly. “No, but I could make some money -on the other.” - -“What do you want money for, all of a sudden?” - -“I’ve been here too long. I want to get away. My wife and I want to go -West.” - -“Your wife does,” exclaimed Tom, startled. - -“She’s been talking about it for ten years.” He rested for a moment -against the pump, shading his eyes. “And now she’s going whether she -wants to or not. I’m going to get her away.” - -The coupé flashed by us with a flurry of dust and the flash of a -waving hand. - -“What do I owe you?” demanded Tom harshly. - -“I just got wised up to something funny the last two days,” remarked -Wilson. “That’s why I want to get away. That’s why I been bothering -you about the car.” - -“What do I owe you?” - -“Dollar twenty.” - -The relentless beating heat was beginning to confuse me and I had a -bad moment there before I realized that so far his suspicions hadn’t -alighted on Tom. He had discovered that Myrtle had some sort of life -apart from him in another world, and the shock had made him physically -sick. I stared at him and then at Tom, who had made a parallel -discovery less than an hour before—and it occurred to me that there -was no difference between men, in intelligence or race, so profound as -the difference between the sick and the well. Wilson was so sick that -he looked guilty, unforgivably guilty—as if he had just got some poor -girl with child. - -“I’ll let you have that car,” said Tom. “I’ll send it over tomorrow -afternoon.” - -That locality was always vaguely disquieting, even in the broad glare -of afternoon, and now I turned my head as though I had been warned of -something behind. Over the ash-heaps the giant eyes of Doctor T. J. -Eckleburg kept their vigil, but I perceived, after a moment, that -other eyes were regarding us with peculiar intensity from less than -twenty feet away. - -In one of the windows over the garage the curtains had been moved -aside a little, and Myrtle Wilson was peering down at the car. So -engrossed was she that she had no consciousness of being observed, and -one emotion after another crept into her face like objects into a -slowly developing picture. Her expression was curiously familiar—it -was an expression I had often seen on women’s faces, but on Myrtle -Wilson’s face it seemed purposeless and inexplicable until I realized -that her eyes, wide with jealous terror, were fixed not on Tom, but on -Jordan Baker, whom she took to be his wife. - ------------------------------------------------------------------------- - -There is no confusion like the confusion of a simple mind, and as we -drove away Tom was feeling the hot whips of panic. His wife and his -mistress, until an hour ago secure and inviolate, were slipping -precipitately from his control. Instinct made him step on the -accelerator with the double purpose of overtaking Daisy and leaving -Wilson behind, and we sped along toward Astoria at fifty miles an -hour, until, among the spidery girders of the elevated, we came in -sight of the easygoing blue coupé. - -“Those big movies around Fiftieth Street are cool,” suggested -Jordan. “I love New York on summer afternoons when everyone’s away. -There’s something very sensuous about it—overripe, as if all sorts of -funny fruits were going to fall into your hands.” - -The word “sensuous” had the effect of further disquieting Tom, but -before he could invent a protest the coupé came to a stop, and Daisy -signalled us to draw up alongside. - -“Where are we going?” she cried. - -“How about the movies?” - -“It’s so hot,” she complained. “You go. We’ll ride around and meet you -after.” With an effort her wit rose faintly. “We’ll meet you on some -corner. I’ll be the man smoking two cigarettes.” - -“We can’t argue about it here,” Tom said impatiently, as a truck gave -out a cursing whistle behind us. “You follow me to the south side of -Central Park, in front of the Plaza.” - -Several times he turned his head and looked back for their car, and if -the traffic delayed them he slowed up until they came into sight. I -think he was afraid they would dart down a side-street and out of his -life forever. - -But they didn’t. And we all took the less explicable step of engaging -the parlour of a suite in the Plaza Hotel. - -The prolonged and tumultuous argument that ended by herding us into -that room eludes me, though I have a sharp physical memory that, in -the course of it, my underwear kept climbing like a damp snake around -my legs and intermittent beads of sweat raced cool across my back. -The notion originated with Daisy’s suggestion that we hire five -bathrooms and take cold baths, and then assumed more tangible form as -“a place to have a mint julep.” Each of us said over and over that it -was a “crazy idea”—we all talked at once to a baffled clerk and -thought, or pretended to think, that we were being very funny … - -The room was large and stifling, and, though it was already four -o’clock, opening the windows admitted only a gust of hot shrubbery -from the Park. Daisy went to the mirror and stood with her back to us, -fixing her hair. - -“It’s a swell suite,” whispered Jordan respectfully, and everyone -laughed. - -“Open another window,” commanded Daisy, without turning around. - -“There aren’t any more.” - -“Well, we’d better telephone for an axe—” - -“The thing to do is to forget about the heat,” said Tom impatiently. -“You make it ten times worse by crabbing about it.” - -He unrolled the bottle of whisky from the towel and put it on the -table. - -“Why not let her alone, old sport?” remarked Gatsby. “You’re the one -that wanted to come to town.” - -There was a moment of silence. The telephone book slipped from its -nail and splashed to the floor, whereupon Jordan whispered, “Excuse -me”—but this time no one laughed. - -“I’ll pick it up,” I offered. - -“I’ve got it.” Gatsby examined the parted string, muttered “Hum!” in -an interested way, and tossed the book on a chair. - -“That’s a great expression of yours, isn’t it?” said Tom sharply. - -“What is?” - -“All this ‘old sport’ business. Where’d you pick that up?” - -“Now see here, Tom,” said Daisy, turning around from the mirror, “if -you’re going to make personal remarks I won’t stay here a minute. -Call up and order some ice for the mint julep.” - -As Tom took up the receiver the compressed heat exploded into sound -and we were listening to the portentous chords of Mendelssohn’s -Wedding March from the ballroom below. - -“Imagine marrying anybody in this heat!” cried Jordan dismally. - -“Still—I was married in the middle of June,” Daisy remembered. -“Louisville in June! Somebody fainted. Who was it fainted, Tom?” - -“Biloxi,” he answered shortly. - -“A man named Biloxi. ‘Blocks’ Biloxi, and he made boxes—that’s a -fact—and he was from Biloxi, Tennessee.” - -“They carried him into my house,” appended Jordan, “because we lived -just two doors from the church. And he stayed three weeks, until Daddy -told him he had to get out. The day after he left Daddy died.” After -a moment she added. “There wasn’t any connection.” - -“I used to know a Bill Biloxi from Memphis,” I remarked. - -“That was his cousin. I knew his whole family history before he -left. He gave me an aluminium putter that I use today.” - -The music had died down as the ceremony began and now a long cheer -floated in at the window, followed by intermittent cries of -“Yea—ea—ea!” and finally by a burst of jazz as the dancing began. - -“We’re getting old,” said Daisy. “If we were young we’d rise and -dance.” - -“Remember Biloxi,” Jordan warned her. “Where’d you know him, Tom?” - -“Biloxi?” He concentrated with an effort. “I didn’t know him. He was a -friend of Daisy’s.” - -“He was not,” she denied. “I’d never seen him before. He came down in -the private car.” - -“Well, he said he knew you. He said he was raised in Louisville. Asa -Bird brought him around at the last minute and asked if we had room -for him.” - -Jordan smiled. - -“He was probably bumming his way home. He told me he was president of -your class at Yale.” - -Tom and I looked at each other blankly. - -“Biloxi?” - -“First place, we didn’t have any president—” - -Gatsby’s foot beat a short, restless tattoo and Tom eyed him suddenly. - -“By the way, Mr. Gatsby, I understand you’re an Oxford man.” - -“Not exactly.” - -“Oh, yes, I understand you went to Oxford.” - -“Yes—I went there.” - -A pause. Then Tom’s voice, incredulous and insulting: - -“You must have gone there about the time Biloxi went to New Haven.” - -Another pause. A waiter knocked and came in with crushed mint and ice -but the silence was unbroken by his “thank you” and the soft closing -of the door. This tremendous detail was to be cleared up at last. - -“I told you I went there,” said Gatsby. - -“I heard you, but I’d like to know when.” - -“It was in nineteen-nineteen, I only stayed five months. That’s why I -can’t really call myself an Oxford man.” - -Tom glanced around to see if we mirrored his unbelief. But we were all -looking at Gatsby. - -“It was an opportunity they gave to some of the officers after the -armistice,” he continued. “We could go to any of the universities in -England or France.” - -I wanted to get up and slap him on the back. I had one of those -renewals of complete faith in him that I’d experienced before. - -Daisy rose, smiling faintly, and went to the table. - -“Open the whisky, Tom,” she ordered, “and I’ll make you a mint julep. -Then you won’t seem so stupid to yourself … Look at the mint!” - -“Wait a minute,” snapped Tom, “I want to ask Mr. Gatsby one more -question.” - -“Go on,” Gatsby said politely. - -“What kind of a row are you trying to cause in my house anyhow?” - -They were out in the open at last and Gatsby was content. - -“He isn’t causing a row,” Daisy looked desperately from one to the -other. “You’re causing a row. Please have a little self-control.” - -“Self-control!” repeated Tom incredulously. “I suppose the latest -thing is to sit back and let Mr. Nobody from Nowhere make love to your -wife. Well, if that’s the idea you can count me out … Nowadays people -begin by sneering at family life and family institutions, and next -they’ll throw everything overboard and have intermarriage between -black and white.” - -Flushed with his impassioned gibberish, he saw himself standing alone -on the last barrier of civilization. - -“We’re all white here,” murmured Jordan. - -“I know I’m not very popular. I don’t give big parties. I suppose -you’ve got to make your house into a pigsty in order to have any -friends—in the modern world.” - -Angry as I was, as we all were, I was tempted to laugh whenever he -opened his mouth. The transition from libertine to prig was so -complete. - -“I’ve got something to tell you, old sport—” began Gatsby. But Daisy -guessed at his intention. - -“Please don’t!” she interrupted helplessly. “Please let’s all go -home. Why don’t we all go home?” - -“That’s a good idea,” I got up. “Come on, Tom. Nobody wants a drink.” - -“I want to know what Mr. Gatsby has to tell me.” - -“Your wife doesn’t love you,” said Gatsby. “She’s never loved you. -She loves me.” - -“You must be crazy!” exclaimed Tom automatically. - -Gatsby sprang to his feet, vivid with excitement. - -“She never loved you, do you hear?” he cried. “She only married you -because I was poor and she was tired of waiting for me. It was a -terrible mistake, but in her heart she never loved anyone except me!” - -At this point Jordan and I tried to go, but Tom and Gatsby insisted -with competitive firmness that we remain—as though neither of them had -anything to conceal and it would be a privilege to partake vicariously -of their emotions. - -“Sit down, Daisy,” Tom’s voice groped unsuccessfully for the paternal -note. “What’s been going on? I want to hear all about it.” - -“I told you what’s been going on,” said Gatsby. “Going on for five -years—and you didn’t know.” - -Tom turned to Daisy sharply. - -“You’ve been seeing this fellow for five years?” - -“Not seeing,” said Gatsby. “No, we couldn’t meet. But both of us loved -each other all that time, old sport, and you didn’t know. I used to -laugh sometimes”—but there was no laughter in his eyes—“to think that -you didn’t know.” - -“Oh—that’s all.” Tom tapped his thick fingers together like a -clergyman and leaned back in his chair. - -“You’re crazy!” he exploded. “I can’t speak about what happened five -years ago, because I didn’t know Daisy then—and I’ll be damned if I -see how you got within a mile of her unless you brought the groceries -to the back door. But all the rest of that’s a God damned lie. Daisy -loved me when she married me and she loves me now.” - -“No,” said Gatsby, shaking his head. - -“She does, though. The trouble is that sometimes she gets foolish -ideas in her head and doesn’t know what she’s doing.” He nodded -sagely. “And what’s more, I love Daisy too. Once in a while I go off -on a spree and make a fool of myself, but I always come back, and in -my heart I love her all the time.” - -“You’re revolting,” said Daisy. She turned to me, and her voice, -dropping an octave lower, filled the room with thrilling scorn: “Do -you know why we left Chicago? I’m surprised that they didn’t treat you -to the story of that little spree.” - -Gatsby walked over and stood beside her. - -“Daisy, that’s all over now,” he said earnestly. “It doesn’t matter -any more. Just tell him the truth—that you never loved him—and it’s -all wiped out forever.” - -She looked at him blindly. “Why—how could I love him—possibly?” - -“You never loved him.” - -She hesitated. Her eyes fell on Jordan and me with a sort of appeal, -as though she realized at last what she was doing—and as though she -had never, all along, intended doing anything at all. But it was done -now. It was too late. - -“I never loved him,” she said, with perceptible reluctance. - -“Not at Kapiolani?” demanded Tom suddenly. - -“No.” - -From the ballroom beneath, muffled and suffocating chords were -drifting up on hot waves of air. - -“Not that day I carried you down from the Punch Bowl to keep your -shoes dry?” There was a husky tenderness in his tone … “Daisy?” - -“Please don’t.” Her voice was cold, but the rancour was gone from it. -She looked at Gatsby. “There, Jay,” she said—but her hand as she tried -to light a cigarette was trembling. Suddenly she threw the cigarette -and the burning match on the carpet. - -“Oh, you want too much!” she cried to Gatsby. “I love you now—isn’t -that enough? I can’t help what’s past.” She began to sob -helplessly. “I did love him once—but I loved you too.” - -Gatsby’s eyes opened and closed. - -“You loved me too?” he repeated. - -“Even that’s a lie,” said Tom savagely. “She didn’t know you were -alive. Why—there’s things between Daisy and me that you’ll never know, -things that neither of us can ever forget.” - -The words seemed to bite physically into Gatsby. - -“I want to speak to Daisy alone,” he insisted. “She’s all excited -now—” - -“Even alone I can’t say I never loved Tom,” she admitted in a pitiful -voice. “It wouldn’t be true.” - -“Of course it wouldn’t,” agreed Tom. - -She turned to her husband. - -“As if it mattered to you,” she said. - -“Of course it matters. I’m going to take better care of you from now -on.” - -“You don’t understand,” said Gatsby, with a touch of panic. “You’re -not going to take care of her any more.” - -“I’m not?” Tom opened his eyes wide and laughed. He could afford to -control himself now. “Why’s that?” - -“Daisy’s leaving you.” - -“Nonsense.” - -“I am, though,” she said with a visible effort. - -“She’s not leaving me!” Tom’s words suddenly leaned down over Gatsby. -“Certainly not for a common swindler who’d have to steal the ring he -put on her finger.” - -“I won’t stand this!” cried Daisy. “Oh, please let’s get out.” - -“Who are you, anyhow?” broke out Tom. “You’re one of that bunch that -hangs around with Meyer Wolfshiem—that much I happen to know. I’ve -made a little investigation into your affairs—and I’ll carry it -further tomorrow.” - -“You can suit yourself about that, old sport,” said Gatsby steadily. - -“I found out what your ‘drugstores’ were.” He turned to us and spoke -rapidly. “He and this Wolfshiem bought up a lot of side-street -drugstores here and in Chicago and sold grain alcohol over the -counter. That’s one of his little stunts. I picked him for a -bootlegger the first time I saw him, and I wasn’t far wrong.” - -“What about it?” said Gatsby politely. “I guess your friend Walter -Chase wasn’t too proud to come in on it.” - -“And you left him in the lurch, didn’t you? You let him go to jail for -a month over in New Jersey. God! You ought to hear Walter on the -subject of you.” - -“He came to us dead broke. He was very glad to pick up some money, old -sport.” - -“Don’t you call me ‘old sport’!” cried Tom. Gatsby said -nothing. “Walter could have you up on the betting laws too, but -Wolfshiem scared him into shutting his mouth.” - -That unfamiliar yet recognizable look was back again in Gatsby’s face. - -“That drugstore business was just small change,” continued Tom slowly, -“but you’ve got something on now that Walter’s afraid to tell me -about.” - -I glanced at Daisy, who was staring terrified between Gatsby and her -husband, and at Jordan, who had begun to balance an invisible but -absorbing object on the tip of her chin. Then I turned back to -Gatsby—and was startled at his expression. He looked—and this is said -in all contempt for the babbled slander of his garden—as if he had -“killed a man.” For a moment the set of his face could be described in -just that fantastic way. - -It passed, and he began to talk excitedly to Daisy, denying -everything, defending his name against accusations that had not been -made. But with every word she was drawing further and further into -herself, so he gave that up, and only the dead dream fought on as the -afternoon slipped away, trying to touch what was no longer tangible, -struggling unhappily, undespairingly, toward that lost voice across -the room. - -The voice begged again to go. - -“Please, Tom! I can’t stand this any more.” - -Her frightened eyes told that whatever intentions, whatever courage -she had had, were definitely gone. - -“You two start on home, Daisy,” said Tom. “In Mr. Gatsby’s car.” - -She looked at Tom, alarmed now, but he insisted with magnanimous -scorn. - -“Go on. He won’t annoy you. I think he realizes that his presumptuous -little flirtation is over.” - -They were gone, without a word, snapped out, made accidental, -isolated, like ghosts, even from our pity. - -After a moment Tom got up and began wrapping the unopened bottle of -whisky in the towel. - -“Want any of this stuff? Jordan? … Nick?” - -I didn’t answer. - -“Nick?” He asked again. - -“What?” - -“Want any?” - -“No … I just remembered that today’s my birthday.” - -I was thirty. Before me stretched the portentous, menacing road of a -new decade. - -It was seven o’clock when we got into the coupé with him and started -for Long Island. Tom talked incessantly, exulting and laughing, but -his voice was as remote from Jordan and me as the foreign clamour on -the sidewalk or the tumult of the elevated overhead. Human sympathy -has its limits, and we were content to let all their tragic arguments -fade with the city lights behind. Thirty—the promise of a decade of -loneliness, a thinning list of single men to know, a thinning -briefcase of enthusiasm, thinning hair. But there was Jordan beside -me, who, unlike Daisy, was too wise ever to carry well-forgotten -dreams from age to age. As we passed over the dark bridge her wan face -fell lazily against my coat’s shoulder and the formidable stroke of -thirty died away with the reassuring pressure of her hand. - -So we drove on toward death through the cooling twilight. - ------------------------------------------------------------------------- - -The young Greek, Michaelis, who ran the coffee joint beside the -ash-heaps was the principal witness at the inquest. He had slept -through the heat until after five, when he strolled over to the -garage, and found George Wilson sick in his office—really sick, pale -as his own pale hair and shaking all over. Michaelis advised him to go -to bed, but Wilson refused, saying that he’d miss a lot of business if -he did. While his neighbour was trying to persuade him a violent -racket broke out overhead. - -“I’ve got my wife locked in up there,” explained Wilson calmly. -“She’s going to stay there till the day after tomorrow, and then we’re -going to move away.” - -Michaelis was astonished; they had been neighbours for four years, and -Wilson had never seemed faintly capable of such a statement. -Generally he was one of these worn-out men: when he wasn’t working, he -sat on a chair in the doorway and stared at the people and the cars -that passed along the road. When anyone spoke to him he invariably -laughed in an agreeable, colourless way. He was his wife’s man and not -his own. - -So naturally Michaelis tried to find out what had happened, but Wilson -wouldn’t say a word—instead he began to throw curious, suspicious -glances at his visitor and ask him what he’d been doing at certain -times on certain days. Just as the latter was getting uneasy, some -workmen came past the door bound for his restaurant, and Michaelis -took the opportunity to get away, intending to come back later. But he -didn’t. He supposed he forgot to, that’s all. When he came outside -again, a little after seven, he was reminded of the conversation -because he heard Mrs. Wilson’s voice, loud and scolding, downstairs in -the garage. - -“Beat me!” he heard her cry. “Throw me down and beat me, you dirty -little coward!” - -A moment later she rushed out into the dusk, waving her hands and -shouting—before he could move from his door the business was over. - -The “death car” as the newspapers called it, didn’t stop; it came out -of the gathering darkness, wavered tragically for a moment, and then -disappeared around the next bend. Mavro Michaelis wasn’t even sure of -its colour—he told the first policeman that it was light green. The -other car, the one going toward New York, came to rest a hundred yards -beyond, and its driver hurried back to where Myrtle Wilson, her life -violently extinguished, knelt in the road and mingled her thick dark -blood with the dust. - -Michaelis and this man reached her first, but when they had torn open -her shirtwaist, still damp with perspiration, they saw that her left -breast was swinging loose like a flap, and there was no need to listen -for the heart beneath. The mouth was wide open and ripped a little at -the corners, as though she had choked a little in giving up the -tremendous vitality she had stored so long. - ------------------------------------------------------------------------- - -We saw the three or four automobiles and the crowd when we were still -some distance away. - -“Wreck!” said Tom. “That’s good. Wilson’ll have a little business at -last.” - -He slowed down, but still without any intention of stopping, until, as -we came nearer, the hushed, intent faces of the people at the garage -door made him automatically put on the brakes. - -“We’ll take a look,” he said doubtfully, “just a look.” - -I became aware now of a hollow, wailing sound which issued incessantly -from the garage, a sound which as we got out of the coupé and walked -toward the door resolved itself into the words “Oh, my God!” uttered -over and over in a gasping moan. - -“There’s some bad trouble here,” said Tom excitedly. - -He reached up on tiptoes and peered over a circle of heads into the -garage, which was lit only by a yellow light in a swinging metal -basket overhead. Then he made a harsh sound in his throat, and with a -violent thrusting movement of his powerful arms pushed his way -through. - -The circle closed up again with a running murmur of expostulation; it -was a minute before I could see anything at all. Then new arrivals -deranged the line, and Jordan and I were pushed suddenly inside. - -Myrtle Wilson’s body, wrapped in a blanket, and then in another -blanket, as though she suffered from a chill in the hot night, lay on -a worktable by the wall, and Tom, with his back to us, was bending -over it, motionless. Next to him stood a motorcycle policeman taking -down names with much sweat and correction in a little book. At first I -couldn’t find the source of the high, groaning words that echoed -clamorously through the bare garage—then I saw Wilson standing on the -raised threshold of his office, swaying back and forth and holding to -the doorposts with both hands. Some man was talking to him in a low -voice and attempting, from time to time, to lay a hand on his -shoulder, but Wilson neither heard nor saw. His eyes would drop slowly -from the swinging light to the laden table by the wall, and then jerk -back to the light again, and he gave out incessantly his high, -horrible call: - -“Oh, my Ga-od! Oh, my Ga-od! Oh, Ga-od! Oh, my Ga-od!” - -Presently Tom lifted his head with a jerk and, after staring around -the garage with glazed eyes, addressed a mumbled incoherent remark to -the policeman. - -“M-a-v—” the policeman was saying, “—o—” - -“No, r—” corrected the man, “M-a-v-r-o—” - -“Listen to me!” muttered Tom fiercely. - -“r—” said the policeman, “o—” - -“g—” - -“g—” He looked up as Tom’s broad hand fell sharply on his shoulder. -“What you want, fella?” - -“What happened?—that’s what I want to know.” - -“Auto hit her. Ins’antly killed.” - -“Instantly killed,” repeated Tom, staring. - -“She ran out ina road. Son-of-a-bitch didn’t even stopus car.” - -“There was two cars,” said Michaelis, “one comin’, one goin’, see?” - -“Going where?” asked the policeman keenly. - -“One goin’ each way. Well, she”—his hand rose toward the blankets but -stopped halfway and fell to his side—“she ran out there an’ the one -comin’ from N’York knock right into her, goin’ thirty or forty miles -an hour.” - -“What’s the name of this place here?” demanded the officer. - -“Hasn’t got any name.” - -A pale well-dressed negro stepped near. - -“It was a yellow car,” he said, “big yellow car. New.” - -“See the accident?” asked the policeman. - -“No, but the car passed me down the road, going faster’n forty. Going -fifty, sixty.” - -“Come here and let’s have your name. Look out now. I want to get his -name.” - -Some words of this conversation must have reached Wilson, swaying in -the office door, for suddenly a new theme found voice among his -grasping cries: - -“You don’t have to tell me what kind of car it was! I know what kind -of car it was!” - -Watching Tom, I saw the wad of muscle back of his shoulder tighten -under his coat. He walked quickly over to Wilson and, standing in -front of him, seized him firmly by the upper arms. - -“You’ve got to pull yourself together,” he said with soothing -gruffness. - -Wilson’s eyes fell upon Tom; he started up on his tiptoes and then -would have collapsed to his knees had not Tom held him upright. - -“Listen,” said Tom, shaking him a little. “I just got here a minute -ago, from New York. I was bringing you that coupé we’ve been talking -about. That yellow car I was driving this afternoon wasn’t mine—do you -hear? I haven’t seen it all afternoon.” - -Only the negro and I were near enough to hear what he said, but the -policeman caught something in the tone and looked over with truculent -eyes. - -“What’s all that?” he demanded. - -“I’m a friend of his.” Tom turned his head but kept his hands firm on -Wilson’s body. “He says he knows the car that did it … It was a yellow -car.” - -Some dim impulse moved the policeman to look suspiciously at Tom. - -“And what colour’s your car?” - -“It’s a blue car, a coupé.” - -“We’ve come straight from New York,” I said. - -Someone who had been driving a little behind us confirmed this, and -the policeman turned away. - -“Now, if you’ll let me have that name again correct—” - -Picking up Wilson like a doll, Tom carried him into the office, set -him down in a chair, and came back. - -“If somebody’ll come here and sit with him,” he snapped -authoritatively. He watched while the two men standing closest glanced -at each other and went unwillingly into the room. Then Tom shut the -door on them and came down the single step, his eyes avoiding the -table. As he passed close to me he whispered: “Let’s get out.” - -Self-consciously, with his authoritative arms breaking the way, we -pushed through the still gathering crowd, passing a hurried doctor, -case in hand, who had been sent for in wild hope half an hour ago. - -Tom drove slowly until we were beyond the bend—then his foot came down -hard, and the coupé raced along through the night. In a little while I -heard a low husky sob, and saw that the tears were overflowing down -his face. - -“The God damned coward!” he whimpered. “He didn’t even stop his car.” - ------------------------------------------------------------------------- - -The Buchanans’ house floated suddenly toward us through the dark -rustling trees. Tom stopped beside the porch and looked up at the -second floor, where two windows bloomed with light among the vines. - -“Daisy’s home,” he said. As we got out of the car he glanced at me and -frowned slightly. - -“I ought to have dropped you in West Egg, Nick. There’s nothing we can -do tonight.” - -A change had come over him, and he spoke gravely, and with decision. -As we walked across the moonlight gravel to the porch he disposed of -the situation in a few brisk phrases. - -“I’ll telephone for a taxi to take you home, and while you’re waiting -you and Jordan better go in the kitchen and have them get you some -supper—if you want any.” He opened the door. “Come in.” - -“No, thanks. But I’d be glad if you’d order me the taxi. I’ll wait -outside.” - -Jordan put her hand on my arm. - -“Won’t you come in, Nick?” - -“No, thanks.” - -I was feeling a little sick and I wanted to be alone. But Jordan -lingered for a moment more. - -“It’s only half-past nine,” she said. - -I’d be damned if I’d go in; I’d had enough of all of them for one day, -and suddenly that included Jordan too. She must have seen something of -this in my expression, for she turned abruptly away and ran up the -porch steps into the house. I sat down for a few minutes with my head -in my hands, until I heard the phone taken up inside and the butler’s -voice calling a taxi. Then I walked slowly down the drive away from -the house, intending to wait by the gate. - -I hadn’t gone twenty yards when I heard my name and Gatsby stepped -from between two bushes into the path. I must have felt pretty weird -by that time, because I could think of nothing except the luminosity -of his pink suit under the moon. - -“What are you doing?” I inquired. - -“Just standing here, old sport.” - -Somehow, that seemed a despicable occupation. For all I knew he was -going to rob the house in a moment; I wouldn’t have been surprised to -see sinister faces, the faces of “Wolfshiem’s people,” behind him in -the dark shrubbery. - -“Did you see any trouble on the road?” he asked after a minute. - -“Yes.” - -He hesitated. - -“Was she killed?” - -“Yes.” - -“I thought so; I told Daisy I thought so. It’s better that the shock -should all come at once. She stood it pretty well.” - -He spoke as if Daisy’s reaction was the only thing that mattered. - -“I got to West Egg by a side road,” he went on, “and left the car in -my garage. I don’t think anybody saw us, but of course I can’t be -sure.” - -I disliked him so much by this time that I didn’t find it necessary to -tell him he was wrong. - -“Who was the woman?” he inquired. - -“Her name was Wilson. Her husband owns the garage. How the devil did -it happen?” - -“Well, I tried to swing the wheel—” He broke off, and suddenly I -guessed at the truth. - -“Was Daisy driving?” - -“Yes,” he said after a moment, “but of course I’ll say I was. You see, -when we left New York she was very nervous and she thought it would -steady her to drive—and this woman rushed out at us just as we were -passing a car coming the other way. It all happened in a minute, but -it seemed to me that she wanted to speak to us, thought we were -somebody she knew. Well, first Daisy turned away from the woman toward -the other car, and then she lost her nerve and turned back. The second -my hand reached the wheel I felt the shock—it must have killed her -instantly.” - -“It ripped her open—” - -“Don’t tell me, old sport.” He winced. “Anyhow—Daisy stepped on it. I -tried to make her stop, but she couldn’t, so I pulled on the emergency -brake. Then she fell over into my lap and I drove on. - -“She’ll be all right tomorrow,” he said presently. “I’m just going to -wait here and see if he tries to bother her about that unpleasantness -this afternoon. She’s locked herself into her room, and if he tries -any brutality she’s going to turn the light out and on again.” - -“He won’t touch her,” I said. “He’s not thinking about her.” - -“I don’t trust him, old sport.” - -“How long are you going to wait?” - -“All night, if necessary. Anyhow, till they all go to bed.” - -A new point of view occurred to me. Suppose Tom found out that Daisy -had been driving. He might think he saw a connection in it—he might -think anything. I looked at the house; there were two or three bright -windows downstairs and the pink glow from Daisy’s room on the ground -floor. - -“You wait here,” I said. “I’ll see if there’s any sign of a -commotion.” - -I walked back along the border of the lawn, traversed the gravel -softly, and tiptoed up the veranda steps. The drawing-room curtains -were open, and I saw that the room was empty. Crossing the porch where -we had dined that June night three months before, I came to a small -rectangle of light which I guessed was the pantry window. The blind -was drawn, but I found a rift at the sill. - -Daisy and Tom were sitting opposite each other at the kitchen table, -with a plate of cold fried chicken between them, and two bottles of -ale. He was talking intently across the table at her, and in his -earnestness his hand had fallen upon and covered her own. Once in a -while she looked up at him and nodded in agreement. - -They weren’t happy, and neither of them had touched the chicken or the -ale—and yet they weren’t unhappy either. There was an unmistakable air -of natural intimacy about the picture, and anybody would have said -that they were conspiring together. - -As I tiptoed from the porch I heard my taxi feeling its way along the -dark road toward the house. Gatsby was waiting where I had left him in -the drive. - -“Is it all quiet up there?” he asked anxiously. - -“Yes, it’s all quiet.” I hesitated. “You’d better come home and get -some sleep.” - -He shook his head. - -“I want to wait here till Daisy goes to bed. Good night, old sport.” - -He put his hands in his coat pockets and turned back eagerly to his -scrutiny of the house, as though my presence marred the sacredness of -the vigil. So I walked away and left him standing there in the -moonlight—watching over nothing. - - - VIII - -I couldn’t sleep all night; a foghorn was groaning incessantly on the -Sound, and I tossed half-sick between grotesque reality and savage, -frightening dreams. Toward dawn I heard a taxi go up Gatsby’s drive, -and immediately I jumped out of bed and began to dress—I felt that I -had something to tell him, something to warn him about, and morning -would be too late. - -Crossing his lawn, I saw that his front door was still open and he was -leaning against a table in the hall, heavy with dejection or sleep. - -“Nothing happened,” he said wanly. “I waited, and about four o’clock -she came to the window and stood there for a minute and then turned -out the light.” - -His house had never seemed so enormous to me as it did that night when -we hunted through the great rooms for cigarettes. We pushed aside -curtains that were like pavilions, and felt over innumerable feet of -dark wall for electric light switches—once I tumbled with a sort of -splash upon the keys of a ghostly piano. There was an inexplicable -amount of dust everywhere, and the rooms were musty, as though they -hadn’t been aired for many days. I found the humidor on an unfamiliar -table, with two stale, dry cigarettes inside. Throwing open the French -windows of the drawing-room, we sat smoking out into the darkness. - -“You ought to go away,” I said. “It’s pretty certain they’ll trace -your car.” - -“Go away now, old sport?” - -“Go to Atlantic City for a week, or up to Montreal.” - -He wouldn’t consider it. He couldn’t possibly leave Daisy until he -knew what she was going to do. He was clutching at some last hope and -I couldn’t bear to shake him free. - -It was this night that he told me the strange story of his youth with -Dan Cody—told it to me because “Jay Gatsby” had broken up like glass -against Tom’s hard malice, and the long secret extravaganza was played -out. I think that he would have acknowledged anything now, without -reserve, but he wanted to talk about Daisy. - -She was the first “nice” girl he had ever known. In various unrevealed -capacities he had come in contact with such people, but always with -indiscernible barbed wire between. He found her excitingly -desirable. He went to her house, at first with other officers from -Camp Taylor, then alone. It amazed him—he had never been in such a -beautiful house before. But what gave it an air of breathless -intensity, was that Daisy lived there—it was as casual a thing to her -as his tent out at camp was to him. There was a ripe mystery about it, -a hint of bedrooms upstairs more beautiful and cool than other -bedrooms, of gay and radiant activities taking place through its -corridors, and of romances that were not musty and laid away already -in lavender but fresh and breathing and redolent of this year’s -shining motorcars and of dances whose flowers were scarcely -withered. It excited him, too, that many men had already loved -Daisy—it increased her value in his eyes. He felt their presence all -about the house, pervading the air with the shades and echoes of still -vibrant emotions. - -But he knew that he was in Daisy’s house by a colossal -accident. However glorious might be his future as Jay Gatsby, he was -at present a penniless young man without a past, and at any moment the -invisible cloak of his uniform might slip from his shoulders. So he -made the most of his time. He took what he could get, ravenously and -unscrupulously—eventually he took Daisy one still October night, took -her because he had no real right to touch her hand. - -He might have despised himself, for he had certainly taken her under -false pretences. I don’t mean that he had traded on his phantom -millions, but he had deliberately given Daisy a sense of security; he -let her believe that he was a person from much the same strata as -herself—that he was fully able to take care of her. As a matter of -fact, he had no such facilities—he had no comfortable family standing -behind him, and he was liable at the whim of an impersonal government -to be blown anywhere about the world. - -But he didn’t despise himself and it didn’t turn out as he had -imagined. He had intended, probably, to take what he could and go—but -now he found that he had committed himself to the following of a -grail. He knew that Daisy was extraordinary, but he didn’t realize -just how extraordinary a “nice” girl could be. She vanished into her -rich house, into her rich, full life, leaving Gatsby—nothing. He felt -married to her, that was all. - -When they met again, two days later, it was Gatsby who was breathless, -who was, somehow, betrayed. Her porch was bright with the bought -luxury of star-shine; the wicker of the settee squeaked fashionably as -she turned toward him and he kissed her curious and lovely mouth. She -had caught a cold, and it made her voice huskier and more charming -than ever, and Gatsby was overwhelmingly aware of the youth and -mystery that wealth imprisons and preserves, of the freshness of many -clothes, and of Daisy, gleaming like silver, safe and proud above the -hot struggles of the poor. - ------------------------------------------------------------------------- - -“I can’t describe to you how surprised I was to find out I loved her, -old sport. I even hoped for a while that she’d throw me over, but she -didn’t, because she was in love with me too. She thought I knew a lot -because I knew different things from her … Well, there I was, way off -my ambitions, getting deeper in love every minute, and all of a sudden -I didn’t care. What was the use of doing great things if I could have -a better time telling her what I was going to do?” - -On the last afternoon before he went abroad, he sat with Daisy in his -arms for a long, silent time. It was a cold fall day, with fire in the -room and her cheeks flushed. Now and then she moved and he changed his -arm a little, and once he kissed her dark shining hair. The afternoon -had made them tranquil for a while, as if to give them a deep memory -for the long parting the next day promised. They had never been closer -in their month of love, nor communicated more profoundly one with -another, than when she brushed silent lips against his coat’s shoulder -or when he touched the end of her fingers, gently, as though she were -asleep. - ------------------------------------------------------------------------- - -He did extraordinarily well in the war. He was a captain before he -went to the front, and following the Argonne battles he got his -majority and the command of the divisional machine-guns. After the -armistice he tried frantically to get home, but some complication or -misunderstanding sent him to Oxford instead. He was worried now—there -was a quality of nervous despair in Daisy’s letters. She didn’t see -why he couldn’t come. She was feeling the pressure of the world -outside, and she wanted to see him and feel his presence beside her -and be reassured that she was doing the right thing after all. - -For Daisy was young and her artificial world was redolent of orchids -and pleasant, cheerful snobbery and orchestras which set the rhythm of -the year, summing up the sadness and suggestiveness of life in new -tunes. All night the saxophones wailed the hopeless comment of the -“Beale Street Blues” while a hundred pairs of golden and silver -slippers shuffled the shining dust. At the grey tea hour there were -always rooms that throbbed incessantly with this low, sweet fever, -while fresh faces drifted here and there like rose petals blown by the -sad horns around the floor. - -Through this twilight universe Daisy began to move again with the -season; suddenly she was again keeping half a dozen dates a day with -half a dozen men, and drowsing asleep at dawn with the beads and -chiffon of an evening-dress tangled among dying orchids on the floor -beside her bed. And all the time something within her was crying for a -decision. She wanted her life shaped now, immediately—and the decision -must be made by some force—of love, of money, of unquestionable -practicality—that was close at hand. - -That force took shape in the middle of spring with the arrival of Tom -Buchanan. There was a wholesome bulkiness about his person and his -position, and Daisy was flattered. Doubtless there was a certain -struggle and a certain relief. The letter reached Gatsby while he was -still at Oxford. - ------------------------------------------------------------------------- - -It was dawn now on Long Island and we went about opening the rest of -the windows downstairs, filling the house with grey-turning, -gold-turning light. The shadow of a tree fell abruptly across the dew -and ghostly birds began to sing among the blue leaves. There was a -slow, pleasant movement in the air, scarcely a wind, promising a cool, -lovely day. - -“I don’t think she ever loved him.” Gatsby turned around from a window -and looked at me challengingly. “You must remember, old sport, she was -very excited this afternoon. He told her those things in a way that -frightened her—that made it look as if I was some kind of cheap -sharper. And the result was she hardly knew what she was saying.” - -He sat down gloomily. - -“Of course she might have loved him just for a minute, when they were -first married—and loved me more even then, do you see?” - -Suddenly he came out with a curious remark. - -“In any case,” he said, “it was just personal.” - -What could you make of that, except to suspect some intensity in his -conception of the affair that couldn’t be measured? - -He came back from France when Tom and Daisy were still on their -wedding trip, and made a miserable but irresistible journey to -Louisville on the last of his army pay. He stayed there a week, -walking the streets where their footsteps had clicked together through -the November night and revisiting the out-of-the-way places to which -they had driven in her white car. Just as Daisy’s house had always -seemed to him more mysterious and gay than other houses, so his idea -of the city itself, even though she was gone from it, was pervaded -with a melancholy beauty. - -He left feeling that if he had searched harder, he might have found -her—that he was leaving her behind. The day-coach—he was penniless -now—was hot. He went out to the open vestibule and sat down on a -folding-chair, and the station slid away and the backs of unfamiliar -buildings moved by. Then out into the spring fields, where a yellow -trolley raced them for a minute with people in it who might once have -seen the pale magic of her face along the casual street. - -The track curved and now it was going away from the sun, which, as it -sank lower, seemed to spread itself in benediction over the vanishing -city where she had drawn her breath. He stretched out his hand -desperately as if to snatch only a wisp of air, to save a fragment of -the spot that she had made lovely for him. But it was all going by too -fast now for his blurred eyes and he knew that he had lost that part -of it, the freshest and the best, forever. - -It was nine o’clock when we finished breakfast and went out on the -porch. The night had made a sharp difference in the weather and there -was an autumn flavour in the air. The gardener, the last one of -Gatsby’s former servants, came to the foot of the steps. - -“I’m going to drain the pool today, Mr. Gatsby. Leaves’ll start -falling pretty soon, and then there’s always trouble with the pipes.” - -“Don’t do it today,” Gatsby answered. He turned to me apologetically. -“You know, old sport, I’ve never used that pool all summer?” - -I looked at my watch and stood up. - -“Twelve minutes to my train.” - -I didn’t want to go to the city. I wasn’t worth a decent stroke of -work, but it was more than that—I didn’t want to leave Gatsby. I -missed that train, and then another, before I could get myself away. - -“I’ll call you up,” I said finally. - -“Do, old sport.” - -“I’ll call you about noon.” - -We walked slowly down the steps. - -“I suppose Daisy’ll call too.” He looked at me anxiously, as if he -hoped I’d corroborate this. - -“I suppose so.” - -“Well, goodbye.” - -We shook hands and I started away. Just before I reached the hedge I -remembered something and turned around. - -“They’re a rotten crowd,” I shouted across the lawn. “You’re worth the -whole damn bunch put together.” - -I’ve always been glad I said that. It was the only compliment I ever -gave him, because I disapproved of him from beginning to end. First he -nodded politely, and then his face broke into that radiant and -understanding smile, as if we’d been in ecstatic cahoots on that fact -all the time. His gorgeous pink rag of a suit made a bright spot of -colour against the white steps, and I thought of the night when I -first came to his ancestral home, three months before. The lawn and -drive had been crowded with the faces of those who guessed at his -corruption—and he had stood on those steps, concealing his -incorruptible dream, as he waved them goodbye. - -I thanked him for his hospitality. We were always thanking him for -that—I and the others. - -“Goodbye,” I called. “I enjoyed breakfast, Gatsby.” - ------------------------------------------------------------------------- - -Up in the city, I tried for a while to list the quotations on an -interminable amount of stock, then I fell asleep in my swivel-chair. -Just before noon the phone woke me, and I started up with sweat -breaking out on my forehead. It was Jordan Baker; she often called me -up at this hour because the uncertainty of her own movements between -hotels and clubs and private houses made her hard to find in any other -way. Usually her voice came over the wire as something fresh and cool, -as if a divot from a green golf-links had come sailing in at the -office window, but this morning it seemed harsh and dry. - -“I’ve left Daisy’s house,” she said. “I’m at Hempstead, and I’m going -down to Southampton this afternoon.” - -Probably it had been tactful to leave Daisy’s house, but the act -annoyed me, and her next remark made me rigid. - -“You weren’t so nice to me last night.” - -“How could it have mattered then?” - -Silence for a moment. Then: - -“However—I want to see you.” - -“I want to see you, too.” - -“Suppose I don’t go to Southampton, and come into town this -afternoon?” - -“No—I don’t think this afternoon.” - -“Very well.” - -“It’s impossible this afternoon. Various—” - -We talked like that for a while, and then abruptly we weren’t talking -any longer. I don’t know which of us hung up with a sharp click, but I -know I didn’t care. I couldn’t have talked to her across a tea-table -that day if I never talked to her again in this world. - -I called Gatsby’s house a few minutes later, but the line was busy. I -tried four times; finally an exasperated central told me the wire was -being kept open for long distance from Detroit. Taking out my -timetable, I drew a small circle around the three-fifty train. Then I -leaned back in my chair and tried to think. It was just noon. - ------------------------------------------------------------------------- - -When I passed the ash-heaps on the train that morning I had crossed -deliberately to the other side of the car. I supposed there’d be a -curious crowd around there all day with little boys searching for dark -spots in the dust, and some garrulous man telling over and over what -had happened, until it became less and less real even to him and he -could tell it no longer, and Myrtle Wilson’s tragic achievement was -forgotten. Now I want to go back a little and tell what happened at -the garage after we left there the night before. - -They had difficulty in locating the sister, Catherine. She must have -broken her rule against drinking that night, for when she arrived she -was stupid with liquor and unable to understand that the ambulance had -already gone to Flushing. When they convinced her of this, she -immediately fainted, as if that was the intolerable part of the -affair. Someone, kind or curious, took her in his car and drove her in -the wake of her sister’s body. - -Until long after midnight a changing crowd lapped up against the front -of the garage, while George Wilson rocked himself back and forth on -the couch inside. For a while the door of the office was open, and -everyone who came into the garage glanced irresistibly through it. -Finally someone said it was a shame, and closed the door. Michaelis -and several other men were with him; first, four or five men, later -two or three men. Still later Michaelis had to ask the last stranger -to wait there fifteen minutes longer, while he went back to his own -place and made a pot of coffee. After that, he stayed there alone with -Wilson until dawn. - -About three o’clock the quality of Wilson’s incoherent muttering -changed—he grew quieter and began to talk about the yellow car. He -announced that he had a way of finding out whom the yellow car -belonged to, and then he blurted out that a couple of months ago his -wife had come from the city with her face bruised and her nose -swollen. - -But when he heard himself say this, he flinched and began to cry “Oh, -my God!” again in his groaning voice. Michaelis made a clumsy attempt -to distract him. - -“How long have you been married, George? Come on there, try and sit -still a minute, and answer my question. How long have you been -married?” - -“Twelve years.” - -“Ever had any children? Come on, George, sit still—I asked you a -question. Did you ever have any children?” - -The hard brown beetles kept thudding against the dull light, and -whenever Michaelis heard a car go tearing along the road outside it -sounded to him like the car that hadn’t stopped a few hours before. -He didn’t like to go into the garage, because the work bench was -stained where the body had been lying, so he moved uncomfortably -around the office—he knew every object in it before morning—and from -time to time sat down beside Wilson trying to keep him more quiet. - -“Have you got a church you go to sometimes, George? Maybe even if you -haven’t been there for a long time? Maybe I could call up the church -and get a priest to come over and he could talk to you, see?” - -“Don’t belong to any.” - -“You ought to have a church, George, for times like this. You must -have gone to church once. Didn’t you get married in a church? Listen, -George, listen to me. Didn’t you get married in a church?” - -“That was a long time ago.” - -The effort of answering broke the rhythm of his rocking—for a moment -he was silent. Then the same half-knowing, half-bewildered look came -back into his faded eyes. - -“Look in the drawer there,” he said, pointing at the desk. - -“Which drawer?” - -“That drawer—that one.” - -Michaelis opened the drawer nearest his hand. There was nothing in it -but a small, expensive dog-leash, made of leather and braided -silver. It was apparently new. - -“This?” he inquired, holding it up. - -Wilson stared and nodded. - -“I found it yesterday afternoon. She tried to tell me about it, but I -knew it was something funny.” - -“You mean your wife bought it?” - -“She had it wrapped in tissue paper on her bureau.” - -Michaelis didn’t see anything odd in that, and he gave Wilson a dozen -reasons why his wife might have bought the dog-leash. But conceivably -Wilson had heard some of these same explanations before, from Myrtle, -because he began saying “Oh, my God!” again in a whisper—his comforter -left several explanations in the air. - -“Then he killed her,” said Wilson. His mouth dropped open suddenly. - -“Who did?” - -“I have a way of finding out.” - -“You’re morbid, George,” said his friend. “This has been a strain to -you and you don’t know what you’re saying. You’d better try and sit -quiet till morning.” - -“He murdered her.” - -“It was an accident, George.” - -Wilson shook his head. His eyes narrowed and his mouth widened -slightly with the ghost of a superior “Hm!” - -“I know,” he said definitely. “I’m one of these trusting fellas and I -don’t think any harm to nobody, but when I get to know a thing I know -it. It was the man in that car. She ran out to speak to him and he -wouldn’t stop.” - -Michaelis had seen this too, but it hadn’t occurred to him that there -was any special significance in it. He believed that Mrs. Wilson had -been running away from her husband, rather than trying to stop any -particular car. - -“How could she of been like that?” - -“She’s a deep one,” said Wilson, as if that answered the question. -“Ah-h-h—” - -He began to rock again, and Michaelis stood twisting the leash in his -hand. - -“Maybe you got some friend that I could telephone for, George?” - -This was a forlorn hope—he was almost sure that Wilson had no friend: -there was not enough of him for his wife. He was glad a little later -when he noticed a change in the room, a blue quickening by the window, -and realized that dawn wasn’t far off. About five o’clock it was blue -enough outside to snap off the light. - -Wilson’s glazed eyes turned out to the ash-heaps, where small grey -clouds took on fantastic shapes and scurried here and there in the -faint dawn wind. - -“I spoke to her,” he muttered, after a long silence. “I told her she -might fool me but she couldn’t fool God. I took her to the -window”—with an effort he got up and walked to the rear window and -leaned with his face pressed against it—“and I said ‘God knows what -you’ve been doing, everything you’ve been doing. You may fool me, but -you can’t fool God!’ ” - -Standing behind him, Michaelis saw with a shock that he was looking at -the eyes of Doctor T. J. Eckleburg, which had just emerged, pale and -enormous, from the dissolving night. - -“God sees everything,” repeated Wilson. - -“That’s an advertisement,” Michaelis assured him. Something made him -turn away from the window and look back into the room. But Wilson -stood there a long time, his face close to the window pane, nodding -into the twilight. - ------------------------------------------------------------------------- - -By six o’clock Michaelis was worn out, and grateful for the sound of a -car stopping outside. It was one of the watchers of the night before -who had promised to come back, so he cooked breakfast for three, which -he and the other man ate together. Wilson was quieter now, and -Michaelis went home to sleep; when he awoke four hours later and -hurried back to the garage, Wilson was gone. - -His movements—he was on foot all the time—were afterward traced to -Port Roosevelt and then to Gad’s Hill, where he bought a sandwich that -he didn’t eat, and a cup of coffee. He must have been tired and -walking slowly, for he didn’t reach Gad’s Hill until noon. Thus far -there was no difficulty in accounting for his time—there were boys who -had seen a man “acting sort of crazy,” and motorists at whom he stared -oddly from the side of the road. Then for three hours he disappeared -from view. The police, on the strength of what he said to Michaelis, -that he “had a way of finding out,” supposed that he spent that time -going from garage to garage thereabout, inquiring for a yellow car. On -the other hand, no garage man who had seen him ever came forward, and -perhaps he had an easier, surer way of finding out what he wanted to -know. By half-past two he was in West Egg, where he asked someone the -way to Gatsby’s house. So by that time he knew Gatsby’s name. - ------------------------------------------------------------------------- - -At two o’clock Gatsby put on his bathing-suit and left word with the -butler that if anyone phoned word was to be brought to him at the -pool. He stopped at the garage for a pneumatic mattress that had -amused his guests during the summer, and the chauffeur helped him to -pump it up. Then he gave instructions that the open car wasn’t to be -taken out under any circumstances—and this was strange, because the -front right fender needed repair. - -Gatsby shouldered the mattress and started for the pool. Once he -stopped and shifted it a little, and the chauffeur asked him if he -needed help, but he shook his head and in a moment disappeared among -the yellowing trees. - -No telephone message arrived, but the butler went without his sleep -and waited for it until four o’clock—until long after there was anyone -to give it to if it came. I have an idea that Gatsby himself didn’t -believe it would come, and perhaps he no longer cared. If that was -true he must have felt that he had lost the old warm world, paid a -high price for living too long with a single dream. He must have -looked up at an unfamiliar sky through frightening leaves and shivered -as he found what a grotesque thing a rose is and how raw the sunlight -was upon the scarcely created grass. A new world, material without -being real, where poor ghosts, breathing dreams like air, drifted -fortuitously about … like that ashen, fantastic figure gliding toward -him through the amorphous trees. - -The chauffeur—he was one of Wolfshiem’s protégés—heard the -shots—afterwards he could only say that he hadn’t thought anything -much about them. I drove from the station directly to Gatsby’s house -and my rushing anxiously up the front steps was the first thing that -alarmed anyone. But they knew then, I firmly believe. With scarcely a -word said, four of us, the chauffeur, butler, gardener, and I hurried -down to the pool. - -There was a faint, barely perceptible movement of the water as the -fresh flow from one end urged its way toward the drain at the other. -With little ripples that were hardly the shadows of waves, the laden -mattress moved irregularly down the pool. A small gust of wind that -scarcely corrugated the surface was enough to disturb its accidental -course with its accidental burden. The touch of a cluster of leaves -revolved it slowly, tracing, like the leg of transit, a thin red -circle in the water. - -It was after we started with Gatsby toward the house that the gardener -saw Wilson’s body a little way off in the grass, and the holocaust was -complete. - - - IX - -After two years I remember the rest of that day, and that night and -the next day, only as an endless drill of police and photographers and -newspaper men in and out of Gatsby’s front door. A rope stretched -across the main gate and a policeman by it kept out the curious, but -little boys soon discovered that they could enter through my yard, and -there were always a few of them clustered open-mouthed about the -pool. Someone with a positive manner, perhaps a detective, used the -expression “madman” as he bent over Wilson’s body that afternoon, and -the adventitious authority of his voice set the key for the newspaper -reports next morning. - -Most of those reports were a nightmare—grotesque, circumstantial, -eager, and untrue. When Michaelis’s testimony at the inquest brought -to light Wilson’s suspicions of his wife I thought the whole tale -would shortly be served up in racy pasquinade—but Catherine, who might -have said anything, didn’t say a word. She showed a surprising amount -of character about it too—looked at the coroner with determined eyes -under that corrected brow of hers, and swore that her sister had never -seen Gatsby, that her sister was completely happy with her husband, -that her sister had been into no mischief whatever. She convinced -herself of it, and cried into her handkerchief, as if the very -suggestion was more than she could endure. So Wilson was reduced to a -man “deranged by grief” in order that the case might remain in its -simplest form. And it rested there. - -But all this part of it seemed remote and unessential. I found myself -on Gatsby’s side, and alone. From the moment I telephoned news of the -catastrophe to West Egg village, every surmise about him, and every -practical question, was referred to me. At first I was surprised and -confused; then, as he lay in his house and didn’t move or breathe or -speak, hour upon hour, it grew upon me that I was responsible, because -no one else was interested—interested, I mean, with that intense -personal interest to which everyone has some vague right at the end. - -I called up Daisy half an hour after we found him, called her -instinctively and without hesitation. But she and Tom had gone away -early that afternoon, and taken baggage with them. - -“Left no address?” - -“No.” - -“Say when they’d be back?” - -“No.” - -“Any idea where they are? How I could reach them?” - -“I don’t know. Can’t say.” - -I wanted to get somebody for him. I wanted to go into the room where -he lay and reassure him: “I’ll get somebody for you, Gatsby. Don’t -worry. Just trust me and I’ll get somebody for you—” - -Meyer Wolfshiem’s name wasn’t in the phone book. The butler gave me -his office address on Broadway, and I called Information, but by the -time I had the number it was long after five, and no one answered the -phone. - -“Will you ring again?” - -“I’ve rung three times.” - -“It’s very important.” - -“Sorry. I’m afraid no one’s there.” - -I went back to the drawing-room and thought for an instant that they -were chance visitors, all these official people who suddenly filled -it. But, though they drew back the sheet and looked at Gatsby with -shocked eyes, his protest continued in my brain: - -“Look here, old sport, you’ve got to get somebody for me. You’ve got -to try hard. I can’t go through this alone.” - -Someone started to ask me questions, but I broke away and going -upstairs looked hastily through the unlocked parts of his desk—he’d -never told me definitely that his parents were dead. But there was -nothing—only the picture of Dan Cody, a token of forgotten violence, -staring down from the wall. - -Next morning I sent the butler to New York with a letter to Wolfshiem, -which asked for information and urged him to come out on the next -train. That request seemed superfluous when I wrote it. I was sure -he’d start when he saw the newspapers, just as I was sure there’d be a -wire from Daisy before noon—but neither a wire nor Mr. Wolfshiem -arrived; no one arrived except more police and photographers and -newspaper men. When the butler brought back Wolfshiem’s answer I began -to have a feeling of defiance, of scornful solidarity between Gatsby -and me against them all. - - Dear Mr. Carraway. This has been one of the most terrible shocks of - my life to me I hardly can believe it that it is true at all. Such a - mad act as that man did should make us all think. I cannot come down - now as I am tied up in some very important business and cannot get - mixed up in this thing now. If there is anything I can do a little - later let me know in a letter by Edgar. I hardly know where I am when - I hear about a thing like this and am completely knocked down and - out. - - Yours truly - - Meyer Wolfshiem - -and then hasty addenda beneath: - - Let me know about the funeral etc do not know his family at all. - -When the phone rang that afternoon and Long Distance said Chicago was -calling I thought this would be Daisy at last. But the connection came -through as a man’s voice, very thin and far away. - -“This is Slagle speaking …” - -“Yes?” The name was unfamiliar. - -“Hell of a note, isn’t it? Get my wire?” - -“There haven’t been any wires.” - -“Young Parke’s in trouble,” he said rapidly. “They picked him up when -he handed the bonds over the counter. They got a circular from New -York giving ’em the numbers just five minutes before. What d’you know -about that, hey? You never can tell in these hick towns—” - -“Hello!” I interrupted breathlessly. “Look here—this isn’t Mr. -Gatsby. Mr. Gatsby’s dead.” - -There was a long silence on the other end of the wire, followed by an -exclamation … then a quick squawk as the connection was broken. - ------------------------------------------------------------------------- - -I think it was on the third day that a telegram signed Henry C. Gatz -arrived from a town in Minnesota. It said only that the sender was -leaving immediately and to postpone the funeral until he came. - -It was Gatsby’s father, a solemn old man, very helpless and dismayed, -bundled up in a long cheap ulster against the warm September day. His -eyes leaked continuously with excitement, and when I took the bag and -umbrella from his hands he began to pull so incessantly at his sparse -grey beard that I had difficulty in getting off his coat. He was on -the point of collapse, so I took him into the music-room and made him -sit down while I sent for something to eat. But he wouldn’t eat, and -the glass of milk spilled from his trembling hand. - -“I saw it in the Chicago newspaper,” he said. “It was all in the -Chicago newspaper. I started right away.” - -“I didn’t know how to reach you.” - -His eyes, seeing nothing, moved ceaselessly about the room. - -“It was a madman,” he said. “He must have been mad.” - -“Wouldn’t you like some coffee?” I urged him. - -“I don’t want anything. I’m all right now, Mr.—” - -“Carraway.” - -“Well, I’m all right now. Where have they got Jimmy?” - -I took him into the drawing-room, where his son lay, and left him -there. Some little boys had come up on the steps and were looking into -the hall; when I told them who had arrived, they went reluctantly -away. - -After a little while Mr. Gatz opened the door and came out, his mouth -ajar, his face flushed slightly, his eyes leaking isolated and -unpunctual tears. He had reached an age where death no longer has the -quality of ghastly surprise, and when he looked around him now for the -first time and saw the height and splendour of the hall and the great -rooms opening out from it into other rooms, his grief began to be -mixed with an awed pride. I helped him to a bedroom upstairs; while he -took off his coat and vest I told him that all arrangements had been -deferred until he came. - -“I didn’t know what you’d want, Mr. Gatsby—” - -“Gatz is my name.” - -“—Mr. Gatz. I thought you might want to take the body West.” - -He shook his head. - -“Jimmy always liked it better down East. He rose up to his position in -the East. Were you a friend of my boy’s, Mr.—?” - -“We were close friends.” - -“He had a big future before him, you know. He was only a young man, -but he had a lot of brain power here.” - -He touched his head impressively, and I nodded. - -“If he’d of lived, he’d of been a great man. A man like James J. -Hill. He’d of helped build up the country.” - -“That’s true,” I said, uncomfortably. - -He fumbled at the embroidered coverlet, trying to take it from the -bed, and lay down stiffly—was instantly asleep. - -That night an obviously frightened person called up, and demanded to -know who I was before he would give his name. - -“This is Mr. Carraway,” I said. - -“Oh!” He sounded relieved. “This is Klipspringer.” - -I was relieved too, for that seemed to promise another friend at -Gatsby’s grave. I didn’t want it to be in the papers and draw a -sightseeing crowd, so I’d been calling up a few people myself. They -were hard to find. - -“The funeral’s tomorrow,” I said. “Three o’clock, here at the house. -I wish you’d tell anybody who’d be interested.” - -“Oh, I will,” he broke out hastily. “Of course I’m not likely to see -anybody, but if I do.” - -His tone made me suspicious. - -“Of course you’ll be there yourself.” - -“Well, I’ll certainly try. What I called up about is—” - -“Wait a minute,” I interrupted. “How about saying you’ll come?” - -“Well, the fact is—the truth of the matter is that I’m staying with -some people up here in Greenwich, and they rather expect me to be with -them tomorrow. In fact, there’s a sort of picnic or something. Of -course I’ll do my best to get away.” - -I ejaculated an unrestrained “Huh!” and he must have heard me, for he -went on nervously: - -“What I called up about was a pair of shoes I left there. I wonder if -it’d be too much trouble to have the butler send them on. You see, -they’re tennis shoes, and I’m sort of helpless without them. My -address is care of B. F.—” - -I didn’t hear the rest of the name, because I hung up the receiver. - -After that I felt a certain shame for Gatsby—one gentleman to whom I -telephoned implied that he had got what he deserved. However, that was -my fault, for he was one of those who used to sneer most bitterly at -Gatsby on the courage of Gatsby’s liquor, and I should have known -better than to call him. - -The morning of the funeral I went up to New York to see Meyer -Wolfshiem; I couldn’t seem to reach him any other way. The door that I -pushed open, on the advice of an elevator boy, was marked “The -Swastika Holding Company,” and at first there didn’t seem to be anyone -inside. But when I’d shouted “hello” several times in vain, an -argument broke out behind a partition, and presently a lovely Jewess -appeared at an interior door and scrutinized me with black hostile -eyes. - -“Nobody’s in,” she said. “Mr. Wolfshiem’s gone to Chicago.” - -The first part of this was obviously untrue, for someone had begun to -whistle “The Rosary,” tunelessly, inside. - -“Please say that Mr. Carraway wants to see him.” - -“I can’t get him back from Chicago, can I?” - -At this moment a voice, unmistakably Wolfshiem’s, called “Stella!” -from the other side of the door. - -“Leave your name on the desk,” she said quickly. “I’ll give it to him -when he gets back.” - -“But I know he’s there.” - -She took a step toward me and began to slide her hands indignantly up -and down her hips. - -“You young men think you can force your way in here any time,” she -scolded. “We’re getting sickantired of it. When I say he’s in Chicago, -he’s in Chicago.” - -I mentioned Gatsby. - -“Oh-h!” She looked at me over again. “Will you just—What was your -name?” - -She vanished. In a moment Meyer Wolfshiem stood solemnly in the -doorway, holding out both hands. He drew me into his office, remarking -in a reverent voice that it was a sad time for all of us, and offered -me a cigar. - -“My memory goes back to when first I met him,” he said. “A young major -just out of the army and covered over with medals he got in the war. -He was so hard up he had to keep on wearing his uniform because he -couldn’t buy some regular clothes. First time I saw him was when he -came into Winebrenner’s poolroom at Forty-third Street and asked for a -job. He hadn’t eat anything for a couple of days. ‘Come on have some -lunch with me,’ I said. He ate more than four dollars’ worth of food -in half an hour.” - -“Did you start him in business?” I inquired. - -“Start him! I made him.” - -“Oh.” - -“I raised him up out of nothing, right out of the gutter. I saw right -away he was a fine-appearing, gentlemanly young man, and when he told -me he was at Oggsford I knew I could use him good. I got him to join -the American Legion and he used to stand high there. Right off he did -some work for a client of mine up to Albany. We were so thick like -that in everything”—he held up two bulbous fingers—“always together.” - -I wondered if this partnership had included the World’s Series -transaction in 1919. - -“Now he’s dead,” I said after a moment. “You were his closest friend, -so I know you’ll want to come to his funeral this afternoon.” - -“I’d like to come.” - -“Well, come then.” - -The hair in his nostrils quivered slightly, and as he shook his head -his eyes filled with tears. - -“I can’t do it—I can’t get mixed up in it,” he said. - -“There’s nothing to get mixed up in. It’s all over now.” - -“When a man gets killed I never like to get mixed up in it in any -way. I keep out. When I was a young man it was different—if a friend -of mine died, no matter how, I stuck with them to the end. You may -think that’s sentimental, but I mean it—to the bitter end.” - -I saw that for some reason of his own he was determined not to come, -so I stood up. - -“Are you a college man?” he inquired suddenly. - -For a moment I thought he was going to suggest a “gonnegtion,” but he -only nodded and shook my hand. - -“Let us learn to show our friendship for a man when he is alive and -not after he is dead,” he suggested. “After that my own rule is to let -everything alone.” - -When I left his office the sky had turned dark and I got back to West -Egg in a drizzle. After changing my clothes I went next door and found -Mr. Gatz walking up and down excitedly in the hall. His pride in his -son and in his son’s possessions was continually increasing and now he -had something to show me. - -“Jimmy sent me this picture.” He took out his wallet with trembling -fingers. “Look there.” - -It was a photograph of the house, cracked in the corners and dirty -with many hands. He pointed out every detail to me eagerly. “Look -there!” and then sought admiration from my eyes. He had shown it so -often that I think it was more real to him now than the house itself. - -“Jimmy sent it to me. I think it’s a very pretty picture. It shows up -well.” - -“Very well. Had you seen him lately?” - -“He come out to see me two years ago and bought me the house I live in -now. Of course we was broke up when he run off from home, but I see -now there was a reason for it. He knew he had a big future in front of -him. And ever since he made a success he was very generous with me.” - -He seemed reluctant to put away the picture, held it for another -minute, lingeringly, before my eyes. Then he returned the wallet and -pulled from his pocket a ragged old copy of a book called Hopalong -Cassidy. - -“Look here, this is a book he had when he was a boy. It just shows -you.” - -He opened it at the back cover and turned it around for me to see. On -the last flyleaf was printed the word schedule, and the date September -12, 1906. And underneath: - - Rise from bed 6:00 a.m. - Dumbell exercise and wall-scaling 6:15-6:30 ” - Study electricity, etc. 7:15-8:15 ” - Work 8:30-4:30 p.m. - Baseball and sports 4:30-5:00 ” - Practise elocution, poise and how to attain it 5:00-6:00 ” - Study needed inventions 7:00-9:00 ” - - General Resolves - - * No wasting time at Shafters or [a name, indecipherable] - - * No more smokeing or chewing. - - * Bath every other day - - * Read one improving book or magazine per week - - * Save $5.00 [crossed out] $3.00 per week - - * Be better to parents - -“I came across this book by accident,” said the old man. “It just -shows you, don’t it?” - -“It just shows you.” - -“Jimmy was bound to get ahead. He always had some resolves like this -or something. Do you notice what he’s got about improving his mind? He -was always great for that. He told me I et like a hog once, and I beat -him for it.” - -He was reluctant to close the book, reading each item aloud and then -looking eagerly at me. I think he rather expected me to copy down the -list for my own use. - -A little before three the Lutheran minister arrived from Flushing, and -I began to look involuntarily out the windows for other cars. So did -Gatsby’s father. And as the time passed and the servants came in and -stood waiting in the hall, his eyes began to blink anxiously, and he -spoke of the rain in a worried, uncertain way. The minister glanced -several times at his watch, so I took him aside and asked him to wait -for half an hour. But it wasn’t any use. Nobody came. - ------------------------------------------------------------------------- - -About five o’clock our procession of three cars reached the cemetery -and stopped in a thick drizzle beside the gate—first a motor hearse, -horribly black and wet, then Mr. Gatz and the minister and me in the -limousine, and a little later four or five servants and the postman -from West Egg, in Gatsby’s station wagon, all wet to the skin. As we -started through the gate into the cemetery I heard a car stop and then -the sound of someone splashing after us over the soggy ground. I -looked around. It was the man with owl-eyed glasses whom I had found -marvelling over Gatsby’s books in the library one night three months -before. - -I’d never seen him since then. I don’t know how he knew about the -funeral, or even his name. The rain poured down his thick glasses, and -he took them off and wiped them to see the protecting canvas unrolled -from Gatsby’s grave. - -I tried to think about Gatsby then for a moment, but he was already -too far away, and I could only remember, without resentment, that -Daisy hadn’t sent a message or a flower. Dimly I heard someone murmur -“Blessed are the dead that the rain falls on,” and then the owl-eyed -man said “Amen to that,” in a brave voice. - -We straggled down quickly through the rain to the cars. Owl-eyes spoke -to me by the gate. - -“I couldn’t get to the house,” he remarked. - -“Neither could anybody else.” - -“Go on!” He started. “Why, my God! they used to go there by the -hundreds.” - -He took off his glasses and wiped them again, outside and in. - -“The poor son-of-a-bitch,” he said. - ------------------------------------------------------------------------- - -One of my most vivid memories is of coming back West from prep school -and later from college at Christmas time. Those who went farther than -Chicago would gather in the old dim Union Station at six o’clock of a -December evening, with a few Chicago friends, already caught up into -their own holiday gaieties, to bid them a hasty goodbye. I remember -the fur coats of the girls returning from Miss This-or-That’s and the -chatter of frozen breath and the hands waving overhead as we caught -sight of old acquaintances, and the matchings of invitations: “Are you -going to the Ordways’? the Herseys’? the Schultzes’?” and the long -green tickets clasped tight in our gloved hands. And last the murky -yellow cars of the Chicago, Milwaukee and St. Paul railroad looking -cheerful as Christmas itself on the tracks beside the gate. - -When we pulled out into the winter night and the real snow, our snow, -began to stretch out beside us and twinkle against the windows, and -the dim lights of small Wisconsin stations moved by, a sharp wild -brace came suddenly into the air. We drew in deep breaths of it as we -walked back from dinner through the cold vestibules, unutterably aware -of our identity with this country for one strange hour, before we -melted indistinguishably into it again. - -That’s my Middle West—not the wheat or the prairies or the lost Swede -towns, but the thrilling returning trains of my youth, and the street -lamps and sleigh bells in the frosty dark and the shadows of holly -wreaths thrown by lighted windows on the snow. I am part of that, a -little solemn with the feel of those long winters, a little complacent -from growing up in the Carraway house in a city where dwellings are -still called through decades by a family’s name. I see now that this -has been a story of the West, after all—Tom and Gatsby, Daisy and -Jordan and I, were all Westerners, and perhaps we possessed some -deficiency in common which made us subtly unadaptable to Eastern life. - -Even when the East excited me most, even when I was most keenly aware -of its superiority to the bored, sprawling, swollen towns beyond the -Ohio, with their interminable inquisitions which spared only the -children and the very old—even then it had always for me a quality of -distortion. West Egg, especially, still figures in my more fantastic -dreams. I see it as a night scene by El Greco: a hundred houses, at -once conventional and grotesque, crouching under a sullen, overhanging -sky and a lustreless moon. In the foreground four solemn men in dress -suits are walking along the sidewalk with a stretcher on which lies a -drunken woman in a white evening dress. Her hand, which dangles over -the side, sparkles cold with jewels. Gravely the men turn in at a -house—the wrong house. But no one knows the woman’s name, and no one -cares. - -After Gatsby’s death the East was haunted for me like that, distorted -beyond my eyes’ power of correction. So when the blue smoke of brittle -leaves was in the air and the wind blew the wet laundry stiff on the -line I decided to come back home. - -There was one thing to be done before I left, an awkward, unpleasant -thing that perhaps had better have been let alone. But I wanted to -leave things in order and not just trust that obliging and indifferent -sea to sweep my refuse away. I saw Jordan Baker and talked over and -around what had happened to us together, and what had happened -afterward to me, and she lay perfectly still, listening, in a big -chair. - -She was dressed to play golf, and I remember thinking she looked like -a good illustration, her chin raised a little jauntily, her hair the -colour of an autumn leaf, her face the same brown tint as the -fingerless glove on her knee. When I had finished she told me without -comment that she was engaged to another man. I doubted that, though -there were several she could have married at a nod of her head, but I -pretended to be surprised. For just a minute I wondered if I wasn’t -making a mistake, then I thought it all over again quickly and got up -to say goodbye. - -“Nevertheless you did throw me over,” said Jordan suddenly. “You threw -me over on the telephone. I don’t give a damn about you now, but it -was a new experience for me, and I felt a little dizzy for a while.” - -We shook hands. - -“Oh, and do you remember”—she added—“a conversation we had once about -driving a car?” - -“Why—not exactly.” - -“You said a bad driver was only safe until she met another bad driver? -Well, I met another bad driver, didn’t I? I mean it was careless of me -to make such a wrong guess. I thought you were rather an honest, -straightforward person. I thought it was your secret pride.” - -“I’m thirty,” I said. “I’m five years too old to lie to myself and -call it honour.” - -She didn’t answer. Angry, and half in love with her, and tremendously -sorry, I turned away. - ------------------------------------------------------------------------- - -One afternoon late in October I saw Tom Buchanan. He was walking ahead -of me along Fifth Avenue in his alert, aggressive way, his hands out a -little from his body as if to fight off interference, his head moving -sharply here and there, adapting itself to his restless eyes. Just as -I slowed up to avoid overtaking him he stopped and began frowning into -the windows of a jewellery store. Suddenly he saw me and walked back, -holding out his hand. - -“What’s the matter, Nick? Do you object to shaking hands with me?” - -“Yes. You know what I think of you.” - -“You’re crazy, Nick,” he said quickly. “Crazy as hell. I don’t know -what’s the matter with you.” - -“Tom,” I inquired, “what did you say to Wilson that afternoon?” - -He stared at me without a word, and I knew I had guessed right about -those missing hours. I started to turn away, but he took a step after -me and grabbed my arm. - -“I told him the truth,” he said. “He came to the door while we were -getting ready to leave, and when I sent down word that we weren’t in -he tried to force his way upstairs. He was crazy enough to kill me if -I hadn’t told him who owned the car. His hand was on a revolver in his -pocket every minute he was in the house—” He broke off defiantly. -“What if I did tell him? That fellow had it coming to him. He threw -dust into your eyes just like he did in Daisy’s, but he was a tough -one. He ran over Myrtle like you’d run over a dog and never even -stopped his car.” - -There was nothing I could say, except the one unutterable fact that it -wasn’t true. - -“And if you think I didn’t have my share of suffering—look here, when -I went to give up that flat and saw that damn box of dog biscuits -sitting there on the sideboard, I sat down and cried like a baby. By -God it was awful—” - -I couldn’t forgive him or like him, but I saw that what he had done -was, to him, entirely justified. It was all very careless and -confused. They were careless people, Tom and Daisy—they smashed up -things and creatures and then retreated back into their money or their -vast carelessness, or whatever it was that kept them together, and let -other people clean up the mess they had made … - -I shook hands with him; it seemed silly not to, for I felt suddenly as -though I were talking to a child. Then he went into the jewellery -store to buy a pearl necklace—or perhaps only a pair of cuff -buttons—rid of my provincial squeamishness forever. - ------------------------------------------------------------------------- - -Gatsby’s house was still empty when I left—the grass on his lawn had -grown as long as mine. One of the taxi drivers in the village never -took a fare past the entrance gate without stopping for a minute and -pointing inside; perhaps it was he who drove Daisy and Gatsby over to -East Egg the night of the accident, and perhaps he had made a story -about it all his own. I didn’t want to hear it and I avoided him when -I got off the train. - -I spent my Saturday nights in New York because those gleaming, -dazzling parties of his were with me so vividly that I could still -hear the music and the laughter, faint and incessant, from his garden, -and the cars going up and down his drive. One night I did hear a -material car there, and saw its lights stop at his front steps. But I -didn’t investigate. Probably it was some final guest who had been away -at the ends of the earth and didn’t know that the party was over. - -On the last night, with my trunk packed and my car sold to the grocer, -I went over and looked at that huge incoherent failure of a house once -more. On the white steps an obscene word, scrawled by some boy with a -piece of brick, stood out clearly in the moonlight, and I erased it, -drawing my shoe raspingly along the stone. Then I wandered down to the -beach and sprawled out on the sand. - -Most of the big shore places were closed now and there were hardly any -lights except the shadowy, moving glow of a ferryboat across the -Sound. And as the moon rose higher the inessential houses began to -melt away until gradually I became aware of the old island here that -flowered once for Dutch sailors’ eyes—a fresh, green breast of the new -world. Its vanished trees, the trees that had made way for Gatsby’s -house, had once pandered in whispers to the last and greatest of all -human dreams; for a transitory enchanted moment man must have held his -breath in the presence of this continent, compelled into an aesthetic -contemplation he neither understood nor desired, face to face for the -last time in history with something commensurate to his capacity for -wonder. - -And as I sat there brooding on the old, unknown world, I thought of -Gatsby’s wonder when he first picked out the green light at the end of -Daisy’s dock. He had come a long way to this blue lawn, and his dream -must have seemed so close that he could hardly fail to grasp it. He -did not know that it was already behind him, somewhere back in that -vast obscurity beyond the city, where the dark fields of the republic -rolled on under the night. - -Gatsby believed in the green light, the orgastic future that year by -year recedes before us. It eluded us then, but that’s no -matter—tomorrow we will run faster, stretch out our arms further … And -one fine morning— - -So we beat on, boats against the current, borne back ceaselessly into -the past. \ No newline at end of file diff --git a/gradio_example.py~ b/gradio_example.py~ deleted file mode 100644 index a2b19505f559f8edc575a50c05c41b421b80a74e..0000000000000000000000000000000000000000 --- a/gradio_example.py~ +++ /dev/null @@ -1,41 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import show, prompt, OpenAI -from gradio_tools.tools import StableDiffusionTool, ImageCaptioningTool - - -@prompt(StableDiffusionTool()) -def gen(model, query): - return model(query) - -@prompt(ImageCaptioningTool()) -def caption(model, img_src): - return model(img_src) - - -def gradio_example(query): - return caption(gen(query)) - - -# $ - -gradio = show(gradio_example, - subprompts=[caption], - examples=['/home/srush/Projects/MiniChain/examples/63dd90c7-9b8d-4ba4-bc07-a378fd932304/tmph3xi9ylr.jpg', 'Make me a flower'], - out_type="markdown", - description=desc - ) -if __name__ == "__main__": - gradio.launch() - diff --git a/gradio_tool.py~ b/gradio_tool.py~ deleted file mode 100644 index dd05f30c3d90d8908938bd839ed4b5ec4c225161..0000000000000000000000000000000000000000 --- a/gradio_tool.py~ +++ /dev/null @@ -1,43 +0,0 @@ -# + tags=["hide_inp"] - -desc = """ -### Gradio Tool - -Chain that ask for a command-line question and then runs the bash command. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/srush/MiniChain/blob/master/examples/bash.ipynb) - -(Adapted from LangChain [BashChain](https://langchain.readthedocs.io/en/latest/modules/chains/examples/llm_bash.html)) -""" -# - - -# $ - -from minichain import show, prompt, OpenAI - - -@prompt(OpenAI(), template_file = "bash.pmpt.tpl") -def output_prompt(model, query): - x = model(dict(question=query)) - return "\n".join(x.strip().split("\n")[1:-1]) - -@prompt(Bash()) -def bash_run(model, x): - return model(x) - -def gradio_tool(query): - return bash_run(cli_prompt(query)) - - -# $ - -gradio = show(bash, - subprompts=[cli_prompt, bash_run], - examples=['Go up one directory, and then into the minichain directory,' - 'and list the files in the directory', - "Please write a bash script that prints 'Hello World' to the console."], - out_type="markdown", - description=desc, - code=open("bash.py", "r").read().split("$")[1].strip().strip("#").strip(), - ) -if __name__ == "__main__": - gradio.launch() - diff --git a/math.log b/math.log index f7d766270b45e15aca98e6f6d27bd9e5a1c21fca..545b40b846bab9ad0108ccf05042d689671445c7 100644 --- a/math.log +++ b/math.log @@ -1,18 +1,18 @@ -{"action_status": "started", "timestamp": 1678804794.3484201, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3485305, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3736765, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3737779, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.407293, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.4074926, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} +{"action_status": "started", "timestamp": 1697595252.1601458, "task_uuid": "ef3daffd-cf83-4132-861b-41ce3791e184", "action_type": "math", "task_level": [1]} +{"action_status": "succeeded", "timestamp": 1697595252.1602335, "task_uuid": "ef3daffd-cf83-4132-861b-41ce3791e184", "action_type": "math", "task_level": [2]} +{"action_status": "started", "timestamp": 1697595259.0245333, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "", "task_level": [1]} +{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1697595259.0247514, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1697595259.0268338, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1697595259.0269594, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1697595260.3491192, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Prompted", "task_level": [3, 2]} +{"result": "\n\n```python\ntotal = 0\nfor i in range(0, 100):\n if 3**i < 100:\n total += 3**i\nprint(total)\n```", "action_status": "started", "timestamp": 1697595260.349293, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1697595260.3493657, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1697595260.3494098, "task_uuid": "0104916c-7cfc-4ffe-951e-6b0a05f464ba", "action_type": "", "task_level": [5]} +{"action_status": "started", "timestamp": 1697595260.3495145, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "", "task_level": [1]} +{"input": "\n\n```python\ntotal = 0\nfor i in range(0, 100):\n if 3**i < 100:\n total += 3**i\nprint(total)\n```", "action_status": "started", "timestamp": 1697595260.3495657, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Input Function", "task_level": [2, 1]} +{"action_status": "succeeded", "timestamp": 1697595260.3496165, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Input Function", "task_level": [2, 2]} +{"prompt": "\n\n```python\ntotal = 0\nfor i in range(0, 100):\n if 3**i < 100:\n total += 3**i\nprint(total)\n```", "action_status": "started", "timestamp": 1697595260.3496573, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Prompted", "task_level": [3, 1]} +{"action_status": "succeeded", "timestamp": 1697595260.3500574, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Prompted", "task_level": [3, 2]} +{"result": "121\n", "action_status": "started", "timestamp": 1697595260.350118, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Result", "task_level": [4, 1]} +{"action_status": "succeeded", "timestamp": 1697595260.3501778, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "Result", "task_level": [4, 2]} +{"action_status": "succeeded", "timestamp": 1697595260.3502147, "task_uuid": "4816b4b1-62aa-4921-90aa-39f6e27d698d", "action_type": "", "task_level": [5]} diff --git a/math.pmpt.tpl~ b/math.pmpt.tpl~ deleted file mode 100644 index ac855a08e3919b037841a06a6c43a080c86c10b4..0000000000000000000000000000000000000000 --- a/math.pmpt.tpl~ +++ /dev/null @@ -1,26 +0,0 @@ -question: -What is 37593 * 67? -code: -37593 * 67 -1: -{ question, code } -question: -Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market? -code: -(16-3-4)*2 -2: -{ question, code } -question: -How many of the integers between 0 and 99 inclusive are divisible by 8? -code: -let count = 0; -for (let i = 0; i <= 99; i++) { - if (i % 8 === 0) { count+=1 } -}; -count -3: -{ question, code } -question: -A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take? -code: -2 + 2/2 \ No newline at end of file diff --git a/math_demo.md b/math_demo.md deleted file mode 100644 index e6da88c9b92c9bf58e67f6f9c17eebc002fb1fea..0000000000000000000000000000000000000000 --- a/math_demo.md +++ /dev/null @@ -1,46 +0,0 @@ -```python tags=["hide_inp"] -desc = """ -### Word Problem Solver - -Chain that solves a math word problem by first generating and then running Python code. [[Code](https://github.com/srush/MiniChain/blob/main/examples/math.py)] - -(Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169)) -""" -``` - -```python -import minichain -``` - -Prompt that asks LLM for code from math. - -```python -class MathPrompt(minichain.TemplatePrompt): - template_file = "math.pmpt.tpl" -``` - -Ask a question and run it as python code. - -```python -with minichain.start_chain("math") as backend: - math_prompt = MathPrompt(backend.OpenAI()) - code_prompt = minichain.SimplePrompt(backend.Python()) - prompt = math_prompt.chain(code_prompt) -``` - - -```python tags=["hide_inp"] -gradio = prompt.to_gradio(fields =["question"], - examples=["What is the sum of the powers of 3 (3^i) that are smaller than 100?", - "What is the sum of the 10 first positive integers?", - "Carla is downloading a 200 GB file. She can download 2 GB/minute, but 40% of the way through the download, the download fails. Then Carla has to restart the download from the beginning. How load did it take her to download the file in minutes?"], - out_type="markdown", - description=desc, - code=open("math_demo.md", "r").read() - -) -if __name__ == "__main__": - gradio.launch() -#- - -``` diff --git a/math_demo.py~ b/math_demo.py~ deleted file mode 100644 index 95cd877f22cfd947323e7832df05542dcdcf3753..0000000000000000000000000000000000000000 --- a/math_demo.py~ +++ /dev/null @@ -1,43 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Word Problem Solver - -Chain that solves a math word problem by first generating and then running Python code. [[Code](https://github.com/srush/MiniChain/blob/main/examples/math.py)] - -(Adapted from Dust [maths-generate-code](https://dust.tt/spolu/a/d12ac33169)) -""" -# - - -# $ - -import minichain - -# Prompt that asks LLM for code from math. - -class MathPrompt(minichain.TemplatePrompt): - template_file = "math.pmpt.tpl" - -# Ask a question and run it as python code. - -with minichain.start_chain("math") as backend: - math_prompt = MathPrompt(backend.OpenAI()) - code_prompt = minichain.SimplePrompt(backend.Python()) - prompt = math_prompt.chain(code_prompt) - -# $ - -# + tags=["hide_inp"] -gradio = prompt.to_gradio(fields =["question"], - examples=["What is the sum of the powers of 3 (3^i) that are smaller than 100?", - "What is the sum of the 10 first positive integers?", - "Carla is downloading a 200 GB file. She can download 2 GB/minute, but 40% of the way through the download, the download fails. Then Carla has to restart the download from the beginning. How load did it take her to download the file in minutes?"], - out_type="markdown", - description=desc, - code=open("math_demo.py", "r").read().split("$")[1].strip().strip("#").strip(), - templates=[open("math.pmpt.tpl")] - -) -if __name__ == "__main__": - gradio.launch() -# - - diff --git a/math_prompts.ipynb b/math_prompts.ipynb deleted file mode 100644 index f97d1dadf7ff995b2108355d4c165727bc0ca3c4..0000000000000000000000000000000000000000 --- a/math_prompts.ipynb +++ /dev/null @@ -1,205 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "0d50aaa6", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "markdown", - "id": "2a70ac7d", - "metadata": { - "lines_to_next_cell": 2 - }, - "source": [ - "Copyright 2022 PAL Authors. All rights reserved.\n", - "\n", - "Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "you may not use this file except in compliance with the License.\n", - "You may obtain a copy of the License at\n", - "\n", - " http://www.apache.org/licenses/LICENSE-2.0\n", - "\n", - "Unless required by applicable law or agreed to in writing, software\n", - "distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "See the License for the specific language governing permissions and\n", - "limitations under the License." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "9ff0f695", - "metadata": {}, - "outputs": [], - "source": [ - "MATH_PROMPT = '''\n", - "Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"Olivia has $23. She bought five bagels for $3 each. How much money does she have left?\"\"\"\n", - " money_initial = 23\n", - " bagels = 5\n", - " bagel_cost = 3\n", - " money_spent = bagels * bagel_cost\n", - " money_left = money_initial - money_spent\n", - " result = money_left\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday?\"\"\"\n", - " golf_balls_initial = 58\n", - " golf_balls_lost_tuesday = 23\n", - " golf_balls_lost_wednesday = 2\n", - " golf_balls_left = golf_balls_initial - golf_balls_lost_tuesday - golf_balls_lost_wednesday\n", - " result = golf_balls_left\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room?\"\"\"\n", - " computers_initial = 9\n", - " computers_per_day = 5\n", - " num_days = 4 # 4 days between monday and thursday\n", - " computers_added = computers_per_day * num_days\n", - " computers_total = computers_initial + computers_added\n", - " result = computers_total\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now?\"\"\"\n", - " toys_initial = 5\n", - " mom_toys = 2\n", - " dad_toys = 2\n", - " total_received = mom_toys + dad_toys\n", - " total_toys = toys_initial + total_received\n", - " result = total_toys\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny?\"\"\"\n", - " jason_lollipops_initial = 20\n", - " jason_lollipops_after = 12\n", - " denny_lollipops = jason_lollipops_initial - jason_lollipops_after\n", - " result = denny_lollipops\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total?\"\"\"\n", - " leah_chocolates = 32\n", - " sister_chocolates = 42\n", - " total_chocolates = leah_chocolates + sister_chocolates\n", - " chocolates_eaten = 35\n", - " chocolates_left = total_chocolates - chocolates_eaten\n", - " result = chocolates_left\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?\"\"\"\n", - " cars_initial = 3\n", - " cars_arrived = 2\n", - " total_cars = cars_initial + cars_arrived\n", - " result = total_cars\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today?\n", - "\n", - "# solution in Python:\n", - "\n", - "\n", - "def solution():\n", - " \"\"\"There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today?\"\"\"\n", - " trees_initial = 15\n", - " trees_after = 21\n", - " trees_added = trees_after - trees_initial\n", - " result = trees_added\n", - " return result\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "Q: {question}\n", - "\n", - "# solution in Python:\n", - "'''.strip() + '\\n\\n\\n'" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/math_prompts.py b/math_prompts.py deleted file mode 100644 index 51351dee02797f0c2badf7aa167bb75e000e4f4b..0000000000000000000000000000000000000000 --- a/math_prompts.py +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright 2022 PAL Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -MATH_PROMPT = ''' -Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left? - -# solution in Python: - - -def solution(): - """Olivia has $23. She bought five bagels for $3 each. How much money does she have left?""" - money_initial = 23 - bagels = 5 - bagel_cost = 3 - money_spent = bagels * bagel_cost - money_left = money_initial - money_spent - result = money_left - return result - - - - - -Q: Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday? - -# solution in Python: - - -def solution(): - """Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday?""" - golf_balls_initial = 58 - golf_balls_lost_tuesday = 23 - golf_balls_lost_wednesday = 2 - golf_balls_left = golf_balls_initial - golf_balls_lost_tuesday - golf_balls_lost_wednesday - result = golf_balls_left - return result - - - - - -Q: There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room? - -# solution in Python: - - -def solution(): - """There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room?""" - computers_initial = 9 - computers_per_day = 5 - num_days = 4 # 4 days between monday and thursday - computers_added = computers_per_day * num_days - computers_total = computers_initial + computers_added - result = computers_total - return result - - - - - -Q: Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now? - -# solution in Python: - - -def solution(): - """Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now?""" - toys_initial = 5 - mom_toys = 2 - dad_toys = 2 - total_received = mom_toys + dad_toys - total_toys = toys_initial + total_received - result = total_toys - return result - - - - - -Q: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny? - -# solution in Python: - - -def solution(): - """Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny?""" - jason_lollipops_initial = 20 - jason_lollipops_after = 12 - denny_lollipops = jason_lollipops_initial - jason_lollipops_after - result = denny_lollipops - return result - - - - - -Q: Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total? - -# solution in Python: - - -def solution(): - """Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total?""" - leah_chocolates = 32 - sister_chocolates = 42 - total_chocolates = leah_chocolates + sister_chocolates - chocolates_eaten = 35 - chocolates_left = total_chocolates - chocolates_eaten - result = chocolates_left - return result - - - - - -Q: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot? - -# solution in Python: - - -def solution(): - """If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?""" - cars_initial = 3 - cars_arrived = 2 - total_cars = cars_initial + cars_arrived - result = total_cars - return result - - - - - -Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today? - -# solution in Python: - - -def solution(): - """There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today?""" - trees_initial = 15 - trees_after = 21 - trees_added = trees_after - trees_initial - result = trees_added - return result - - - - - -Q: {question} - -# solution in Python: -'''.strip() + '\n\n\n' \ No newline at end of file diff --git a/mycache. b/mycache. deleted file mode 100644 index f94880861839635a123c4bc9dfa33d20235b6f18..0000000000000000000000000000000000000000 Binary files a/mycache. and /dev/null differ diff --git a/ner.log b/ner.log index 279899266d4b4a4753083cfd160cc3d516dc37b5..f6515ecafbd77bf48d59b529a41204610e1f892d 100644 --- a/ner.log +++ b/ner.log @@ -1,20 +1,2 @@ -{"action_status": "started", "timestamp": 1678804794.3142183, "task_uuid": "2447e362-ebdb-4151-bb2b-70ada0c012fa", "action_type": "ner", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.314325, "task_uuid": "2447e362-ebdb-4151-bb2b-70ada0c012fa", "action_type": "ner", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3484201, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3485305, "task_uuid": "051d71c8-5062-4319-a533-fdf97e822b41", "action_type": "math", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.3736765, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.3737779, "task_uuid": "b91a9977-eb2c-4ee4-8081-2c9c11c5c84b", "action_type": "bash", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.407293, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.4074926, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} +{"action_status": "started", "timestamp": 1678752368.0900104, "task_uuid": "588cce8e-bec8-4d8e-bf9b-ea6eaa0f78c5", "action_type": "ner", "task_level": [1]} +{"action_status": "succeeded", "timestamp": 1678752368.0901597, "task_uuid": "588cce8e-bec8-4d8e-bf9b-ea6eaa0f78c5", "action_type": "ner", "task_level": [2]} diff --git a/ner.pmpt.tpl~ b/ner.pmpt.tpl~ deleted file mode 100644 index cca3be19b6e0f3b3799ef6e73bdd515a0431ea35..0000000000000000000000000000000000000000 --- a/ner.pmpt.tpl~ +++ /dev/null @@ -1,7 +0,0 @@ -You are a highly intelligent and accurate {{ domain }} domain Named-entity recognition(NER) system. You take Passage as input and your task is to recognize and extract specific types of {{ domain }} domain named entities in that given passage and classify into a set of following predefined entity types: -{{ labels }} - -Your output format is only {{ output_format|default("[{{'T': type of entity from predefined entity types, 'E': entity in the input text}},...,{{'branch' : Appropriate branch of the passage ,'group': Appropriate Group of the passage}}]") }} form, no other form. - -Input: {{ text_input }} -Output: \ No newline at end of file diff --git a/ner.py~ b/ner.py~ deleted file mode 100644 index 60ed2cc193fa73dfdf0897c7e1b0f99f481a1dd5..0000000000000000000000000000000000000000 --- a/ner.py~ +++ /dev/null @@ -1,5 +0,0 @@ -# Notebook implementation of named entity recognition. -# Adapted from [promptify](https://github.com/promptslab/Promptify/blob/main/promptify/prompts/nlp/templates/ner.jinja) - - -import minichain diff --git a/olympics.tar b/olympics.tar deleted file mode 100644 index aa46b6a422a778a8e90ac3273f88c98bb3752aa8..0000000000000000000000000000000000000000 --- a/olympics.tar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e51ad58da153bc2f290d6a168f394473db4f4e78d57774c2097eddee91e04459 -size 51281920 diff --git a/pal.log b/pal.log index 5ab0ea53c946cf7366bb25ee907ce6a9be210284..0ed3d83302319ee358667db2d06f2f62150136c0 100644 --- a/pal.log +++ b/pal.log @@ -1,14 +1,2 @@ -{"action_status": "started", "timestamp": 1678804794.407293, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.4074926, "task_uuid": "a24f4aa6-8e24-4d6b-aa12-0c326d842918", "action_type": "pal", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.616296, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.616455, "task_uuid": "45a836db-19bb-4bc5-a29b-d9a3933dd175", "action_type": "gatsby", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.7338963, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.7341123, "task_uuid": "dc9993f0-9c8a-42a8-8f7e-bc4b40be1a1e", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} +{"action_status": "started", "timestamp": 1678513858.009036, "task_uuid": "3f29d494-d9a6-40a8-9ad9-37cfb3c34749", "action_type": "pal", "task_level": [1]} +{"action_status": "succeeded", "timestamp": 1678513858.009197, "task_uuid": "3f29d494-d9a6-40a8-9ad9-37cfb3c34749", "action_type": "pal", "task_level": [2]} diff --git a/pal.pmpt.tpl~ b/pal.pmpt.tpl~ deleted file mode 100644 index 8266235ee935611f6599024aa2237ce772dfaf61..0000000000000000000000000000000000000000 --- a/pal.pmpt.tpl~ +++ /dev/null @@ -1,148 +0,0 @@ -Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left? - -# solution in Python: - - -def solution(): - """Olivia has $23. She bought five bagels for $3 each. How much money does she have left?""" - money_initial = 23 - bagels = 5 - bagel_cost = 3 - money_spent = bagels * bagel_cost - money_left = money_initial - money_spent - result = money_left - return result - - - - - -Q: Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday? - -# solution in Python: - - -def solution(): - """Michael had 58 golf balls. On tuesday, he lost 23 golf balls. On wednesday, he lost 2 more. How many golf balls did he have at the end of wednesday?""" - golf_balls_initial = 58 - golf_balls_lost_tuesday = 23 - golf_balls_lost_wednesday = 2 - golf_balls_left = golf_balls_initial - golf_balls_lost_tuesday - golf_balls_lost_wednesday - result = golf_balls_left - return result - - - - - -Q: There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room? - -# solution in Python: - - -def solution(): - """There were nine computers in the server room. Five more computers were installed each day, from monday to thursday. How many computers are now in the server room?""" - computers_initial = 9 - computers_per_day = 5 - num_days = 4 # 4 days between monday and thursday - computers_added = computers_per_day * num_days - computers_total = computers_initial + computers_added - result = computers_total - return result - - - - - -Q: Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now? - -# solution in Python: - - -def solution(): - """Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now?""" - toys_initial = 5 - mom_toys = 2 - dad_toys = 2 - total_received = mom_toys + dad_toys - total_toys = toys_initial + total_received - result = total_toys - return result - - - - - -Q: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny? - -# solution in Python: - - -def solution(): - """Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny?""" - jason_lollipops_initial = 20 - jason_lollipops_after = 12 - denny_lollipops = jason_lollipops_initial - jason_lollipops_after - result = denny_lollipops - return result - - - - - -Q: Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total? - -# solution in Python: - - -def solution(): - """Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total?""" - leah_chocolates = 32 - sister_chocolates = 42 - total_chocolates = leah_chocolates + sister_chocolates - chocolates_eaten = 35 - chocolates_left = total_chocolates - chocolates_eaten - result = chocolates_left - return result - - - - - -Q: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot? - -# solution in Python: - - -def solution(): - """If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot?""" - cars_initial = 3 - cars_arrived = 2 - total_cars = cars_initial + cars_arrived - result = total_cars - return result - - - - - -Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today? - -# solution in Python: - - -def solution(): - """There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today?""" - trees_initial = 15 - trees_after = 21 - trees_added = trees_after - trees_initial - result = trees_added - return result - - - - - -Q: {question} - -# solution in Python: \ No newline at end of file diff --git a/pal.py~ b/pal.py~ deleted file mode 100644 index c4bc54c6eebb86870629d3576122edd19caff9ca..0000000000000000000000000000000000000000 --- a/pal.py~ +++ /dev/null @@ -1,64 +0,0 @@ -# Prompt from ... -# -from dataclasses import dataclass - -from parsita import TextParsers, lit, reg - -from minichain import Backend, JinjaPrompt, SimplePrompt, start_chain - - -# Define the states of the bot. -@dataclass -class IntermediateState: - s: str -@dataclass -class FinalState: - s: str -States = FinalState | IntermediateState - - -class Pal(JinjaPrompt[States]): - template_file = "pal.pmpt.tpl" - - - def parse(self, inp: str) -> States: - return self.SelfAskParser.response.parse(inp).or_die() # type: ignore - -SelfAsk().show({"input": "What is the zip code of the city where George Washington was born?", - "agent_scratchpad":True}, - "Follow up: Where was George Washington born?") - - - -def selfask(inp: str, openai: Backend, google: Backend) -> str: - prompt1 = SelfAsk(openai) - prompt2 = SimplePrompt(google) - suffix = "" - for i in range(3): - r1 = prompt1( - dict(input=inp, suffix=suffix, agent_scratchpad=True), name=f"Chat {i}" - ) - if isinstance(r1.val, FinalState): - break - out = prompt2(r1.val.s, name=f"Google{i}") - suffix += "\nIntermediate answer:" + out.echo - return r1.val.s - - -with start_chain("pal") as backend: - result = pal( - "What is the zip code of the city where George Washington was born?", - backend.Mock( - [ - "Follow up: Where was George Washington born?", - "Follow up: What is the zip code of Virginia?", - "So the final answer is: 12312", - ] - ), - # OpenAI("") - backend.Mock(["Virginia", "12312"]), - ) -print(result) - -!eliot-tree -l 0 selfask.log | grep -v "succeeded" | grep -v "started" - diff --git a/parallel.ipynb b/parallel.ipynb deleted file mode 100644 index e01bd1bf8ef5e2938c4c20b4cb85af61b1e18bbd..0000000000000000000000000000000000000000 --- a/parallel.ipynb +++ /dev/null @@ -1,26 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "2701914a", - "metadata": { - "lines_to_next_cell": 2 - }, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/parallel.py~ b/parallel.py~ deleted file mode 100644 index ff686a6891c91d8b7164fe18a67ac43aa9bc876d..0000000000000000000000000000000000000000 --- a/parallel.py~ +++ /dev/null @@ -1,6 +0,0 @@ -from minichain import Prompt, OpenAI, Google -import trio - -async def promptee(): - async with trio.open_nursery() as nursery: - pass diff --git a/process.ipynb b/process.ipynb deleted file mode 100644 index 94b8267cd7db617064552fc5cc84139b205992a5..0000000000000000000000000000000000000000 --- a/process.ipynb +++ /dev/null @@ -1,62 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "23ebf796", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1a08de04", - "metadata": {}, - "outputs": [], - "source": [ - "import sys" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a7532406", - "metadata": {}, - "outputs": [], - "source": [ - "print(\"!pip install -q git+https://github.com/srush/MiniChain\")\n", - "print(\"!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . \")\n", - "print()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "9cf2aac4", - "metadata": {}, - "outputs": [], - "source": [ - "for l in sys.stdin:\n", - "\n", - " if l.strip() == \"# $\":\n", - " continue\n", - " if l.strip().startswith(\"code=\"):\n", - " continue\n", - " print(l, end=\"\")" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/process.py b/process.py deleted file mode 100644 index 022c06466980e572352aacfe4a1b024e73865066..0000000000000000000000000000000000000000 --- a/process.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys - -print("!pip install -q git+https://github.com/srush/MiniChain") -print("!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . ") -print() - -for l in sys.stdin: - - if l.strip() == "# $": - continue - if l.strip().startswith("code="): - continue - print(l, end="") diff --git a/process.py~ b/process.py~ deleted file mode 100644 index 2802818ef2ec6705a2de051f95d6a9f24e8334be..0000000000000000000000000000000000000000 --- a/process.py~ +++ /dev/null @@ -1,11 +0,0 @@ -import sys - -print("!pip install -qqq git+https://github.com/srush/MiniChain@gradio") -print() - -for l in sys.stdin: - print(l, end="") - if l.strip() == "# $": - continue - if l.strip().startswith("code="): - continue diff --git a/qa.log b/qa.log deleted file mode 100644 index 04c791cb626dcbc757b7799d7994d421561c717b..0000000000000000000000000000000000000000 --- a/qa.log +++ /dev/null @@ -1,8 +0,0 @@ -{"action_status": "started", "timestamp": 1679155951.6284053, "task_uuid": "1145ccf3-d2cd-4c63-acea-8c3131442596", "action_type": "qa", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1679155951.6284745, "task_uuid": "1145ccf3-d2cd-4c63-acea-8c3131442596", "action_type": "qa", "task_level": [2]} -{"action_status": "started", "timestamp": 1679155957.2591064, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "", "task_level": [1]} -{"input": {"query": "What is the total number of medals won by France?"}, "action_status": "started", "timestamp": 1679155957.2591872, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1679155957.2592237, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "{'query': 'What is the total number of medals won by France?'}", "action_status": "started", "timestamp": 1679155957.2592478, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1679155957.2703598, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1679155957.2704325, "task_uuid": "b2e93b45-c99c-4cb4-8280-53873547c18e", "action_type": "", "task_level": [4]} diff --git a/qa.pmpt.tpl~ b/qa.pmpt.tpl~ deleted file mode 100644 index 618e74047c9f88a5616b7a655bca924cb918f035..0000000000000000000000000000000000000000 --- a/qa.pmpt.tpl~ +++ /dev/null @@ -1,12 +0,0 @@ -Answer the question as truthfully as possible using the provided context, and if the answer is not contained within the text below, say "I don't know." - -Context: - -{% for doc in docs %} -* {{doc}} -{% endfor %} - - Q: {{question}} - - A: - diff --git a/qa.py~ b/qa.py~ deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/requirements.gradio_example.txt b/requirements.gradio_example.txt deleted file mode 100644 index 46199ea1dbc6cdf6d9519d27a3b4653329aedd1a..0000000000000000000000000000000000000000 --- a/requirements.gradio_example.txt +++ /dev/null @@ -1,2 +0,0 @@ -minichain -git+https://github.com/freddyaboulton/gradio-tools/ diff --git a/requirements.txt b/requirements.txt index 070663b86a342fd52dd289df10c89e6267469f99..d4b103014bc3afca2cf1aee79017ca108abce871 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ gradio git+https://github.com/srush/minichain/ faiss-cpu manifest-ml -git+https://github.com/freddyaboulton/gradio-tools/@fix-gradio-conditional-import diff --git a/requirements.txt~ b/requirements.txt~ deleted file mode 100644 index c67c7b7b34055601856dd5ea55cdb9fb7dddd386..0000000000000000000000000000000000000000 --- a/requirements.txt~ +++ /dev/null @@ -1,5 +0,0 @@ -gradio -minichain -faiss-cpu -manifest-ml -git+https://github.com/freddyaboulton/gradio-tools/ diff --git a/selfask.html b/selfask.html deleted file mode 100644 index 5b95b1f2a69e235f960638c1b2bd4156055999b8..0000000000000000000000000000000000000000 --- a/selfask.html +++ /dev/null @@ -1,15063 +0,0 @@ - - - - - -selfask - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/selfask.log b/selfask.log deleted file mode 100644 index d8da7214002848ce675d55efa73ca92a04d09fe3..0000000000000000000000000000000000000000 --- a/selfask.log +++ /dev/null @@ -1,42 +0,0 @@ -{"action_status": "started", "timestamp": 1677507490.1828454, "task_uuid": "17a9eb4a-7068-479d-a6f5-3204940ce3f6", "action_type": "selfask", "task_level": [1]} -{"action_status": "started", "timestamp": 1677507490.5062928, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "", "task_level": [1]} -{"input": {"input": "What is the zip code of the city where George Washington was born?", "suffix": "", "agent_scratchpad": true}, "action_status": "started", "timestamp": 1677507490.5063727, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677507490.5099194, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Question: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\n", "action_status": "started", "timestamp": 1677507490.5099747, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677507491.7682626, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Prompted", "task_level": [3, 2]} -{"result": "Follow up: What city was George Washington born in?", "action_status": "started", "timestamp": 1677507491.7684474, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677507491.7741306, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677507491.7742665, "task_uuid": "a1394473-6f63-4eda-a13c-b04d79cc2ad4", "action_type": "", "task_level": [5]} -{"action_status": "started", "timestamp": 1677507491.774431, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "", "task_level": [1]} -{"input": "What city was George Washington born in?", "action_status": "started", "timestamp": 1677507491.7745311, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677507491.7746096, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "What city was George Washington born in?", "action_status": "started", "timestamp": 1677507491.7747374, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677507497.9417536, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Prompted", "task_level": [3, 2]} -{"result": "Westmoreland County, VA", "action_status": "started", "timestamp": 1677507497.9420028, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677507497.942118, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677507497.9422014, "task_uuid": "ffe25034-5698-4de3-9cea-dc45d7c5bbbb", "action_type": "", "task_level": [5]} -{"action_status": "started", "timestamp": 1677507497.9423742, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "", "task_level": [1]} -{"input": {"input": "What is the zip code of the city where George Washington was born?", "suffix": "Question: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\n", "agent_scratchpad": true}, "action_status": "started", "timestamp": 1677507497.9424758, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677507497.9489567, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Question: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\n", "action_status": "started", "timestamp": 1677507497.9491816, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677507499.674529, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Prompted", "task_level": [3, 2]} -{"result": "Follow up: What is the zip code of Westmoreland County, VA?", "action_status": "started", "timestamp": 1677507499.6746047, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677507499.6762059, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677507499.6762424, "task_uuid": "bb2f39a3-d025-4c15-a564-f2c33f48d14f", "action_type": "", "task_level": [5]} -{"action_status": "started", "timestamp": 1677507499.6762943, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "", "task_level": [1]} -{"input": "What is the zip code of Westmoreland County, VA?", "action_status": "started", "timestamp": 1677507499.6763287, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677507499.6763496, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "What is the zip code of Westmoreland County, VA?", "action_status": "started", "timestamp": 1677507499.6763678, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677507505.9668486, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Prompted", "task_level": [3, 2]} -{"result": "ZIP Codes in Westmoreland County VA \u00b7 22443 \u00b7 22520 \u00b7 22469 \u00b7 22488 \u00b7 22442 \u00b7 22524 \u00b7 22529 \u00b7 22558 ...", "action_status": "started", "timestamp": 1677507505.9670618, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677507505.9671662, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677507505.9672434, "task_uuid": "a350a6f0-d210-474f-bc35-30326fba706d", "action_type": "", "task_level": [5]} -{"action_status": "started", "timestamp": 1677507505.967399, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "", "task_level": [1]} -{"input": {"input": "What is the zip code of the city where George Washington was born?", "suffix": "Question: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\nFollow up: What is the zip code of Westmoreland County, VA?\nIntermediate answer: ZIP Codes in Westmoreland County VA \u00b7 22443 \u00b7 22520 \u00b7 22469 \u00b7 22488 \u00b7 22442 \u00b7 22524 \u00b7 22529 \u00b7 22558 ...\n", "agent_scratchpad": true}, "action_status": "started", "timestamp": 1677507505.9674897, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677507505.9734888, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Question: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nQuestion: Who lived longer, Muhammad Ali or Alan Turing?\nAre follow up questions needed here: Yes.\nFollow up: How old was Muhammad Ali when he died?\nIntermediate answer: Muhammad Ali was 74 years old when he died.\nFollow up: How old was Alan Turing when he died?\nIntermediate answer: Alan Turing was 41 years old when he died.\nSo the final answer is: Muhammad Ali\n\nQuestion: When was the founder of craigslist born?\nAre follow up questions needed here: Yes.\nFollow up: Who was the founder of craigslist?\nIntermediate answer: Craigslist was founded by Craig Newmark.\nFollow up: When was Craig Newmark born?\nIntermediate answer: Craig Newmark was born on December 6, 1952.\nSo the final answer is: December 6, 1952\n\nQuestion: Who was the maternal grandfather of George Washington?\nAre follow up questions needed here: Yes.\nFollow up: Who was the mother of George Washington?\nIntermediate answer: The mother of George Washington was Mary Ball Washington.\nFollow up: Who was the father of Mary Ball Washington?\nIntermediate answer: The father of Mary Ball Washington was Joseph Ball.\nSo the final answer is: Joseph Ball\n\nQuestion: Are both the directors of Jaws and Casino Royale from the same country?\nAre follow up questions needed here: Yes.\nFollow up: Who is the director of Jaws?\nIntermediate answer: The director of Jaws is Steven Spielberg.\nFollow up: Where is Steven Spielberg from?\nIntermediate answer: The United States.\nFollow up: Who is the director of Casino Royale?\nIntermediate answer: The director of Casino Royale is Martin Campbell.\nFollow up: Where is Martin Campbell from?\nIntermediate answer: New Zealand.\nSo the final answer is: No\n\nQuestion: What is the zip code of the city where George Washington was born?\nAre followup questions needed here: Yes.\nFollow up: What city was George Washington born in?\nIntermediate answer: Westmoreland County, VA\nFollow up: What is the zip code of Westmoreland County, VA?\nIntermediate answer: ZIP Codes in Westmoreland County VA \u00b7 22443 \u00b7 22520 \u00b7 22469 \u00b7 22488 \u00b7 22442 \u00b7 22524 \u00b7 22529 \u00b7 22558 ...\n", "action_status": "started", "timestamp": 1677507505.9736862, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677507508.3805308, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Prompted", "task_level": [3, 2]} -{"result": "So the final answer is: 22443, 22520, 22469, 22488, 22442, 22524, 22529, 22558", "action_status": "started", "timestamp": 1677507508.3807206, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677507508.3863213, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677507508.386487, "task_uuid": "76cb4bce-847c-4867-ad34-804cbf25324f", "action_type": "", "task_level": [5]} -{"action_status": "succeeded", "timestamp": 1677507508.386752, "task_uuid": "17a9eb4a-7068-479d-a6f5-3204940ce3f6", "action_type": "selfask", "task_level": [2]} diff --git a/selfask/#base.py# b/selfask/#base.py# deleted file mode 100644 index 158b28131ff9c0a61baa6ad40c5c16777eaa2fef..0000000000000000000000000000000000000000 --- a/selfask/#base.py# +++ /dev/null @@ -1,95 +0,0 @@ -# Prompt from ... -# -from dataclasses import dataclass - -from jinja2 import Template -from parsita import * - - -self_ask_prompt = """ -Question: Who lived longer, Muhammad Ali or Alan Turing? -Are follow up questions needed here: Yes. -Follow up: How old was Muhammad Ali when he died? -Intermediate answer: Muhammad Ali was 74 years old when he died. -Follow up: How old was Alan Turing when he died? -Intermediate answer: Alan Turing was 41 years old when he died. -So the final answer is: Muhammad Ali - -Question: When was the founder of craigslist born? -Are follow up questions needed here: Yes. -Follow up: Who was the founder of craigslist? -Intermediate answer: Craigslist was founded by Craig Newmark. -Follow up: When was Craig Newmark born? -Intermediate answer: Craig Newmark was born on December 6, 1952. -So the final answer is: December 6, 1952 - -Question: Who was the maternal grandfather of George Washington? -Are follow up questions needed here: Yes. -Follow up: Who was the mother of George Washington? -Intermediate answer: The mother of George Washington was Mary Ball Washington. -Follow up: Who was the father of Mary Ball Washington? -Intermediate answer: The father of Mary Ball Washington was Joseph Ball. -So the final answer is: Joseph Ball - -Question: Are both the directors of Jaws and Casino Royale from the same country? -Are follow up questions needed here: Yes. -Follow up: Who is the director of Jaws? -Intermediate answer: The director of Jaws is Steven Spielberg. -Follow up: Where is Steven Spielberg from? -Intermediate answer: The United States. -Follow up: Who is the director of Casino Royale? -Intermediate answer: The director of Casino Royale is Martin Campbell. -Follow up: Where is Martin Campbell from? -Intermediate answer: New Zealand. -So the final answer is: No - -Question: {{input}} -Are followup questions needed here: {% if agent_scratchpad %}Yes{%else%}No{% endif %}. -""" - - -@dataclass -class Intermediate: - val: str - - -@dataclass -class Final: - val: str - - -class SelfAskParser(TextParsers): - follow = (lit("Follow up:") >> reg(r".*")) > Intermediate - finish = (lit("So the final answer is: ") >> reg(r".*")) > Final - response = follow | finish - - -self_ask = Prompt( - Template(self_ask_prompt).render, - parse(SelfAskParser.response), - stop="\nIntermediate answer:", -) - - -def selfask(inp: str, openai: Backend, google: Backend): - echo, result = self_ask.echo_run(openai, input=inp, agent_scratchpad=True) - for i in range(3): - out = Prompt(result.val).run(google) - echo = echo + "\nIntermediate answer:" + out - echo, result = Prompt( - echo, parse(SelfAskParser.response), stop="\nIntermediate answer:" - ).echo_run(openai) - if isinstance(result, Final): - break - - return result.val - - -if __name__ == "__main__": - print( - selfask( - "What is the zip code of the city where George Washington was born?", - OpenAI("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"), - Google("593a073fa4c730efe918e592a538b36e80841bc8f8dd4070c1566920f75ba140"), - ) - ) diff --git a/show.ipynb b/show.ipynb deleted file mode 100644 index e22137d57847f01c076f54aafe19dc692ab8adae..0000000000000000000000000000000000000000 --- a/show.ipynb +++ /dev/null @@ -1,38 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "d2e411b0", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bd17882b", - "metadata": {}, - "outputs": [], - "source": [ - "import json, sys\n", - "from eliottree import tasks_from_iterable, render_tasks\n", - "render_tasks(sys.stderr.write,\n", - " tasks_from_iterable([json.loads(l) for l in open(\"bash.log\")]),\n", - " colorize=True, human_readable=True)" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/show.py b/show.py deleted file mode 100644 index fe4f5785b3d0f2aae30de2c9dedc27ea65deffd5..0000000000000000000000000000000000000000 --- a/show.py +++ /dev/null @@ -1,5 +0,0 @@ -import json, sys -from eliottree import tasks_from_iterable, render_tasks -render_tasks(sys.stderr.write, - tasks_from_iterable([json.loads(l) for l in open("bash.log")]), - colorize=True, human_readable=True) diff --git a/show.py~ b/show.py~ deleted file mode 100644 index 0866c779e7773d22ce1286c2f22be906b7d39dea..0000000000000000000000000000000000000000 --- a/show.py~ +++ /dev/null @@ -1,3 +0,0 @@ -import json, sys -from eliottree import tasks_from_iterable, render_tasks -render_tasks(sys.stdout.write, tasks_from_iterable([json.parse(l) for l in open("bash")]), colorize=True) diff --git a/sixers.txt~ b/sixers.txt~ deleted file mode 100644 index 5949f9d78413ad57091712dc7de60f9945564d65..0000000000000000000000000000000000000000 --- a/sixers.txt~ +++ /dev/null @@ -1,7 +0,0 @@ -The Philadelphia 76ers entered their Christmas Day matinee at Madison Square Garden against the New York Knicks having won seven straight games, all at home. They can now add an eighth victory to that list. Led by a dominant fourth quarter, the 76ers (20-12) defeated the Knicks (18-16), 119-112. - -Joel Embiid led the way with 35 points and eight rebounds, while James Harden added 29 points and 13 assists in another dazzling performance. They got a boost off the bench from Georges Niang, who nailed four 3s in the fourth quarter to finish with 16 points. - -The Knicks have now lost three straight games following an eight-game unbeaten run. Julius Randle matched Embiid with 35 points, but only four of those came in the fourth quarter. - -Follow here for updates and analysis from The Athletic's staff. diff --git a/stats.log b/stats.log deleted file mode 100644 index 86cdd4454717961298f6a9c0036cdb3e37530d49..0000000000000000000000000000000000000000 --- a/stats.log +++ /dev/null @@ -1,8 +0,0 @@ -{"action_status": "started", "timestamp": 1678804794.8375309, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [1]} -{"action_status": "succeeded", "timestamp": 1678804794.8376832, "task_uuid": "dd1251af-7770-460d-ac61-85db28fd24df", "action_type": "stats", "task_level": [2]} -{"action_status": "started", "timestamp": 1678804807.8764367, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [1]} -{"input": {"question": "What is the sum of the powers of 3 (3^i) that are smaller than 100?"}, "action_status": "started", "timestamp": 1678804807.876612, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1678804807.8774285, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1678804807.877532, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 1]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8874092, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "Prompted", "task_level": [3, 2]} -{"exception": "builtins.AssertionError", "reason": "Need an OPENAI_KEY. Get one here https://openai.com/api/", "action_status": "failed", "timestamp": 1678804807.8875778, "task_uuid": "3130f0e2-8d6f-4992-9e12-8f90e9aa96c4", "action_type": "", "task_level": [4]} diff --git a/story.ipynb b/story.ipynb deleted file mode 100644 index fe82369c89df4460f56ce6d2b2be4242469cebdd..0000000000000000000000000000000000000000 --- a/story.ipynb +++ /dev/null @@ -1,61 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "1a916d9f", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "72eb4abe", - "metadata": {}, - "outputs": [], - "source": [ - "from asyncio import gather" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "34d78edc", - "metadata": {}, - "outputs": [], - "source": [ - "@simple\n", - "def outline():\n", - " return \"What is the outline?\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "00dcaee2", - "metadata": { - "lines_to_next_cell": 2 - }, - "outputs": [], - "source": [ - "@composite\n", - "async def story(bot: Bot):\n", - " calls = [bot(outline()), bot(characters())]\n", - " outline, characters = gather([calls])" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/story.py b/story.py deleted file mode 100644 index dccb41181a61c8ee3579ac70c8af234e015b74db..0000000000000000000000000000000000000000 --- a/story.py +++ /dev/null @@ -1,13 +0,0 @@ -from asyncio import gather - - -@simple -def outline(): - return "What is the outline?" - - -@composite -async def story(bot: Bot): - calls = [bot(outline()), bot(characters())] - outline, characters = gather([calls]) - diff --git a/story.py~ b/story.py~ deleted file mode 100644 index e59aef9e7ada8b1769b597c0cc278470815ed09c..0000000000000000000000000000000000000000 --- a/story.py~ +++ /dev/null @@ -1,6 +0,0 @@ - -@chain -def story(bot): - out = bot(outline) - character = bot(characters) - return character diff --git a/summary.log b/summary.log deleted file mode 100644 index 19c5a7cf8aade3688179419a93ff7118422aef4f..0000000000000000000000000000000000000000 --- a/summary.log +++ /dev/null @@ -1,42 +0,0 @@ -{"action_status": "started", "timestamp": 1677375735.9654164, "task_uuid": "b77ccab5-cdad-4436-a3e1-230da294a528", "action_type": "summary", "task_level": [1]} -{"action_status": "started", "timestamp": 1677375736.3633964, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "", "task_level": [1]} -{"input": {"text": " why it is so important to pass the Bipartisan Innovation Act sitting in Congress that will make record investments in emerging technologies and American manufacturing. \nLet me give you one example of why it\u2019s so important to pass it. \nIf you travel 20 miles east of Columbus, Ohio, you\u2019ll find 1,000 empty acres of land. \nIt won\u2019t look like much, but if you stop and look closely, you\u2019ll see a \u201cField of dreams,\u201d the ground on which America\u2019s future will be built. \nThis is where Intel, the American company that helped build Silicon Valley, is going to build its $20 billion semiconductor \u201cmega site\u201d. \nUp to eight state-of-the-art factories in one place. 10,000 new good-paying jobs. \nSome of the most sophisticated manufacturing in the world to make computer chips the size of a fingertip that power the world and our everyday lives. \nSmartphones. The Internet. Technology we have yet to invent. \nBut that\u2019s just the beginning. \nIntel\u2019s CEO, Pat Gelsinger, who is here tonight, told me they are ready to increase their investment from \n$20 billion to $100 billion. \nThat would be one of the biggest investments in manufacturing in American history. \nAnd all they\u2019re waiting for is for you to pass this bill. \nSo let\u2019s not wait any longer. Send it to my desk. I\u2019ll sign it. \nAnd we will really take off. \nAnd Intel is not alone. \nThere\u2019s something happening in America. \nJust look around and you\u2019ll see an amazing story. \nThe rebirth of the pride that comes from stamping products \u201cMade In America.\u201d The revitalization of American manufacturing. \nCompanies are choosing to build new factories here, when just a few years ago, they would have built them overseas. \nThat\u2019s what is happening. Ford is investing $11 billion to build electric vehicles, creating 11,000 jobs across the country. \nGM is making the largest investment in its history\u2014$7 billion to build electric vehicles, creating 4,000 jobs in Michigan. \nAll told, we created 369,000 new manufacturing jobs in America just last year. \nPowered by people I\u2019ve met like JoJo Burgess, from generations of union steelworkers from Pittsburgh, who\u2019s here with us tonight. \nAs Ohio Senator Sherrod Brown says, \u201cIt\u2019s time to bury the label \u201cRust Belt.\u201d \nIt\u2019s time. \nBut with all the bright spots in our economy, record job growth and higher wages, too many families are struggling to keep up with the bills. \nInflation is robbing them of the gains they might otherwise feel. \nI get it. That\u2019s why my top priority is getting prices under control. \nLook, our economy roared back faster than most predicted, but the pandemic meant that businesses had a hard time hiring enough workers to keep up production in their factories. \nThe pandemic also disrupted global supply chains. \nWhen factories close, it takes longer to make goods and get them from the warehouse to the store, and prices go up. \nLook at cars. \nLast year, there weren\u2019t enough semiconductors to make all the cars that people wanted to buy. \nAnd guess what, prices of automobiles went up. \nSo\u2014we have a choice. \nOne way to fight inflation is to drive down wages and make Americans poorer. \nI have a better plan to fight inflation. \nLower your costs, not your wages. \nMake more cars and semiconductors in America. \nMore infrastructure and innovation in America. \nMore goods moving faster and cheaper in America. \nMore jobs where you can earn a good living in America. \nAnd instead of relying on foreign supply chains, let\u2019s make it in America. \nEconomists call it \u201cincreasing the productive capacity of our economy.\u201d \nI call it building a better America. \nMy plan to fight inflation will lower your costs and lower the deficit. \n17 Nobel laureates in economics say my plan will ease long-term inflationary pressures. Top business leaders and most Americans support my plan. And here\u2019s the plan: \nFirst \u2013 cut the cost of prescription drugs. Just look at insulin. One in ten Americans has diabetes. In Virginia, I met a 13-year-old boy named Joshua Davis. \nHe and his Dad both have Type 1 diabetes, which means they need insulin every day. Insulin costs about $10 a vial to make. \nBut drug companies charge families like Joshua and his Dad up to 30 times more. I spoke with Joshua\u2019s mom. \nImagine what it\u2019s like to look at your child who needs insulin and have no idea how you\u2019re going to pay for it. \nWhat it does to your dignity, your ability to look your child in the eye, to be the parent you expect to be. \nJoshua is here with us tonight. Yesterday was his birthday. Happy birthday, buddy. \nFor Joshua, and for the 200,000 other young people with Type 1 diabetes, let\u2019s cap the cost of insulin at $35 a month so everyone can afford it. \nDrug companies will still do very well. And while we\u2019re at it let Medicare negotiate lower prices for prescription drugs, like the VA a"}, "action_status": "started", "timestamp": 1677375736.3634725, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677375736.3660543, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Write a concise summary of the following:\n\n\n\" why it is so important to pass the Bipartisan Innovation Act sitting in Congress that will make record investments in emerging technologies and American manufacturing. \nLet me give you one example of why it\u2019s so important to pass it. \nIf you travel 20 miles east of Columbus, Ohio, you\u2019ll find 1,000 empty acres of land. \nIt won\u2019t look like much, but if you stop and look closely, you\u2019ll see a \u201cField of dreams,\u201d the ground on which America\u2019s future will be built. \nThis is where Intel, the American company that helped build Silicon Valley, is going to build its $20 billion semiconductor \u201cmega site\u201d. \nUp to eight state-of-the-art factories in one place. 10,000 new good-paying jobs. \nSome of the most sophisticated manufacturing in the world to make computer chips the size of a fingertip that power the world and our everyday lives. \nSmartphones. The Internet. Technology we have yet to invent. \nBut that\u2019s just the beginning. \nIntel\u2019s CEO, Pat Gelsinger, who is here tonight, told me they are ready to increase their investment from \n$20 billion to $100 billion. \nThat would be one of the biggest investments in manufacturing in American history. \nAnd all they\u2019re waiting for is for you to pass this bill. \nSo let\u2019s not wait any longer. Send it to my desk. I\u2019ll sign it. \nAnd we will really take off. \nAnd Intel is not alone. \nThere\u2019s something happening in America. \nJust look around and you\u2019ll see an amazing story. \nThe rebirth of the pride that comes from stamping products \u201cMade In America.\u201d The revitalization of American manufacturing. \nCompanies are choosing to build new factories here, when just a few years ago, they would have built them overseas. \nThat\u2019s what is happening. Ford is investing $11 billion to build electric vehicles, creating 11,000 jobs across the country. \nGM is making the largest investment in its history\u2014$7 billion to build electric vehicles, creating 4,000 jobs in Michigan. \nAll told, we created 369,000 new manufacturing jobs in America just last year. \nPowered by people I\u2019ve met like JoJo Burgess, from generations of union steelworkers from Pittsburgh, who\u2019s here with us tonight. \nAs Ohio Senator Sherrod Brown says, \u201cIt\u2019s time to bury the label \u201cRust Belt.\u201d \nIt\u2019s time. \nBut with all the bright spots in our economy, record job growth and higher wages, too many families are struggling to keep up with the bills. \nInflation is robbing them of the gains they might otherwise feel. \nI get it. That\u2019s why my top priority is getting prices under control. \nLook, our economy roared back faster than most predicted, but the pandemic meant that businesses had a hard time hiring enough workers to keep up production in their factories. \nThe pandemic also disrupted global supply chains. \nWhen factories close, it takes longer to make goods and get them from the warehouse to the store, and prices go up. \nLook at cars. \nLast year, there weren\u2019t enough semiconductors to make all the cars that people wanted to buy. \nAnd guess what, prices of automobiles went up. \nSo\u2014we have a choice. \nOne way to fight inflation is to drive down wages and make Americans poorer. \nI have a better plan to fight inflation. \nLower your costs, not your wages. \nMake more cars and semiconductors in America. \nMore infrastructure and innovation in America. \nMore goods moving faster and cheaper in America. \nMore jobs where you can earn a good living in America. \nAnd instead of relying on foreign supply chains, let\u2019s make it in America. \nEconomists call it \u201cincreasing the productive capacity of our economy.\u201d \nI call it building a better America. \nMy plan to fight inflation will lower your costs and lower the deficit. \n17 Nobel laureates in economics say my plan will ease long-term inflationary pressures. Top business leaders and most Americans support my plan. And here\u2019s the plan: \nFirst \u2013 cut the cost of prescription drugs. Just look at insulin. One in ten Americans has diabetes. In Virginia, I met a 13-year-old boy named Joshua Davis. \nHe and his Dad both have Type 1 diabetes, which means they need insulin every day. Insulin costs about $10 a vial to make. \nBut drug companies charge families like Joshua and his Dad up to 30 times more. I spoke with Joshua\u2019s mom. \nImagine what it\u2019s like to look at your child who needs insulin and have no idea how you\u2019re going to pay for it. \nWhat it does to your dignity, your ability to look your child in the eye, to be the parent you expect to be. \nJoshua is here with us tonight. Yesterday was his birthday. Happy birthday, buddy. \nFor Joshua, and for the 200,000 other young people with Type 1 diabetes, let\u2019s cap the cost of insulin at $35 a month so everyone can afford it. \nDrug companies will still do very well. And while we\u2019re at it let Medicare negotiate lower prices for prescription drugs, like the VA a\"\n\n\nCONCISE SUMMARY:", "action_status": "started", "timestamp": 1677375736.3661082, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "started", "timestamp": 1677375736.7374547, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "", "task_level": [1]} -{"input": {"text": "st things I did as President was fight to pass the American Rescue Plan. \nBecause people were hurting. We needed to act, and we did. \nFew pieces of legislation have done more in a critical moment in our history to lift us out of crisis. \nIt fueled our efforts to vaccinate the nation and combat COVID-19. It delivered immediate economic relief for tens of millions of Americans. \nHelped put food on their table, keep a roof over their heads, and cut the cost of health insurance. \nAnd as my Dad used to say, it gave people a little breathing room. \nAnd unlike the $2 Trillion tax cut passed in the previous administration that benefitted the top 1% of Americans, the American Rescue Plan helped working people\u2014and left no one behind. \nAnd it worked. It created jobs. Lots of jobs. \nIn fact\u2014our economy created over 6.5 Million new jobs just last year, more jobs created in one year \nthan ever before in the history of America. \nOur economy grew at a rate of 5.7% last year, the strongest growth in nearly 40 years, the first step in bringing fundamental change to an economy that hasn\u2019t worked for the working people of this nation for too long. \nFor the past 40 years we were told that if we gave tax breaks to those at the very top, the benefits would trickle down to everyone else. \nBut that trickle-down theory led to weaker economic growth, lower wages, bigger deficits, and the widest gap between those at the top and everyone else in nearly a century. \nVice President Harris and I ran for office with a new economic vision for America. \nInvest in America. Educate Americans. Grow the workforce. Build the economy from the bottom up \nand the middle out, not from the top down. \nBecause we know that when the middle class grows, the poor have a ladder up and the wealthy do very well. \nAmerica used to have the best roads, bridges, and airports on Earth. \nNow our infrastructure is ranked 13th in the world. \nWe won\u2019t be able to compete for the jobs of the 21st Century if we don\u2019t fix that. \nThat\u2019s why it was so important to pass the Bipartisan Infrastructure Law\u2014the most sweeping investment to rebuild America in history. \nThis was a bipartisan effort, and I want to thank the members of both parties who worked to make it happen. \nWe\u2019re done talking about infrastructure weeks. \nWe\u2019re going to have an infrastructure decade. \nIt is going to transform America and put us on a path to win the economic competition of the 21st Century that we face with the rest of the world\u2014particularly with China. \nAs I\u2019ve told Xi Jinping, it is never a good bet to bet against the American people. \nWe\u2019ll create good jobs for millions of Americans, modernizing roads, airports, ports, and waterways all across America. \nAnd we\u2019ll do it all to withstand the devastating effects of the climate crisis and promote environmental justice. \nWe\u2019ll build a national network of 500,000 electric vehicle charging stations, begin to replace poisonous lead pipes\u2014so every child\u2014and every American\u2014has clean water to drink at home and at school, provide affordable high-speed internet for every American\u2014urban, suburban, rural, and tribal communities. \n4,000 projects have already been announced. \nAnd tonight, I\u2019m announcing that this year we will start fixing over 65,000 miles of highway and 1,500 bridges in disrepair. \nWhen we use taxpayer dollars to rebuild America \u2013 we are going to Buy American: buy American products to support American jobs. \nThe federal government spends about $600 Billion a year to keep the country safe and secure. \nThere\u2019s been a law on the books for almost a century \nto make sure taxpayers\u2019 dollars support American jobs and businesses. \nEvery Administration says they\u2019ll do it, but we are actually doing it. \nWe will buy American to make sure everything from the deck of an aircraft carrier to the steel on highway guardrails are made in America. \nBut to compete for the best jobs of the future, we also need to level the playing field with China and other competitors. \nThat\u2019s why it is so important to pass the Bipartisan Innovation Act sitting in Congress that will make record investments in emerging technologies and American manufacturing. \nLet me give you one example of why it\u2019s so important to pass it. \nIf you travel 20 miles east of Columbus, Ohio, you\u2019ll find 1,000 empty acres of land. \nIt won\u2019t look like much, but if you stop and look closely, you\u2019ll see a \u201cField of dreams,\u201d the ground on which America\u2019s future will be built. \nThis is where Intel, the American company that helped build Silicon Valley, is going to build its $20 billion semiconductor \u201cmega site\u201d. \nUp to eight state-of-the-art factories in one place. 10,000 new good-paying jobs. \nSome of the most sophisticated manufacturing in the world to make computer chips the size of a fingertip that po"}, "action_status": "started", "timestamp": 1677375736.7375212, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677375736.7382529, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Write a concise summary of the following:\n\n\n\"st things I did as President was fight to pass the American Rescue Plan. \nBecause people were hurting. We needed to act, and we did. \nFew pieces of legislation have done more in a critical moment in our history to lift us out of crisis. \nIt fueled our efforts to vaccinate the nation and combat COVID-19. It delivered immediate economic relief for tens of millions of Americans. \nHelped put food on their table, keep a roof over their heads, and cut the cost of health insurance. \nAnd as my Dad used to say, it gave people a little breathing room. \nAnd unlike the $2 Trillion tax cut passed in the previous administration that benefitted the top 1% of Americans, the American Rescue Plan helped working people\u2014and left no one behind. \nAnd it worked. It created jobs. Lots of jobs. \nIn fact\u2014our economy created over 6.5 Million new jobs just last year, more jobs created in one year \nthan ever before in the history of America. \nOur economy grew at a rate of 5.7% last year, the strongest growth in nearly 40 years, the first step in bringing fundamental change to an economy that hasn\u2019t worked for the working people of this nation for too long. \nFor the past 40 years we were told that if we gave tax breaks to those at the very top, the benefits would trickle down to everyone else. \nBut that trickle-down theory led to weaker economic growth, lower wages, bigger deficits, and the widest gap between those at the top and everyone else in nearly a century. \nVice President Harris and I ran for office with a new economic vision for America. \nInvest in America. Educate Americans. Grow the workforce. Build the economy from the bottom up \nand the middle out, not from the top down. \nBecause we know that when the middle class grows, the poor have a ladder up and the wealthy do very well. \nAmerica used to have the best roads, bridges, and airports on Earth. \nNow our infrastructure is ranked 13th in the world. \nWe won\u2019t be able to compete for the jobs of the 21st Century if we don\u2019t fix that. \nThat\u2019s why it was so important to pass the Bipartisan Infrastructure Law\u2014the most sweeping investment to rebuild America in history. \nThis was a bipartisan effort, and I want to thank the members of both parties who worked to make it happen. \nWe\u2019re done talking about infrastructure weeks. \nWe\u2019re going to have an infrastructure decade. \nIt is going to transform America and put us on a path to win the economic competition of the 21st Century that we face with the rest of the world\u2014particularly with China. \nAs I\u2019ve told Xi Jinping, it is never a good bet to bet against the American people. \nWe\u2019ll create good jobs for millions of Americans, modernizing roads, airports, ports, and waterways all across America. \nAnd we\u2019ll do it all to withstand the devastating effects of the climate crisis and promote environmental justice. \nWe\u2019ll build a national network of 500,000 electric vehicle charging stations, begin to replace poisonous lead pipes\u2014so every child\u2014and every American\u2014has clean water to drink at home and at school, provide affordable high-speed internet for every American\u2014urban, suburban, rural, and tribal communities. \n4,000 projects have already been announced. \nAnd tonight, I\u2019m announcing that this year we will start fixing over 65,000 miles of highway and 1,500 bridges in disrepair. \nWhen we use taxpayer dollars to rebuild America \u2013 we are going to Buy American: buy American products to support American jobs. \nThe federal government spends about $600 Billion a year to keep the country safe and secure. \nThere\u2019s been a law on the books for almost a century \nto make sure taxpayers\u2019 dollars support American jobs and businesses. \nEvery Administration says they\u2019ll do it, but we are actually doing it. \nWe will buy American to make sure everything from the deck of an aircraft carrier to the steel on highway guardrails are made in America. \nBut to compete for the best jobs of the future, we also need to level the playing field with China and other competitors. \nThat\u2019s why it is so important to pass the Bipartisan Innovation Act sitting in Congress that will make record investments in emerging technologies and American manufacturing. \nLet me give you one example of why it\u2019s so important to pass it. \nIf you travel 20 miles east of Columbus, Ohio, you\u2019ll find 1,000 empty acres of land. \nIt won\u2019t look like much, but if you stop and look closely, you\u2019ll see a \u201cField of dreams,\u201d the ground on which America\u2019s future will be built. \nThis is where Intel, the American company that helped build Silicon Valley, is going to build its $20 billion semiconductor \u201cmega site\u201d. \nUp to eight state-of-the-art factories in one place. 10,000 new good-paying jobs. \nSome of the most sophisticated manufacturing in the world to make computer chips the size of a fingertip that po\"\n\n\nCONCISE SUMMARY:", "action_status": "started", "timestamp": 1677375736.7382874, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "started", "timestamp": 1677375736.7389073, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "", "task_level": [1]} -{"input": {"text": "r economy. The Ruble has lost 30% of its value. \nThe Russian stock market has lost 40% of its value and trading remains suspended. Russia\u2019s economy is reeling and Putin alone is to blame. \nTogether with our allies we are providing support to the Ukrainians in their fight for freedom. Military assistance. Economic assistance. Humanitarian assistance. \nWe are giving more than $1 Billion in direct assistance to Ukraine. \nAnd we will continue to aid the Ukrainian people as they defend their country and to help ease their suffering. \nLet me be clear, our forces are not engaged and will not engage in conflict with Russian forces in Ukraine. \nOur forces are not going to Europe to fight in Ukraine, but to defend our NATO Allies \u2013 in the event that Putin decides to keep moving west. \nFor that purpose we\u2019ve mobilized American ground forces, air squadrons, and ship deployments to protect NATO countries including Poland, Romania, Latvia, Lithuania, and Estonia. \nAs I have made crystal clear the United States and our Allies will defend every inch of territory of NATO countries with the full force of our collective power. \nAnd we remain clear-eyed. The Ukrainians are fighting back with pure courage. But the next few days weeks, months, will be hard on them. \nPutin has unleashed violence and chaos. But while he may make gains on the battlefield \u2013 he will pay a continuing high price over the long run. \nAnd a proud Ukrainian people, who have known 30 years of independence, have repeatedly shown that they will not tolerate anyone who tries to take their country backwards. \nTo all Americans, I will be honest with you, as I\u2019ve always promised. A Russian dictator, invading a foreign country, has costs around the world. \nAnd I\u2019m taking robust action to make sure the pain of our sanctions is targeted at Russia\u2019s economy. And I will use every tool at our disposal to protect American businesses and consumers. \nTonight, I can announce that the United States has worked with 30 other countries to release 60 Million barrels of oil from reserves around the world. \nAmerica will lead that effort, releasing 30 Million barrels from our own Strategic Petroleum Reserve. And we stand ready to do more if necessary, unified with our allies. \nThese steps will help blunt gas prices here at home. And I know the news about what\u2019s happening can seem alarming. \nBut I want you to know that we are going to be okay. \nWhen the history of this era is written Putin\u2019s war on Ukraine will have left Russia weaker and the rest of the world stronger. \nWhile it shouldn\u2019t have taken something so terrible for people around the world to see what\u2019s at stake now everyone sees it clearly. \nWe see the unity among leaders of nations and a more unified Europe a more unified West. And we see unity among the people who are gathering in cities in large crowds around the world even in Russia to demonstrate their support for Ukraine. \nIn the battle between democracy and autocracy, democracies are rising to the moment, and the world is clearly choosing the side of peace and security. \nThis is a real test. It\u2019s going to take time. So let us continue to draw inspiration from the iron will of the Ukrainian people. \nTo our fellow Ukrainian Americans who forge a deep bond that connects our two nations we stand with you. \nPutin may circle Kyiv with tanks, but he will never gain the hearts and souls of the Ukrainian people. \nHe will never extinguish their love of freedom. He will never weaken the resolve of the free world. \nWe meet tonight in an America that has lived through two of the hardest years this nation has ever faced. \nThe pandemic has been punishing. \nAnd so many families are living paycheck to paycheck, struggling to keep up with the rising cost of food, gas, housing, and so much more. \nI understand. \nI remember when my Dad had to leave our home in Scranton, Pennsylvania to find work. I grew up in a family where if the price of food went up, you felt it. \nThat\u2019s why one of the first things I did as President was fight to pass the American Rescue Plan. \nBecause people were hurting. We needed to act, and we did. \nFew pieces of legislation have done more in a critical moment in our history to lift us out of crisis. \nIt fueled our efforts to vaccinate the nation and combat COVID-19. It delivered immediate economic relief for tens of millions of Americans. \nHelped put food on their table, keep a roof over their heads, and cut the cost of health insurance. \nAnd as my Dad used to say, it gave people a little breathing room. \nAnd unlike the $2 Trillion tax cut passed in the previous administration that benefitted the top 1% of Americans, the American Rescue Plan helped working people\u2014and left no one behind. \nAnd it worked. It created jobs. Lots of jobs. \nIn fact\u2014our econ"}, "action_status": "started", "timestamp": 1677375736.7389438, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677375736.7394788, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Write a concise summary of the following:\n\n\n\"r economy. The Ruble has lost 30% of its value. \nThe Russian stock market has lost 40% of its value and trading remains suspended. Russia\u2019s economy is reeling and Putin alone is to blame. \nTogether with our allies we are providing support to the Ukrainians in their fight for freedom. Military assistance. Economic assistance. Humanitarian assistance. \nWe are giving more than $1 Billion in direct assistance to Ukraine. \nAnd we will continue to aid the Ukrainian people as they defend their country and to help ease their suffering. \nLet me be clear, our forces are not engaged and will not engage in conflict with Russian forces in Ukraine. \nOur forces are not going to Europe to fight in Ukraine, but to defend our NATO Allies \u2013 in the event that Putin decides to keep moving west. \nFor that purpose we\u2019ve mobilized American ground forces, air squadrons, and ship deployments to protect NATO countries including Poland, Romania, Latvia, Lithuania, and Estonia. \nAs I have made crystal clear the United States and our Allies will defend every inch of territory of NATO countries with the full force of our collective power. \nAnd we remain clear-eyed. The Ukrainians are fighting back with pure courage. But the next few days weeks, months, will be hard on them. \nPutin has unleashed violence and chaos. But while he may make gains on the battlefield \u2013 he will pay a continuing high price over the long run. \nAnd a proud Ukrainian people, who have known 30 years of independence, have repeatedly shown that they will not tolerate anyone who tries to take their country backwards. \nTo all Americans, I will be honest with you, as I\u2019ve always promised. A Russian dictator, invading a foreign country, has costs around the world. \nAnd I\u2019m taking robust action to make sure the pain of our sanctions is targeted at Russia\u2019s economy. And I will use every tool at our disposal to protect American businesses and consumers. \nTonight, I can announce that the United States has worked with 30 other countries to release 60 Million barrels of oil from reserves around the world. \nAmerica will lead that effort, releasing 30 Million barrels from our own Strategic Petroleum Reserve. And we stand ready to do more if necessary, unified with our allies. \nThese steps will help blunt gas prices here at home. And I know the news about what\u2019s happening can seem alarming. \nBut I want you to know that we are going to be okay. \nWhen the history of this era is written Putin\u2019s war on Ukraine will have left Russia weaker and the rest of the world stronger. \nWhile it shouldn\u2019t have taken something so terrible for people around the world to see what\u2019s at stake now everyone sees it clearly. \nWe see the unity among leaders of nations and a more unified Europe a more unified West. And we see unity among the people who are gathering in cities in large crowds around the world even in Russia to demonstrate their support for Ukraine. \nIn the battle between democracy and autocracy, democracies are rising to the moment, and the world is clearly choosing the side of peace and security. \nThis is a real test. It\u2019s going to take time. So let us continue to draw inspiration from the iron will of the Ukrainian people. \nTo our fellow Ukrainian Americans who forge a deep bond that connects our two nations we stand with you. \nPutin may circle Kyiv with tanks, but he will never gain the hearts and souls of the Ukrainian people. \nHe will never extinguish their love of freedom. He will never weaken the resolve of the free world. \nWe meet tonight in an America that has lived through two of the hardest years this nation has ever faced. \nThe pandemic has been punishing. \nAnd so many families are living paycheck to paycheck, struggling to keep up with the rising cost of food, gas, housing, and so much more. \nI understand. \nI remember when my Dad had to leave our home in Scranton, Pennsylvania to find work. I grew up in a family where if the price of food went up, you felt it. \nThat\u2019s why one of the first things I did as President was fight to pass the American Rescue Plan. \nBecause people were hurting. We needed to act, and we did. \nFew pieces of legislation have done more in a critical moment in our history to lift us out of crisis. \nIt fueled our efforts to vaccinate the nation and combat COVID-19. It delivered immediate economic relief for tens of millions of Americans. \nHelped put food on their table, keep a roof over their heads, and cut the cost of health insurance. \nAnd as my Dad used to say, it gave people a little breathing room. \nAnd unlike the $2 Trillion tax cut passed in the previous administration that benefitted the top 1% of Americans, the American Rescue Plan helped working people\u2014and left no one behind. \nAnd it worked. It created jobs. Lots of jobs. \nIn fact\u2014our econ\"\n\n\nCONCISE SUMMARY:", "action_status": "started", "timestamp": 1677375736.7395115, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "started", "timestamp": 1677375736.7400448, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "", "task_level": [1]} -{"input": {"text": "Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans. \nLast year COVID-19 kept us apart. This year we are finally together again. \nTonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. \nWith a duty to one another to the American people to the Constitution. \nAnd with an unwavering resolve that freedom will always triumph over tyranny. \nSix days ago, Russia\u2019s Vladimir Putin sought to shake the foundations of the free world thinking he could make it bend to his menacing ways. But he badly miscalculated. \nHe thought he could roll into Ukraine and the world would roll over. Instead he met a wall of strength he never imagined. \nHe met the Ukrainian people. \nFrom President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. \nGroups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland. \nIn this struggle as President Zelenskyy said in his speech to the European Parliament \u201cLight will win over darkness.\u201d The Ukrainian Ambassador to the United States is here tonight. \nLet each of us here tonight in this Chamber send an unmistakable signal to Ukraine and to the world. \nPlease rise if you are able and show that, Yes, we the United States of America stand with the Ukrainian people. \nThroughout our history we\u2019ve learned this lesson when dictators do not pay a price for their aggression they cause more chaos. \nThey keep moving. \nAnd the costs and the threats to America and the world keep rising. \nThat\u2019s why the NATO Alliance was created to secure peace and stability in Europe after World War 2. \nThe United States is a member along with 29 other nations. \nIt matters. American diplomacy matters. American resolve matters. \nPutin\u2019s latest attack on Ukraine was premeditated and unprovoked. \nHe rejected repeated efforts at diplomacy. \nHe thought the West and NATO wouldn\u2019t respond. And he thought he could divide us at home. Putin was wrong. We were ready. Here is what we did. \nWe prepared extensively and carefully. \nWe spent months building a coalition of other freedom-loving nations from Europe and the Americas to Asia and Africa to confront Putin. \nI spent countless hours unifying our European allies. We shared with the world in advance what we knew Putin was planning and precisely how he would try to falsely justify his aggression. \nWe countered Russia\u2019s lies with truth. \nAnd now that he has acted the free world is holding him accountable. \nAlong with twenty-seven members of the European Union including France, Germany, Italy, as well as countries like the United Kingdom, Canada, Japan, Korea, Australia, New Zealand, and many others, even Switzerland. \nWe are inflicting pain on Russia and supporting the people of Ukraine. Putin is now isolated from the world more than ever. \nTogether with our allies \u2013we are right now enforcing powerful economic sanctions. \nWe are cutting off Russia\u2019s largest banks from the international financial system. \nPreventing Russia\u2019s central bank from defending the Russian Ruble making Putin\u2019s $630 Billion \u201cwar fund\u201d worthless. \nWe are choking off Russia\u2019s access to technology that will sap its economic strength and weaken its military for years to come. \nTonight I say to the Russian oligarchs and corrupt leaders who have bilked billions of dollars off this violent regime no more. \nThe U.S. Department of Justice is assembling a dedicated task force to go after the crimes of Russian oligarchs. \nWe are joining with our European allies to find and seize your yachts your luxury apartments your private jets. We are coming for your ill-begotten gains. \nAnd tonight I am announcing that we will join our allies in closing off American air space to all Russian flights \u2013 further isolating Russia \u2013 and adding an additional squeeze \u2013on their economy. The Ruble has lost 30% of its value. \nThe Russian stock market has lost 40% of its value and trading remains suspended. Russia\u2019s economy is reeling and Putin alone is to blame. \nTogether with our allies we are providing support to the Ukrainians in their fight for freedom. Military assistance. Economic assistance. Humanitarian assistance. \nWe are giving more than $1 Billion in direct assistance to Ukraine. \nAnd we will continue to aid the Ukrainian people as they defend their country and to help ease their suffering. \nLet me be clear, our forces are not engaged and will not engage in conflict with Russian forces in Ukraine. \nOur forces are not going to Europe to fight in Ukraine, but to defend our NATO Allies \u2013 in the event that Putin decides to keep moving west. \nFor that pu"}, "action_status": "started", "timestamp": 1677375736.7401567, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677375736.7406764, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Write a concise summary of the following:\n\n\n\"Madam Speaker, Madam Vice President, our First Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans. \nLast year COVID-19 kept us apart. This year we are finally together again. \nTonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. \nWith a duty to one another to the American people to the Constitution. \nAnd with an unwavering resolve that freedom will always triumph over tyranny. \nSix days ago, Russia\u2019s Vladimir Putin sought to shake the foundations of the free world thinking he could make it bend to his menacing ways. But he badly miscalculated. \nHe thought he could roll into Ukraine and the world would roll over. Instead he met a wall of strength he never imagined. \nHe met the Ukrainian people. \nFrom President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. \nGroups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland. \nIn this struggle as President Zelenskyy said in his speech to the European Parliament \u201cLight will win over darkness.\u201d The Ukrainian Ambassador to the United States is here tonight. \nLet each of us here tonight in this Chamber send an unmistakable signal to Ukraine and to the world. \nPlease rise if you are able and show that, Yes, we the United States of America stand with the Ukrainian people. \nThroughout our history we\u2019ve learned this lesson when dictators do not pay a price for their aggression they cause more chaos. \nThey keep moving. \nAnd the costs and the threats to America and the world keep rising. \nThat\u2019s why the NATO Alliance was created to secure peace and stability in Europe after World War 2. \nThe United States is a member along with 29 other nations. \nIt matters. American diplomacy matters. American resolve matters. \nPutin\u2019s latest attack on Ukraine was premeditated and unprovoked. \nHe rejected repeated efforts at diplomacy. \nHe thought the West and NATO wouldn\u2019t respond. And he thought he could divide us at home. Putin was wrong. We were ready. Here is what we did. \nWe prepared extensively and carefully. \nWe spent months building a coalition of other freedom-loving nations from Europe and the Americas to Asia and Africa to confront Putin. \nI spent countless hours unifying our European allies. We shared with the world in advance what we knew Putin was planning and precisely how he would try to falsely justify his aggression. \nWe countered Russia\u2019s lies with truth. \nAnd now that he has acted the free world is holding him accountable. \nAlong with twenty-seven members of the European Union including France, Germany, Italy, as well as countries like the United Kingdom, Canada, Japan, Korea, Australia, New Zealand, and many others, even Switzerland. \nWe are inflicting pain on Russia and supporting the people of Ukraine. Putin is now isolated from the world more than ever. \nTogether with our allies \u2013we are right now enforcing powerful economic sanctions. \nWe are cutting off Russia\u2019s largest banks from the international financial system. \nPreventing Russia\u2019s central bank from defending the Russian Ruble making Putin\u2019s $630 Billion \u201cwar fund\u201d worthless. \nWe are choking off Russia\u2019s access to technology that will sap its economic strength and weaken its military for years to come. \nTonight I say to the Russian oligarchs and corrupt leaders who have bilked billions of dollars off this violent regime no more. \nThe U.S. Department of Justice is assembling a dedicated task force to go after the crimes of Russian oligarchs. \nWe are joining with our European allies to find and seize your yachts your luxury apartments your private jets. We are coming for your ill-begotten gains. \nAnd tonight I am announcing that we will join our allies in closing off American air space to all Russian flights \u2013 further isolating Russia \u2013 and adding an additional squeeze \u2013on their economy. The Ruble has lost 30% of its value. \nThe Russian stock market has lost 40% of its value and trading remains suspended. Russia\u2019s economy is reeling and Putin alone is to blame. \nTogether with our allies we are providing support to the Ukrainians in their fight for freedom. Military assistance. Economic assistance. Humanitarian assistance. \nWe are giving more than $1 Billion in direct assistance to Ukraine. \nAnd we will continue to aid the Ukrainian people as they defend their country and to help ease their suffering. \nLet me be clear, our forces are not engaged and will not engage in conflict with Russian forces in Ukraine. \nOur forces are not going to Europe to fight in Ukraine, but to defend our NATO Allies \u2013 in the event that Putin decides to keep moving west. \nFor that pu\"\n\n\nCONCISE SUMMARY:", "action_status": "started", "timestamp": 1677375736.7407105, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677375740.7172883, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Prompted", "task_level": [3, 2]} -{"result": " In response to Russian President Putin's invasion of Ukraine, the US and its allies are providing military, economic, and humanitarian assistance to the Ukrainians. The US is also leading an effort to release 60 million barrels of oil from reserves around the world, including 30 million from the US Strategic Petroleum Reserve, to help blunt gas prices. The US President has also passed the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs.", "action_status": "started", "timestamp": 1677375740.7174945, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677375740.717625, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677375740.717653, "task_uuid": "6174bdb9-8e7d-4859-9c91-d36235b2ad41", "action_type": "", "task_level": [5]} -{"action_status": "succeeded", "timestamp": 1677375741.249878, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Prompted", "task_level": [3, 2]} -{"result": " President Biden fought to pass the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs. He also passed the Bipartisan Infrastructure Law to rebuild America and the Bipartisan Innovation Act to level the playing field with China and other competitors. An example of this is Intel's $20 billion semiconductor \"mega site\" in Ohio, which will create 10,000 new jobs.", "action_status": "started", "timestamp": 1677375741.2500997, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677375741.2502933, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677375741.2503877, "task_uuid": "2d2df820-8a1d-4db7-80ae-c54638c6a067", "action_type": "", "task_level": [5]} -{"action_status": "succeeded", "timestamp": 1677375742.9876738, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Prompted", "task_level": [3, 2]} -{"result": " In this speech, the speaker addresses the American people and the world, emphasizing the strength of the Ukrainian people in the face of Russia's aggression. The speaker also announces that the US and its allies are imposing economic sanctions on Russia, and providing military, economic, and humanitarian assistance to Ukraine. The US is also joining its allies in closing off American airspace to all Russian flights, and the Department of Justice is assembling a task force to go after the crimes of Russian oligarchs. The speaker also clarifies that US forces are not engaging in conflict with Russian forces in Ukraine, but are there to defend NATO allies.", "action_status": "started", "timestamp": 1677375742.987888, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677375742.9880133, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677375742.9881, "task_uuid": "dff81dcf-2073-4ba4-8856-d0f82c213311", "action_type": "", "task_level": [5]} -{"action_status": "succeeded", "timestamp": 1677375743.49151, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Prompted", "task_level": [3, 2]} -{"result": " The Bipartisan Innovation Act is an important bill that is currently sitting in Congress. It will make record investments in emerging technologies and American manufacturing, such as Intel's $20 billion semiconductor \"mega site\" in Ohio. This bill will create 10,000 new jobs and increase Intel's investment to $100 billion. Other companies, such as Ford and GM, are also investing in American manufacturing, creating 369,000 new jobs in the last year. President Biden's plan to fight inflation is to lower costs, not wages, by increasing the productive capacity of the economy. This includes capping the cost of insulin at $35 a month and allowing Medicare to negotiate lower prices for prescription drugs.", "action_status": "started", "timestamp": 1677375743.4917376, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677375743.4918683, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677375743.4919584, "task_uuid": "2039cff8-944d-4daf-91e1-a78747fce7c0", "action_type": "", "task_level": [5]} -{"action_status": "started", "timestamp": 1677375743.4930956, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "", "task_level": [1]} -{"input": {"text": " In this speech, the speaker addresses the American people and the world, emphasizing the strength of the Ukrainian people in the face of Russia's aggression. The speaker also announces that the US and its allies are imposing economic sanctions on Russia, and providing military, economic, and humanitarian assistance to Ukraine. The US is also joining its allies in closing off American airspace to all Russian flights, and the Department of Justice is assembling a task force to go after the crimes of Russian oligarchs. The speaker also clarifies that US forces are not engaging in conflict with Russian forces in Ukraine, but are there to defend NATO allies.\n In response to Russian President Putin's invasion of Ukraine, the US and its allies are providing military, economic, and humanitarian assistance to the Ukrainians. The US is also leading an effort to release 60 million barrels of oil from reserves around the world, including 30 million from the US Strategic Petroleum Reserve, to help blunt gas prices. The US President has also passed the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs.\n President Biden fought to pass the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs. He also passed the Bipartisan Infrastructure Law to rebuild America and the Bipartisan Innovation Act to level the playing field with China and other competitors. An example of this is Intel's $20 billion semiconductor \"mega site\" in Ohio, which will create 10,000 new jobs.\n The Bipartisan Innovation Act is an important bill that is currently sitting in Congress. It will make record investments in emerging technologies and American manufacturing, such as Intel's $20 billion semiconductor \"mega site\" in Ohio. This bill will create 10,000 new jobs and increase Intel's investment to $100 billion. Other companies, such as Ford and GM, are also investing in American manufacturing, creating 369,000 new jobs in the last year. President Biden's plan to fight inflation is to lower costs, not wages, by increasing the productive capacity of the economy. This includes capping the cost of insulin at $35 a month and allowing Medicare to negotiate lower prices for prescription drugs."}, "action_status": "started", "timestamp": 1677375743.4931505, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Input Function", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1677375743.4941087, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Input Function", "task_level": [2, 2]} -{"prompt": "Write a concise summary of the following:\n\n\n\" In this speech, the speaker addresses the American people and the world, emphasizing the strength of the Ukrainian people in the face of Russia's aggression. The speaker also announces that the US and its allies are imposing economic sanctions on Russia, and providing military, economic, and humanitarian assistance to Ukraine. The US is also joining its allies in closing off American airspace to all Russian flights, and the Department of Justice is assembling a task force to go after the crimes of Russian oligarchs. The speaker also clarifies that US forces are not engaging in conflict with Russian forces in Ukraine, but are there to defend NATO allies.\n In response to Russian President Putin's invasion of Ukraine, the US and its allies are providing military, economic, and humanitarian assistance to the Ukrainians. The US is also leading an effort to release 60 million barrels of oil from reserves around the world, including 30 million from the US Strategic Petroleum Reserve, to help blunt gas prices. The US President has also passed the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs.\n President Biden fought to pass the American Rescue Plan to provide economic relief to tens of millions of Americans and create jobs. He also passed the Bipartisan Infrastructure Law to rebuild America and the Bipartisan Innovation Act to level the playing field with China and other competitors. An example of this is Intel's $20 billion semiconductor \"mega site\" in Ohio, which will create 10,000 new jobs.\n The Bipartisan Innovation Act is an important bill that is currently sitting in Congress. It will make record investments in emerging technologies and American manufacturing, such as Intel's $20 billion semiconductor \"mega site\" in Ohio. This bill will create 10,000 new jobs and increase Intel's investment to $100 billion. Other companies, such as Ford and GM, are also investing in American manufacturing, creating 369,000 new jobs in the last year. President Biden's plan to fight inflation is to lower costs, not wages, by increasing the productive capacity of the economy. This includes capping the cost of insulin at $35 a month and allowing Medicare to negotiate lower prices for prescription drugs.\"\n\n\nCONCISE SUMMARY:", "action_status": "started", "timestamp": 1677375743.4941628, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Prompted", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1677375749.3224697, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Prompted", "task_level": [3, 2]} -{"result": " In response to Russia's aggression in Ukraine, President Biden has taken action to provide military, economic, and humanitarian assistance to Ukraine, impose economic sanctions on Russia, and close off American airspace to Russian flights. He has also passed the American Rescue Plan to provide economic relief to Americans and the Bipartisan Innovation Act to level the playing field with China and other competitors. This bill will create 10,000 new jobs and increase Intel's investment to $100 billion. President Biden is also fighting inflation by capping the cost of insulin at $35 a month and allowing Medicare to negotiate lower prices for prescription drugs.", "action_status": "started", "timestamp": 1677375749.322677, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Result", "task_level": [4, 1]} -{"action_status": "succeeded", "timestamp": 1677375749.3227925, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "Result", "task_level": [4, 2]} -{"action_status": "succeeded", "timestamp": 1677375749.32287, "task_uuid": "a2de8aab-500a-4df0-8764-3b3c091db0b9", "action_type": "", "task_level": [5]} -{"action_status": "succeeded", "timestamp": 1677375749.3230808, "task_uuid": "b77ccab5-cdad-4436-a3e1-230da294a528", "action_type": "summary", "task_level": [2]} diff --git a/summary.py~ b/summary.py~ deleted file mode 100644 index 8552b628663c37d03d2ac58df0e691ba2b2e1b02..0000000000000000000000000000000000000000 --- a/summary.py~ +++ /dev/null @@ -1,16 +0,0 @@ -from typing import List -from minichain import Backend, JinjaPrompt, Prompt, start_chain - - - -# Prompt that asks LLM to produce a bash command. - -class SummaryPrompt(JinjaPrompt[List[str]]): - template_file = "summary.pmpt.tpl" - def parse(self, result: str) -> List[str]: - assert result.startswith("```bash") - return result.split("\n")[1:-1] - -CLIPrompt().show( - {"question": "list the files in the directory"}, - """```bash\nls\n```""") diff --git a/table.py b/table.py index 9030cbd9b94bb461d51a594717b5c9da980294b4..adeec24664dda620fce6fd1a49e1c8536b23db0d 100644 --- a/table.py +++ b/table.py @@ -56,7 +56,7 @@ for i in range(few_shot_examples): def make_html(out): return "
" + out.replace("\t", "").replace("\n", "
") + "
" -@prompt(OpenAI(), template_file="table.pmpt.txt", +@prompt(OpenAI("gpt-4"), template_file="table.pmpt.txt", gradio_conf=GradioConf(block_output=gr.HTML, postprocess_output = make_html) ) diff --git a/table.py~ b/table.py~ deleted file mode 100644 index f12652f1d221b3531eec1cb7c282414410215d17..0000000000000000000000000000000000000000 --- a/table.py~ +++ /dev/null @@ -1,76 +0,0 @@ -# + tags=["hide_inp"] -desc = """ -### Table - -""" -# - - -# $ -import pandas as pd -from minichain import prompt, Mock, show, OpenAIStream -import minichain - -rotowire = json.load(open("data.json")) -names = { - '3-pointer percentage': 'FG3_PCT', - '3-pointers attempted': 'FG3A', - '3-pointers made': 'FG3M', - 'Assists': 'AST', - 'Blocks': 'BLK', - 'Field goal percentage': 'FG_PCT', - 'Field goals attempted': 'FGA', - 'Field goals made': 'FGM', - 'Free throw percentage': 'FT_PCT', - 'Free throws attempted': 'FTA', - 'Free throws made': 'FTM', - 'Minutes played': 'MIN', - 'Personal fouls': 'PF', - 'Points': 'PTS', - 'Rebounds': 'REB', - 'Rebounds (Defensive)': 'DREB', - 'Rebounds (Offensive)': 'OREB', - 'Steals': 'STL', - 'Turnovers': 'TO' -} -# Convert an example to dataframe -def to_df(d): - players = {player for v in d.values() if v is not None for player, _ in v.items()} - lookup = {k: {a: b for a, b in v.items()} for k,v in d.items()} - rows = [{"player": p} | {k: "_" if p not in lookup.get(k, []) else lookup[k][p] for k in names.keys()} - for p in players] - return pd.DataFrame.from_dict(rows).astype("str").sort_values(axis=0, by="player", ignore_index=True).transpose() - - -# Make few shot examples -few_shot_examples = 2 -examples = [] -for i in range(few_shot_examples): - examples.append({"input": rotowire[i][1], - "output": to_df(rotowire[i][0][1]).transpose().set_index("player").to_csv(sep="\t")}) - -@prompt(OpenAIStream(), template_file="table.pmpt.txt", stream=True) -def extract(model, passage, typ): - state = [] - out = "" - for token in model(dict(player_keys=names.items(), examples=examples, passage=passage, type=typ)): - out += token - html = "
" + out.replace("\t", "").replace("\n", "
") + "
" - yield html - yield html - - - -def run(query): - return extract(query) - -# $ - -gradio = show(run, - gr.Examples([rotowire[i][1] for i in range(50, 55)], inputs=[passage]) - subprompts=[prompt_generation, prompt_validation], - code=open("table.py", "r").read().split("$")[1].strip().strip("#").strip(), - out_type="markdown" - ) - -if __name__ == "__main__": - gradio.queue().launch() diff --git a/temp b/temp deleted file mode 100644 index d888a084ca1637147c89475d6a1acb839a607796..0000000000000000000000000000000000000000 Binary files a/temp and /dev/null differ diff --git a/temp.ipynb b/temp.ipynb deleted file mode 100644 index bcc4a71878cab353a13ae4eb644921dfd4d58f80..0000000000000000000000000000000000000000 --- a/temp.ipynb +++ /dev/null @@ -1,186 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "7fd6623a", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a21a1e9e", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "import minichain\n", - "from dataclasses import fields, dataclass, is_dataclass\n", - "from typing import List\n", - "from enum import Enum" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fb3ef48a", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "class ColorType(Enum):\n", - " RED = 1\n", - " GREEN = 2\n", - " BLUE = 3" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cf56319f", - "metadata": {}, - "outputs": [], - "source": [ - "@dataclass\n", - "class Color:\n", - " color: ColorType\n", - " object: str\n", - " explanation: str" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0d9cbb08", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "37172e82", - "metadata": {}, - "source": [ - "class StatType(Enum):\n", - " POINTS = 1\n", - " REBOUNDS = 2\n", - " ASSISTS = 3" - ] - }, - { - "cell_type": "markdown", - "id": "6e7d33f8", - "metadata": {}, - "source": [ - "@dataclass\n", - "class Stat:\n", - " value: int\n", - " stat: StatType" - ] - }, - { - "cell_type": "markdown", - "id": "06fc9f84", - "metadata": {}, - "source": [ - "@dataclass\n", - "class Player:\n", - " player: str\n", - " stats: List[Stat]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "93ad4d35", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "class T(minichain.TypedTemplatePrompt):\n", - " template_file = \"stats.pmpt.tpl\"\n", - " Out = Color" - ] - }, - { - "cell_type": "markdown", - "id": "94b98c00", - "metadata": {}, - "source": [ - "print(T().show({\"passage\": \"hello\"}, '[{\"player\": \"Harden\", \"stats\": {\"value\": 10, \"stat\": 2}}]'))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f40d0cf2", - "metadata": {}, - "outputs": [], - "source": [ - "with minichain.start_chain(\"stats\") as backend:\n", - " p = T(backend.OpenAI(max_tokens=512))\n", - " print(p({\"passage\": open(\"sixers.txt\").read()}))" - ] - }, - { - "cell_type": "markdown", - "id": "0870b752", - "metadata": { - "lines_to_next_cell": 2 - }, - "source": [ - "def enum(x):\n", - " d = {e.name: e.value for e in x}\n", - " # d[\"__enum__\"] = True\n", - " return d" - ] - }, - { - "cell_type": "markdown", - "id": "75aeafef", - "metadata": {}, - "source": [ - "def walk(x):\n", - " print(x)\n", - " if issubclass(x, Enum):\n", - " return enum(x)\n", - " if is_dataclass(x):\n", - " return {y.name: walk(y.type) for y in fields(x)}\n", - " return x.__name__\n", - " # return [x for x in fields(B)]\n", - " # print(x.name)\n", - " # print(x.type)\n", - " # if issubclass(x.type, Enum):\n", - " # for e in x.type:\n", - " # print(e.value)\n", - " # print(e.name)\n", - " # print(x)]" - ] - }, - { - "cell_type": "markdown", - "id": "adc65d98", - "metadata": {}, - "source": [ - "print(walk(B))" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/temp.log b/temp.log index 145f4f3efdb827860427195594a80e86489c6959..98623884cdd69808c8bce4d2f90ab99aa9b074d4 100644 --- a/temp.log +++ b/temp.log @@ -1 +1,2 @@ -{"action_status": "started", "timestamp": 1681852847.4337213, "task_uuid": "36dd44bc-d7c9-4464-a951-4f98722ba739", "action_type": "temp", "task_level": [1]} +{"action_status":"started","timestamp":1701031321.6840615,"task_uuid":"05da71b6-b7da-428a-8732-5b5a51620524","action_type":"temp","task_level":[1]} +{"action_status":"succeeded","timestamp":1701031322.2424853,"task_uuid":"05da71b6-b7da-428a-8732-5b5a51620524","action_type":"temp","task_level":[2]} diff --git a/temp.py b/temp.py deleted file mode 100644 index ff758853aa8c05f62b7037c1946e62bca7fa5642..0000000000000000000000000000000000000000 --- a/temp.py +++ /dev/null @@ -1,66 +0,0 @@ -import minichain -from dataclasses import fields, dataclass, is_dataclass -from typing import List -from enum import Enum - -class ColorType(Enum): - RED = 1 - GREEN = 2 - BLUE = 3 - -@dataclass -class Color: - color: ColorType - object: str - explanation: str - - - -# class StatType(Enum): -# POINTS = 1 -# REBOUNDS = 2 -# ASSISTS = 3 - -# @dataclass -# class Stat: -# value: int -# stat: StatType - -# @dataclass -# class Player: -# player: str -# stats: List[Stat] - -class T(minichain.TypedTemplatePrompt): - template_file = "stats.pmpt.tpl" - Out = Color - -# print(T().show({"passage": "hello"}, '[{"player": "Harden", "stats": {"value": 10, "stat": 2}}]')) - -with minichain.start_chain("stats") as backend: - p = T(backend.OpenAI(max_tokens=512)) - print(p({"passage": open("sixers.txt").read()})) - -# def enum(x): -# d = {e.name: e.value for e in x} -# # d["__enum__"] = True -# return d - - -# def walk(x): -# print(x) -# if issubclass(x, Enum): -# return enum(x) -# if is_dataclass(x): -# return {y.name: walk(y.type) for y in fields(x)} -# return x.__name__ -# # return [x for x in fields(B)] -# # print(x.name) -# # print(x.type) -# # if issubclass(x.type, Enum): -# # for e in x.type: -# # print(e.value) -# # print(e.name) -# # print(x)] - -# print(walk(B)) diff --git a/temp.py~ b/temp.py~ deleted file mode 100644 index 84d33e227d57e5bd0c36ea066f69885ab106dcb4..0000000000000000000000000000000000000000 --- a/temp.py~ +++ /dev/null @@ -1,6 +0,0 @@ -from dataclasses import fields, dataclass - -@dataclass -class B: - a: int - b: str diff --git a/test b/test deleted file mode 100644 index ca25fa716f26ab120aa00253969b36a42cc4c03c..0000000000000000000000000000000000000000 Binary files a/test and /dev/null differ diff --git a/test.ipynb b/test.ipynb deleted file mode 100644 index 8f23cdaffa35318fcba8f67b4d2d2f9930c1511f..0000000000000000000000000000000000000000 --- a/test.ipynb +++ /dev/null @@ -1,102 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "6421765c", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install -q git+https://github.com/srush/MiniChain\n", - "!git clone https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0f477ab9", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "from minichain import prompt, Mock, show\n", - "import minichain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e216e2c9", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "@prompt(Mock([\"red\", \"blue\"]))\n", - "def prompt_function1(model, x):\n", - " return model(x)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0fb645c4", - "metadata": { - "lines_to_next_cell": 1 - }, - "outputs": [], - "source": [ - "@prompt(Mock([\"b\"]), template_file=\"test.pmpt.tpl\")\n", - "def prompt_function2(model, x):\n", - " if x == \"red\":\n", - " return model.fail(1)\n", - " return model(dict(x=x))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fe555cf0", - "metadata": {}, - "outputs": [], - "source": [ - "def run(query):\n", - " x = prompt_function1(query)\n", - " return prompt_function2(prompt_function2(x))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "04f06977", - "metadata": {}, - "outputs": [], - "source": [ - "demo = show(run,\n", - " examples=[\"a\"],\n", - " subprompts=[prompt_function1, prompt_function2, prompt_function2])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e1b48e0f", - "metadata": {}, - "outputs": [], - "source": [ - "if __name__ == \"__main__\":\n", - " demo.launch()" - ] - } - ], - "metadata": { - "jupytext": { - "cell_metadata_filter": "-all", - "main_language": "python", - "notebook_metadata_filter": "-all" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/test.log b/test.log deleted file mode 100644 index 17f78e0be26eecb3baa07fb55e55a3aca5f4ab2e..0000000000000000000000000000000000000000 --- a/test.log +++ /dev/null @@ -1,14 +0,0 @@ -{"action_status": "started", "timestamp": 1679500877.6194744, "task_uuid": "11976481-763e-4847-94c2-142c65608e13", "action_type": "test", "task_level": [1]} -{"action_status": "started", "timestamp": 1679500877.6206672, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "", "task_level": [1]} -{"prompt": "#### Question:\n\n* What is 37593 * 67?\n\n#### Code:\n\n```python\nprint(37593 * 67)\n```\n\n#### Question:\n\n* Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\n\n#### Code:\n\n```python\nprint((16-3-4)*2)\n```\n\n#### Question:\n\n* How many of the integers between 0 and 99 inclusive are divisible by 8?\n\n#### Code:\n\n```python\ncount = 0\nfor i in range(0, 99+1):\n if i % 8 == 0: count += 1\nprint(count)\n```\n\n#### Question:\n\n* A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\n\n#### Code:\n\n```python\nprint(2 + 2/2)\n```\n\n#### Question:\n\n* What is the sum of the powers of 3 (3^i) that are smaller than 100?\n\n#### Code:", "action_status": "started", "timestamp": 1679500877.6207328, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "Prompted", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1679500877.6600158, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "Prompted", "task_level": [2, 2]} -{"result": "```python\ntotal = 0\nfor i in range(1, 100):\n if 3**i < 100:\n total += 3**i\nprint(total)\n```", "action_status": "started", "timestamp": 1679500877.6601174, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "Response", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1679500877.6601753, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "Response", "task_level": [3, 2]} -{"action_status": "succeeded", "timestamp": 1679500877.6602166, "task_uuid": "e158df54-9a51-4087-ad85-9af5a8b98a6c", "action_type": "", "task_level": [4]} -{"action_status": "started", "timestamp": 1679500877.6603165, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "", "task_level": [1]} -{"prompt": "```python\ntotal = 0\nfor i in range(1, 100):\n if 3**i < 100:\n total += 3**i\nprint(total)\n```", "action_status": "started", "timestamp": 1679500877.6605005, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "Prompted", "task_level": [2, 1]} -{"action_status": "succeeded", "timestamp": 1679500877.660738, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "Prompted", "task_level": [2, 2]} -{"result": "120\n", "action_status": "started", "timestamp": 1679500877.6607795, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "Response", "task_level": [3, 1]} -{"action_status": "succeeded", "timestamp": 1679500877.6608076, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "Response", "task_level": [3, 2]} -{"action_status": "succeeded", "timestamp": 1679500877.6608305, "task_uuid": "d417ec4b-3b25-4f33-a8b4-b3e5025652af", "action_type": "", "task_level": [4]} -{"action_status": "succeeded", "timestamp": 1679500877.6608603, "task_uuid": "11976481-763e-4847-94c2-142c65608e13", "action_type": "test", "task_level": [2]} diff --git a/test.pmpt.tpl b/test.pmpt.tpl index a2a430ab2027d9885e064adb21de20218e365cbf..8f458ccc5b8e2a53b62539a0dd63f7c761586a93 100644 --- a/test.pmpt.tpl +++ b/test.pmpt.tpl @@ -1 +1,3 @@ -Hello there! {{x}} \ No newline at end of file +This is a simple test prompt. + +{{query}} \ No newline at end of file diff --git a/test.py b/test.py index 56fac4855a517e84c30842ea8db0ae8537509884..ebb1e2f5ad71a5a7608287fffc14a606a089c0fa 100644 --- a/test.py +++ b/test.py @@ -1,24 +1,35 @@ -from minichain import prompt, Mock, show import minichain -@prompt(Mock(["red", "blue"])) -def prompt_function1(model, x): - return model(x) - -@prompt(Mock(["b"]), template_file="test.pmpt.tpl") -def prompt_function2(model, x): - if x == "red": - return model.fail(1) - return model(dict(x=x)) +class CLIPrompt(minichain.TemplatePrompt): + template_file = "test.pmpt.tpl" -def run(query): - x = prompt_function1(query) - return prompt_function2(prompt_function2(x)) + def parse(self, out: str, inp): + out = out.strip() + assert out.startswith("```bash") + return out.split("\n")[1:-1] + + +# Prompt that runs the bash command. + + +class BashPrompt(minichain.Prompt): + def prompt(self, inp) -> str: + return ";".join(inp).replace("\n", "") + + def parse(self, out: str, inp) -> str: + return out + +# Generate and run bash command. +with minichain.start_chain("bash") as backend: + question = ( + '"go up one directory, and then into the minichain directory,' + 'and list the files in the directory"' + ) + prompt = CLIPrompt(backend.Mock(["```bash\nxxx\n```"])) + prompt = prompt.chain(BashPrompt(backend.Mock(["yyy"]))) + # result = prompt({"question": question}) # + # print(result) -demo = show(run, - examples=["a"], - subprompts=[prompt_function1, prompt_function2, prompt_function2]) -if __name__ == "__main__": - demo.launch() +prompt.to_gradio().launch() diff --git a/test.py~ b/test.py~ deleted file mode 100644 index 5fa51467efe4f12fb081d91bc2064f2b187f6a2f..0000000000000000000000000000000000000000 --- a/test.py~ +++ /dev/null @@ -1,8 +0,0 @@ - -import minichain -with minichain.start_chain("test") as backend: - p1 = minichain.Prompt(backend.Mock(["hello"])) - p2 = minichain.Prompt(backend.Mock(["goodbye"])) - prompt = p1.chain(p2) - -minichain.show(prompt) diff --git a/test2.ipynb b/test2.ipynb deleted file mode 100644 index aaf41d12975b2ef651710bca532352ea7bca1d3a..0000000000000000000000000000000000000000 --- a/test2.ipynb +++ /dev/null @@ -1,91 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "b48c8513", - "metadata": {}, - "outputs": [], - "source": [ - "from minichain import prompt, Mock, show\n", - "import minichain\n", - "\n", - "@prompt(Mock([\"hello\"]))\n", - "def prompt_function1(model, x):\n", - " return model(x)\n", - "\n", - "@prompt(Mock([\"b\"]), template_file=\"test.pmpt.tpl\")\n", - "def prompt_function2(model, x):\n", - " return model(dict(x=x))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "f98856ac", - "metadata": {}, - "outputs": [], - "source": [ - "def run(query):\n", - " x = prompt_function1(query)\n", - " return prompt_function2(prompt_function2(x))\n", - "\n", - "\n", - "demo = show(run,\n", - " examples=[\"a\"],\n", - " subprompts=[prompt_function1, prompt_function2, prompt_function2])\n" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "b7522022", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Running on local URL: http://127.0.0.1:7861\n" - ] - }, - { - "data": { - "text/html": [ - "
" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "x = demo.launch(quiet=True)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "minichain", - "language": "python", - "name": "minichain" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/tmp.tpl~ b/tmp.tpl~ deleted file mode 100644 index 57600b18e7a43de8fcb0bd6a14c0ed882e951cd1..0000000000000000000000000000000000000000 --- a/tmp.tpl~ +++ /dev/null @@ -1 +0,0 @@ -{{typ}} \ No newline at end of file