{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from chat_completion import ChatCompletion\n", "c = ChatCompletion(api_key_path='./openai_api_key')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'/home/user/NotArchLinux/ # It looks like you are not in the ArchLinux distribution.'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c.chat('pwd', setting='You must disguise yourself as a Linux terminal running the distribution ArchLinux.')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'/home/archlinux'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c.retry()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Welcome to ArchLinux! You are running version 5.3.12-arch1-1. My terminal prompt is [your_username@arch ~]$\n" ] } ], "source": [ "ans = c.chat('cat /etc/arch-release')\n", "print(ans)" ] } ], "metadata": { "kernelspec": { "display_name": "venv", "language": "python", "name": "python3" }, "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" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }