mirror of https://github.com/microsoft/autogen.git
Update Microsoft Fabric notebook (#3243)
Co-authored-by: HRUSHIKESH DOKALA <96101829+Hk669@users.noreply.github.com>
This commit is contained in:
parent
56979a1105
commit
f8663e3581
|
@ -113,32 +113,36 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"import types\n",
|
||||
"from synapse.ml.mlflow import get_mlflow_env_config\n",
|
||||
"\n",
|
||||
"import httpx\n",
|
||||
"from synapse.ml.fabric.credentials import get_openai_httpx_sync_client\n",
|
||||
"\n",
|
||||
"import autogen\n",
|
||||
"def get_config_list():\n",
|
||||
" mlflow_env_configs = get_mlflow_env_config()\n",
|
||||
" access_token = mlflow_env_configs.driver_aad_token\n",
|
||||
" prebuilt_AI_base_url = mlflow_env_configs.workload_endpoint + \"cognitive/openai/\"\n",
|
||||
"\n",
|
||||
"http_client = get_openai_httpx_sync_client()\n",
|
||||
"http_client.__deepcopy__ = types.MethodType(\n",
|
||||
" lambda self, memo: self, http_client\n",
|
||||
") # https://microsoft.github.io/autogen/docs/topics/llm_configuration#adding-http-client-in-llm_config-for-proxy\n",
|
||||
" config_list = [\n",
|
||||
" {\n",
|
||||
" \"model\": \"gpt-4o\",\n",
|
||||
" \"api_key\": access_token,\n",
|
||||
" \"base_url\": prebuilt_AI_base_url,\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-01\",\n",
|
||||
" },\n",
|
||||
" ]\n",
|
||||
"\n",
|
||||
"config_list = [\n",
|
||||
" {\n",
|
||||
" \"model\": \"gpt-4o\",\n",
|
||||
" \"http_client\": http_client,\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-01\",\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
" # Set temperature, timeout and other LLM configurations\n",
|
||||
" llm_config = {\n",
|
||||
" \"config_list\": config_list,\n",
|
||||
" \"temperature\": 0,\n",
|
||||
" \"timeout\": 600,\n",
|
||||
" }\n",
|
||||
" return config_list, llm_config\n",
|
||||
"\n",
|
||||
"# Set temperature, timeout and other LLM configurations\n",
|
||||
"llm_config = {\n",
|
||||
" \"config_list\": config_list,\n",
|
||||
" \"temperature\": 0,\n",
|
||||
"}"
|
||||
"config_list, llm_config = get_config_list()\n",
|
||||
"\n",
|
||||
"assert len(config_list) > 0\n",
|
||||
"print(\"models to use: \", [config_list[i][\"model\"] for i in range(len(config_list))])"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -300,6 +304,8 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"import autogen\n",
|
||||
"\n",
|
||||
"# create an AssistantAgent instance named \"assistant\"\n",
|
||||
"assistant = autogen.AssistantAgent(\n",
|
||||
" name=\"assistant\",\n",
|
||||
|
|
Loading…
Reference in New Issue