Skip to content

Instantly share code, notes, and snippets.

@bonadio
bonadio / api.txt
Last active October 23, 2023 21:57
API bot
POST https://algumservidor/api_send/v1/chat
{
"client_id": 123 # identificador do cliente
"app_id": 123 # identificador do app
"action": "INSERT", # INSERT REMOVE ASK
"id": "12", # identificador para INSERT ou REMOVE
"text": "texto", # se for REMOVE em branco
"secret": "codigo de segurança" # código de segurança que vamos compartilhar
"api_key": "open_ai_api_key" # a chave da API
@bonadio
bonadio / self_execute_function_agent.py
Last active April 7, 2024 00:10
Autogen Agent that can auto execute a function_call
# %%
import os
import openai
# import autogen
from autogen import Agent, ConversableAgent, oai, UserProxyAgent, AssistantAgent
import types
from dotenv import load_dotenv, find_dotenv
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
_ = load_dotenv(find_dotenv()) # read local .env file
@bonadio
bonadio / test_agent.py
Created October 15, 2023 01:35
Autogen Agent interacting with user_proxy answering function_call
# %%
#https://github.com/microsoft/autogen
import os
import openai
import autogen
import types
from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv()) # read local .env file
openai.api_key = os.environ['OPENAI_API_KEY']
@bonadio
bonadio / autogen_chat.py
Last active January 6, 2024 23:52
Very basic implementation of Autogen with FastApi using websocket to interact with user_proxy in a web app
import autogen
from user_proxy_webagent import UserProxyWebAgent
import asyncio
config_list = [
{
"model": "gpt-3.5-turbo",
# "api_key": "<YOUR KEY HERE>"
}
]