From dffa8a8742d30686474400d3f52370247a42eb54 Mon Sep 17 00:00:00 2001 From: eren23 Date: Fri, 14 Apr 2023 21:06:40 +0300 Subject: [PATCH] example --- examples/basic_agent_example.ipynb | 646 +++++++++++++++++++++++++++++ 1 file changed, 646 insertions(+) create mode 100644 examples/basic_agent_example.ipynb diff --git a/examples/basic_agent_example.ipynb b/examples/basic_agent_example.ipynb new file mode 100644 index 0000000..e499799 --- /dev/null +++ b/examples/basic_agent_example.ipynb @@ -0,0 +1,646 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# !python3 -m spacy download en_core_web_sm" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/eren/opt/anaconda3/envs/knowledgegpt-env/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", + " from .autonotebook import tqdm as notebook_tqdm\n", + "/Users/eren/opt/anaconda3/envs/knowledgegpt-env/lib/python3.9/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\n", + " warn(\"Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\", RuntimeWarning)\n" + ] + } + ], + "source": [ + "from knowledgegpt.extractors.base_agent import BaseAgent\n", + "from knowledgegpt.utils.utils_scrape import scrape_content" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import openai\n", + "from example_config import SECRET_KEY, HF_TOKEN\n", + "openai.api_key = SECRET_KEY" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "from bs4 import BeautifulSoup\n", + "\n", + "query = 'Baroque Painting'\n", + "endpoint = 'https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch={}&utf8='.format(query)\n", + "\n", + "response = requests.get(endpoint).json()\n", + "\n", + "search_results = response['query']['search']\n", + "\n", + "titles = [result['title'] for result in search_results]\n", + "links = ['https://en.wikipedia.org/wiki/{}'.format(result['title'].replace(' ', '_')) for result in search_results]\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['https://en.wikipedia.org/wiki/Unazukin',\n", + " 'https://en.wikipedia.org/wiki/Pop_art',\n", + " 'https://en.wikipedia.org/wiki/Pet_Shop_Boys',\n", + " 'https://en.wikipedia.org/wiki/Rata_Blanca',\n", + " 'https://en.wikipedia.org/wiki/Eddy_Wally',\n", + " 'https://en.wikipedia.org/wiki/Numb_(Pet_Shop_Boys_song)',\n", + " 'https://en.wikipedia.org/wiki/Fundamental_(Pet_Shop_Boys_album)',\n", + " 'https://en.wikipedia.org/wiki/Behaviour_(Pet_Shop_Boys_album)',\n", + " 'https://en.wikipedia.org/wiki/Paninaro_(song)',\n", + " 'https://en.wikipedia.org/wiki/Dev_Benegal']" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "links" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "\n", + "df_all = pd.DataFrame()\n", + "\n", + "for link in links:\n", + " df = scrape_content(link)\n", + " df_all = pd.concat([df_all, df])\n", + "\n", + "df_all = df_all.reset_index()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "df_all.drop(columns=['index'], inplace=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
content
0Baroque painting - Wikipedia
1Jump to content
2Main menu
3Main menu\\nmove to sidebar\\nhide
4Navigation
......
1121Last edited on 14 March 2023, at 09:46
1122Languages
1123العربيةБеларускаяБеларуская (тарашкевіца)Бълга...
1124This page was last edited on 14 March 2023, at...
1125Privacy policy\\nAbout Wikipedia\\nDisclaimers\\n...
\n", + "

1126 rows × 1 columns

\n", + "
" + ], + "text/plain": [ + " content\n", + "0 Baroque painting - Wikipedia\n", + "1 Jump to content\n", + "2 Main menu\n", + "3 Main menu\\nmove to sidebar\\nhide\n", + "4 Navigation\n", + "... ...\n", + "1121 Last edited on 14 March 2023, at 09:46\n", + "1122 Languages\n", + "1123 العربيةБеларускаяБеларуская (тарашкевіца)Бълга...\n", + "1124 This page was last edited on 14 March 2023, at...\n", + "1125 Privacy policy\\nAbout Wikipedia\\nDisclaimers\\n...\n", + "\n", + "[1126 rows x 1 columns]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_all" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "examples = [\n", + " \"Forest wanderer, painterly style, flat colours, illustration, bright and colourful, high contrast, Mythology, cinematic, detailed, atmospheric, 8k, corona render.\",\n", + " \"Pixel collage painting of the last supper, feasting over pixelated ramen, painted by Mark Rothko and Hilma af Klint, neo expressionism, pastel colours, pop art, intricate detail, masterpiece, 8k\",\n", + " \"Sci-fi, cyberpunk, Tokyo at night in the rain, neon lights, flying cars, watercolour\",\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "template = '''\n", + "You are an image generation agent that can generate images based on a prompt. First I'll give you a context based on the question you ask. Then you can generate an image based on the user prompt.\n", + "\n", + "Context: \n", + "{sections}\n", + "\n", + "Here are some examples context and image generation commands, you should embrace this style of commanding:\n", + "\"Forest wanderer, painterly style, flat colours, illustration, bright and colourful, high contrast, Mythology, cinematic, detailed, atmospheric, 8k, corona render.\",\n", + "\"Pixel collage painting of the last supper, feasting over pixelated ramen, painted by Mark Rothko and Hilma af Klint, neo expressionism, pastel colours, pop art, intricate detail, masterpiece, 8k\",\n", + "\"Sci-fi, cyberpunk, Tokyo at night in the rain, neon lights, flying cars, watercolour\",\n", + "\n", + "\n", + "Users question was: {question}\n", + "\n", + "Based on the user question and the context, you should generate an image generation command. You can use the following commands to generate an image, follow the format of the examples above do not form full sentences give directives:\n", + "\n", + "'''" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "base_agent = BaseAgent(dataframe=df, embedding_extractor=\"hf\", model_lang=\"en\", is_turbo=True, index_type=\"basic\", prompt_template=template, hf_token=HF_TOKEN, task_type=\"image_generation\")" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Computing embeddings...\n", + "model_lang en\n", + "Selected 10 document sections:\n", + "11\n", + "0\n", + "100\n", + "98\n", + "37\n", + "26\n", + "99\n", + "20\n", + "24\n", + "23\n", + "\n", + "You are an image generation agent that can generate images based on a prompt. First I'll give you a context based on the question you ask. Then you can generate an image based on the user prompt.\n", + "\n", + "Context: \n", + "\n", + "* Venetian painting\n", + "* Venetian painting - Wikipedia\n", + "* Retrieved from \"https://en.wikipedia.org/w/index.php?title=Venetian_painting&oldid=1144552580\"\n", + "* ReferencesEdit Freedberg, Sydney J. Painting in Italy, 1500–1600, 3rd edn. 1993, Yale, ISBN 0300055870 Gardner's: Art Through the Ages—International Edition, Brace Harcourt Jovanovich, 9th edition, 1991. \"RA\": Martineau, Jane (ed), The Genius of Venice, 1500–1600, 1983, Royal Academy of Arts, London. Martineau, Jane, and Robison, Andrew, eds., The Glory of Venice: Art in the Eighteenth Century, 1994, Yale University Press/Royal Academy of Arts, ISBN 0300061862 (catalogue for exhibition in London and Washington). Penny, Nicholas, National Gallery Catalogues (new series): The Sixteenth Century Italian Paintings, Volume II, Venice 1540–1600, 2008, National Gallery Publications Ltd, ISBN 1857099133 The Prado Guide, Ed. Maria Dolores Jimenez-Blanco, Museo Nacional del Prado, English 2nd revised edition, 2009. Steer, John, Venetian painting: A concise history, 1970, London: Thames and Hudson (World of Art), ISBN 0500201013 Wittkower, Rudolf, Art and Architecture in Italy, 1600–1750, Penguin/Yale History of Art, 3rd edition, 1973, ISBN 0-14-056116-1Further readingEdit Rosand, David, Painting in Sixteenth-Century Venice: Titian, Veronese, Tintoretto, 2nd ed 1997, Cambridge UP ISBN 0521565685 Federico Zeri, Elizabeth E. Gardner: Italian Paintings: Venetian School: A Catalogue of the Collection of the Metropolitan Museum of Art, (New York, N.Y.) (online)External linksEdit\n", + "* Rosalba Carriera, pastel portrait of Antoine Watteau, 1721\n", + "* Lorenzo Lotto, Portrait of Andrea Odoni, 1527\n", + "* Wikimedia Commons has media related to Venetian school.\n", + "* 15th centuryEdit Further information: Venetian Renaissance The traditional Italo-Byzantine style persisted until around 1400 when the dominant style began to shift towards International Gothic, with Jacobello del Fiore a transitional figure and the trend, which continued in the rather charming work of Michele Giambono (c. 1400 – c. 1462), who also designed mosaics for San Marco. Gentile da Fabriano and Pisanello were both in Venice during much of the years 1405–1409, painting frescos (now lost) in the Doge's Palace and elsewhere.[18]By the mid-century, when the Florentine quattrocento was fully mature, Venice still lagged well behind. Perhaps the most visible work in Venice in the Tuscan style was a mosaic Death of the Virgin, in the Capella Mascoli in San Marco, next to a design by Gambono, though other works in the city included frescos by Andrea Castagno.[19] The Vivarini and Bellini families were the two major dynasties of 15th-century painters in the city, and the Vivarini, though in the end more conservative, were initially the first to embrace styles from the south.[20]Carlo Crivelli (c. 1430–1495) was born in the city, but spent his mature career outside the Republic's territories. His style – highly individual, rather linear, and somewhat neurotic – had no influence on later Venetian painting.[21]   Vittore Carpaccio, Miracle of the Relic of the Cross at the Ponte di Rialto, c. 1496 From the late-15th century, Venetian painting developed through links with Andrea Mantegna (1431–1506) (from nearby Padua) and of a visit by Antonello da Messina (c. 1430–1479), who introduced the oil painting technique of Early Netherlandish painting, probably acquired through his training in Naples.[22] Another external factor was the visit by Leonardo da Vinci, who was particularly influential on Giorgione.[23]During his long career, Giovanni Bellini has been credited with creating the Venetian style.[2] After earlier works, such as his Madonna of the Small Trees (c. 1487), which largely reflect the linear approach of Mantegna, he later developed a softer style, where glowing colours are used to represent form and suggest an atmospheric haze. Applying this approach in his San Zaccaria Altarpiece (1505), the high viewpoint, the uncluttered and interconnected figures arranged in space, and the subtle gestures all combine to form a tranquil yet majestic image.[24] With such works he has been described as reaching the High Renaissance[24] ideals, and certainly expresses the key distinctive factors of the Venetian school. Vittore Carpaccio (c. 1465–1525/1526) was a pupil of Bellini, with a distinct style. He was rather conservative, and ignored the High Renaissance style developing in the later part of his career, indeed retaining a Late Gothic poetry in many works. With Gentile Bellini, many of Carpaccio's large works give us famous scenes of contemporary life in the city; at this period such views were unusual. He was one of the first painters to mostly use canvas rather than panels. There were a number of other painters who continued essentially quattrocento styles in the two decades after 1500; Cima da Conegliano (c. 1459–c. 1517) is the most significant.[25] 16th centuryEdit Giorgione and TitianEdit   Titian's early and dramatically composed Pesaro Madonna (1526), with rich Venetian colouring Giorgione and Titian were both apprentices at Bellini's workshop. They collaborated on numerous paintings, and their styles could be so similar that it is difficult to conclusively assign authorship. A speciality of Giorgione's were idyllic Arcadian scenes, with an example being his Three Philosophers, and this element was adopted by his master Bellini, who increased the landscape in his many Madonnas,[26] and by Titian in work like Pastoral Concert (1508) and Sacred and Profane Love (1515). This emphasis on nature as a setting was a major contribution of the Venetian School. Titian, through his long and productive life, with a wide variety of themes and subjects was the most influential and greatest of all the Venetian painters.[27][28] His early Pesaro Madonna (1519–1528) shows a bold new composition for such a traditional religious subject,[29] putting the focal point of the Madonna off from the centre and on a steep diagonal. Colours are used to enliven the painting, but also to unify the composition, such as by the large red flag on the left counterbalancing the red in the Madonna[30] and such skilful and sumptuous use of colour became a hallmark of the Venetian style.\n", + "* La Bella, Palma Vecchio, 1518-20\n", + "* The Bravo, an example of a painting often attributed to Titian or Giorgione, but also to Palma Vecchio[42]\n", + "\n", + "Here are some examples context and image generation commands, you should embrace this style of commanding:\n", + "\"Forest wanderer, painterly style, flat colours, illustration, bright and colourful, high contrast, Mythology, cinematic, detailed, atmospheric, 8k, corona render.\",\n", + "\"Pixel collage painting of the last supper, feasting over pixelated ramen, painted by Mark Rothko and Hilma af Klint, neo expressionism, pastel colours, pop art, intricate detail, masterpiece, 8k\",\n", + "\"Sci-fi, cyberpunk, Tokyo at night in the rain, neon lights, flying cars, watercolour\",\n", + "\n", + "\n", + "Users question was: An 1080p image in baroque style, covered in flowers and has 3 person a man a wife and a kid around 4 years old in front of their village home\n", + "\n", + "Based on the user question and the context, you should generate an image generation command. You can use the following commands to generate an image, follow the format of the examples above do not form full sentences give directives:\n", + "\n", + "\n", + "all_done!\n", + "Image Generated for prompt:Baroque style, floral motif, village home, man, wife, child, warm colors, oil painting, 1080p.\n" + ] + } + ], + "source": [ + "answer = base_agent.agent_run(\"An 1080p image in baroque style, covered in flowers and has 3 person a man a wife and a kid around 4 years old in front of their village home\", max_tokens=2000, load_index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Saved to disk:a80ac33f-34cf-4696-b1d2-6260fe53fcf4.jpg'" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "answer" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "query = 'Pop Art Style'\n", + "endpoint = 'https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch={}&utf8='.format(query)\n", + "\n", + "response = requests.get(endpoint).json()\n", + "\n", + "search_results = response['query']['search']\n", + "\n", + "titles = [result['title'] for result in search_results]\n", + "links = ['https://en.wikipedia.org/wiki/{}'.format(result['title'].replace(' ', '_')) for result in search_results]\n" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "df_all = pd.DataFrame()\n", + "\n", + "for link in links:\n", + " df = scrape_content(link)\n", + " df_all = pd.concat([df_all, df])\n", + "\n", + "df_all = df_all.reset_index()" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "df_all.drop(columns=['index'], inplace=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "base_agent = BaseAgent(dataframe=df, embedding_extractor=\"hf\", model_lang=\"en\", is_turbo=True, index_type=\"basic\", prompt_template=template, hf_token=HF_TOKEN, task_type=\"image_generation\")" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Computing embeddings...\n", + "model_lang en\n", + "Selected 74 document sections:\n", + "37\n", + "383\n", + "192\n", + "48\n", + "464\n", + "286\n", + "41\n", + "452\n", + "49\n", + "63\n", + "215\n", + "529\n", + "124\n", + "551\n", + "271\n", + "243\n", + "29\n", + "152\n", + "479\n", + "108\n", + "31\n", + "90\n", + "344\n", + "534\n", + "161\n", + "249\n", + "70\n", + "116\n", + "412\n", + "257\n", + "277\n", + "173\n", + "530\n", + "434\n", + "288\n", + "165\n", + "35\n", + "536\n", + "176\n", + "115\n", + "320\n", + "0\n", + "526\n", + "136\n", + "448\n", + "408\n", + "252\n", + "21\n", + "239\n", + "120\n", + "541\n", + "160\n", + "314\n", + "253\n", + "188\n", + "420\n", + "418\n", + "301\n", + "112\n", + "455\n", + "94\n", + "144\n", + "191\n", + "241\n", + "535\n", + "519\n", + "225\n", + "132\n", + "459\n", + "328\n", + "391\n", + "414\n", + "444\n", + "462\n", + "\n", + "You are an image generation agent that can generate images based on a prompt. First I'll give you a context based on the question you ask. Then you can generate an image based on the user prompt.\n", + "\n", + "Context: \n", + "\n", + "* 10Graphic arts\n", + "* Gallery[edit]\n", + "* Moulin Rouge poster by Charles Gesmar (1925)\n", + "* 17Glass art\n", + "* ^ Jirousek, Charlotte (1995). \"Art, Design and Visual Thinking\". Archived from the original on 2 December 2008. Retrieved 7 November 2008.\n", + "* Glass art[edit]\n", + "* 11.2Movie palaces\n", + "* ^ Imbert, Dorothée (1993). The Modernist Garden in Frances. ISBN 0300047169. Retrieved 18 December 2012.\n", + "* 18Metal art\n", + "* 22Gallery\n", + "* Movie palaces[edit]\n", + "* ^ \"Home – Art Deco Trust\". Artdeconapier.com. Archived from the original on 30 June 2010. Retrieved 8 July 2010.\n", + "* Illustration by Georges Barbier of a gown by Paquin (1914). Stylised floral designs and bright colours were a feature of early Art Deco.\n", + "* Wikimedia Commons has media related to Art Deco.\n", + "* Rose Mousse pattern for upholstery, cotton and silk (1920) (Metropolitan Museum of Art)\n", + "* Armchair by Louis Süe (1912) and painted screen by André Mare (1920)\n", + "* 5International Exhibition of Modern Decorative and Industrial Arts (1925)\n", + "* Late Art Deco[edit]\n", + "* ^ Gaunt, Pamela (August 2005). \"The Decorative in Twentieth Century Art: A Story of Decline and Resurgence\" (PDF). Archived from the original (PDF) on 17 December 2008.\n", + "* Dome of the Theater, with Art Deco rose design by Maurice Denis\n", + "* 7Late Art Deco\n", + "* Early-20th-century architectural and art style This article is about the art style. For other uses, see Art Deco (disambiguation).\n", + "* A rundown Art Deco building in Havana\n", + "* ^ \"Art Deco Buildings\". london-footprints.co.uk. 2007. Archived from the original on 11 December 2008. Retrieved 6 November 2008.\n", + "* Detail of Time, ceiling mural in lobby of 30 Rockefeller Plaza (New York City, N.Y.), by the Spanish painter Josep Maria Sert (1941)\n", + "* Furniture by Gio Ponti (1927)\n", + "* Art Deco\n", + "* Design for the facade of La Maison Cubiste (Cubist House) by Raymond Duchamp-Villon (1912)\n", + "* ^ Poulin, Richard (2012). Graphic Design and Architecture, A 20th Century History: A Guide to Type, Image, Symbol, and Visual Storytelling in the Modern World. Rockport Publishers. p. 85. ISBN 978-1-61058-633-7.\n", + "* \"Beau Brownie\" camera, design by Walter Dorwin Teague for Eastman Kodak (1930)\n", + "* Desiree Lubovska in a dress by Jean Patou, c. 1921\n", + "* Aerial between Wisdom and Gaiety by Eric Gill, façade of BBC Broadcasting House, London, UK (1932)\n", + "* ^ \"Art Deco heritage trail\" (PDF). wellington.gov.nz. Retrieved 22 February 2016.\n", + "* ^ a b c d e f g h Goss, Jared. \"French Art Deco\". Metropolitan Museum of Art. Archived from the original on 31 March 2022. Retrieved 29 August 2016.\n", + "* Parrot vase by Lalique (1922)\n", + "* Sculpture[edit] Monumental and public sculpture[edit]\n", + "* 9.1Monumental and public sculpture\n", + "* ^ \"Four Programmes – Art Deco Icons\". BBC. 14 November 2009. Retrieved 8 July 2010.\n", + "* Studio sculpture[edit]\n", + "* Cubism[edit]\n", + "* 1931 Art Deco facade of the Castlemaine Art Museum, architect Percy Meldrum, Orlando Dutton frieze, photographed in 2017\n", + "* Art Deco - Wikipedia\n", + "* ^ \"Art Deco in Animation Presentation\". Cartoon Brew. 4 March 2008.\n", + "* International Exhibition of Modern Decorative and Industrial Arts (1925)[edit] Main article: International Exhibition of Modern Decorative and Industrial Arts\n", + "* ^ Detail of Duchamp-Villon's Façade architecturale, catalog number 609, unidentified photographer, 1913. Walt Kuhn, Kuhn family papers, and Armory Show records, 1859–1984, bulk 1900–1949 Archived 14 March 2013 at the Wayback Machine. Archives of American Art, Smithsonian Institution\n", + "* ^ L'Art décoratif à Limoges, La Voix de la province : Revue littéraire, artistique, agricole et commerciale, 1862 Archived 16 August 2018 at the Wayback Machine, (1862/04/01 (N1)-1863/01/01 (N12)), Bibliothèque francophone multimédia de Limoges, 2013-220524, Bibliothèque nationale de France\n", + "* Late Art Deco furniture and rug by Jules Leleu (1930s)\n", + "* 2.1Society of Decorative Artists (1901–1945)\n", + "* Detail of mosaic facade of Paramount Theatre (Oakland, California) (1931)\n", + "* Jacques Doucet's hôtel particulier, 1927. Picasso's Les Demoiselles d'Avignon can be seen hanging in the background.\n", + "* ^ \"Inventory | Art Deco\". www.artdecomumbai.com. Retrieved 10 January 2018.\n", + "* Painting[edit]\n", + "* Dare House in Chennai, India (1940)\n", + "* A Waterfall style buffet table\n", + "* A Vanity Fair cover by Georges Lepape (1919)\n", + "* ^ a b Campbell, Gordon, The Grove Encyclopedia of Decorative Arts, Oxford University Press, USA, 9 Nov 2006 Archived 6 December 2022 at the Wayback Machine, pp. 42-43 ISBN 0195189485\n", + "* ^ a b Campbell, Gordon, The Grove Encyclopedia of Decorative Arts, Oxford University Press, USA, 9 Nov 2006 Archived 6 December 2022 at the Wayback Machine, pp. 42 (Vera), 43 (Cartier), 243 (Christofle), 15, 515, 527 (Lalique), 13, 134 (Boucheron), ISBN 0195189485\n", + "* Animation[edit] Art Deco visuals and imagery was used in multiple animated films including Batman, Night Hood, All's Fair at the Fair, Merry Mannequins, Page Miss Glory, Fantasia and Sleeping Beauty.[126] The architecture is featured in the fictitious underwater city of Rapture in the Bioshock video game series.\n", + "* Art Deco armchair made for art collector Jacques Doucet (1912–13)\n", + "* ^ Richard Harrison Martin, Cubism and Fashion, Metropolitan Museum of Art (New York, N.Y.), 1998, p. 99 Archived 6 December 2022 at the Wayback Machine, ISBN 0870998889\n", + "* Table and chairs by Maurice Dufrêne and carpet by Paul Follot at the 1912 Salon des artistes décorateurs\n", + "* Skyscrapers[edit]\n", + "* London Underground poster by Horace Taylor (1924)\n", + "* Furniture[edit]\n", + "* ^ \"Art Deco in Frinton on sea\". Art Deco Classics. 2006. Archived from the original on 1 December 2008. Retrieved 6 November 2008.\n", + "* ^ a b c d \"The Metropolitan Museum of Art – Special Exhibitions: Poiret: King of Fashion\".\n", + "* Moscovici Building in Bucharest, Romania, by Aurel Focșanu and Emil Vițeanu (1930s)\n", + "* Bath of Jeanne Lanvin, of Sienna marble, with decoration of carved stucco and bronze (1922–25)\n", + "* ^ Wood, Ghislaine (2003). Essential Art Deco. London: VA&A Publications. ISBN 0-8212-2833-1.\n", + "* Miami Art Deco District in South Beach, Florida, USA (1925-1940s)\n", + "* Federal Art Project poster promoting milk drinking in Cleveland (1940)\n", + "* ^ Hillier, Bevis (1971). The World of Art Deco: An Exhibition Organized by The Minneapolis Institute of Arts, June–September 1971. E.P. Dutton. ISBN 978-0-525-47680-1.\n", + "* ^ \"La Maison Cubiste, 1912\". kubisme.info (in Dutch). Archived from the original on 13 March 2013.{{cite web}}: CS1 maint: unfit URL (link)\n", + "* ^ Juster, Randy. \"Introduction to Art Deco\". decopix.com. Archived from the original on 29 October 2008. Retrieved 7 November 2008.\n", + "\n", + "Here are some examples context and image generation commands, you should embrace this style of commanding:\n", + "\"Forest wanderer, painterly style, flat colours, illustration, bright and colourful, high contrast, Mythology, cinematic, detailed, atmospheric, 8k, corona render.\",\n", + "\"Pixel collage painting of the last supper, feasting over pixelated ramen, painted by Mark Rothko and Hilma af Klint, neo expressionism, pastel colours, pop art, intricate detail, masterpiece, 8k\",\n", + "\"Sci-fi, cyberpunk, Tokyo at night in the rain, neon lights, flying cars, watercolour\",\n", + "\n", + "\n", + "Users question was: An 1080p image in popart style, covered in flowers and has 3 person a man a wife and a kid around 4 years old in front of their village home\n", + "\n", + "Based on the user question and the context, you should generate an image generation command. You can use the following commands to generate an image, follow the format of the examples above do not form full sentences give directives:\n", + "\n", + "\n", + "all_done!\n", + "Image Generated for prompt:Pop art style, vibrant colours, floral patterns, 1080p resolution, family of three (man, wife, and 4-year-old child) standing in front of their village home.\n" + ] + } + ], + "source": [ + "answer = base_agent.agent_run(\"An 1080p image in popart style, covered in flowers and has 3 person a man a wife and a kid around 4 years old in front of their village home\", max_tokens=2000, load_index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Saved to disk:93cff0b2-c2e6-4e0b-8beb-e45b0b11db17.jpg'" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "answer" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "knowledgegpt-env", + "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.9.16" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "d0285ce201951a37668925b1b7de032ac1583adb61d048d8a5dd45351727e09e" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}