"`flaml.autogen` offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framwork allows tool use and human participance through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen#agents).\n",
"\n",
"This notebook is modified based on https://github.com/microsoft/FLAML/blob/4ea686af5c3e8ff24d9076a7a626c8b28ab5b1d7/notebook/autogen_multiagent_roleplay_chat.ipynb\n",
"The [`config_list_from_json`](https://microsoft.github.io/FLAML/docs/reference/autogen/oai/openai_utils#config_list_from_json) function loads a list of configurations from an environment variable or a json file."
"It first looks for environment variable \"OAI_CONFIG_LIST\" which needs to be a valid json string. If that variable is not found, it then looks for a json file named \"OAI_CONFIG_LIST\". It filters the configs by models (you can filter by other keys as well). Only the gpt-4 models are kept in the list based on the filter condition.\n",
"\n",
"The config list looks like the following:\n",
"```python\n",
"config_list = [\n",
" {\n",
" 'model': 'gpt-4',\n",
" 'api_key': '<your OpenAI API key here>',\n",
" },\n",
" {\n",
" 'model': 'gpt-4',\n",
" 'api_key': '<your Azure OpenAI API key here>',\n",
" 'api_base': '<your Azure OpenAI API base here>',\n",
" 'api_type': 'azure',\n",
" 'api_version': '2023-06-01-preview',\n",
" },\n",
" {\n",
" 'model': 'gpt-4-32k',\n",
" 'api_key': '<your Azure OpenAI API key here>',\n",
" 'api_base': '<your Azure OpenAI API base here>',\n",
" 'api_type': 'azure',\n",
" 'api_version': '2023-06-01-preview',\n",
" },\n",
"]\n",
"```\n",
"\n",
"If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n",
"\n",
"You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file."
"To find the latest paper about GPT-4 on arxiv, I will use the arxiv API to query and filter the search results. First, I'll execute the following code to get the latest paper information.\n",
"The latest paper about GPT-4 on arxiv is titled \"Breaking the Bank with ChatGPT: Few-Shot Text Classification for Finance\" by Lefteris Loukas, Ilias Stogiannidis, Prodromos Malakasiotis, and Stavros Vassos. It was published on 2023-08-28.\n",
"The potential application of GPT-4 in this paper is for few-shot text classification in the financial domain using the Banking77 dataset. The authors propose using conversational GPT models like GPT-3.5 and GPT-4 for in-context learning, which minimizes the technical expertise required and eliminates the need for expensive GPU computing while yielding quick and accurate results.\n",
"Additionally, the paper explores fine-tuning other pre-trained, masked language models with SetFit, a recent contrastive learning technique, to achieve state-of-the-art results in both full-data and few-shot settings.\n",
"The findings of this paper show that querying GPT-3.5 and GPT-4 can outperform fine-tuned, non-generative models even with fewer examples. However, subscription fees associated with these solutions may be considered costly for small organizations. The authors also find that generative models perform better on the given task when shown representative samples selected by a human expert rather than when shown random ones. The proposed methods offer a practical solution for few-shot tasks in datasets with limited label availability, and the state-of-the-art results can inspire future work in the area.\n",