{ "cells": [ { "cell_type": "code", "execution_count": 3, "outputs": [], "source": [ "from chatarena.environments.pettingzoo_tictacteo import PettingzooTicTacTeo\n", "from chatarena.arena import Arena" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 6, "outputs": [], "source": [ "arena = Arena.from_config(\"../examples/pettingzoo_tictacteo.json\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 8, "outputs": [], "source": [ "timestep = arena.reset()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 10, "outputs": [ { "data": { "text/plain": "TimeStep(observation=[Message(agent_name='Player 1', content='X: (2, 2)', turn=0, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False), Message(agent_name='Moderator', content='\\n| _ | _ | _ |\\n| _ | X | _ |\\n| _ | _ | _ |\\n', turn=1, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False)], reward=0, terminal=False)" }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "arena.step()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 11, "outputs": [ { "data": { "text/plain": "TimeStep(observation=[Message(agent_name='Player 1', content='X: (2, 2)', turn=0, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False), Message(agent_name='Moderator', content='\\n| _ | _ | _ |\\n| _ | X | _ |\\n| _ | _ | _ |\\n', turn=1, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False), Message(agent_name='Player 2', content='O: (1, 1)', turn=1, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False), Message(agent_name='Moderator', content='\\n| O | _ | _ |\\n| _ | X | _ |\\n| _ | _ | _ |\\n', turn=2, timestamp=1683644303807500787, visible_to='all', msg_type='text', logged=False)], reward=0, terminal=False)" }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "arena.step()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } } ], "metadata": { "kernelspec": { "name": "chatbenchmark", "language": "python", "display_name": "chatBenchmark" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }