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": [
|
"source": [
|
||||||
"import types\n",
|
"from synapse.ml.mlflow import get_mlflow_env_config\n",
|
||||||
"\n",
|
"\n",
|
||||||
"import httpx\n",
|
|
||||||
"from synapse.ml.fabric.credentials import get_openai_httpx_sync_client\n",
|
|
||||||
"\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",
|
"\n",
|
||||||
"http_client = get_openai_httpx_sync_client()\n",
|
" config_list = [\n",
|
||||||
"http_client.__deepcopy__ = types.MethodType(\n",
|
" {\n",
|
||||||
" lambda self, memo: self, http_client\n",
|
" \"model\": \"gpt-4o\",\n",
|
||||||
") # https://microsoft.github.io/autogen/docs/topics/llm_configuration#adding-http-client-in-llm_config-for-proxy\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",
|
"\n",
|
||||||
"config_list = [\n",
|
" # Set temperature, timeout and other LLM configurations\n",
|
||||||
" {\n",
|
" llm_config = {\n",
|
||||||
" \"model\": \"gpt-4o\",\n",
|
" \"config_list\": config_list,\n",
|
||||||
" \"http_client\": http_client,\n",
|
" \"temperature\": 0,\n",
|
||||||
" \"api_type\": \"azure\",\n",
|
" \"timeout\": 600,\n",
|
||||||
" \"api_version\": \"2024-02-01\",\n",
|
" }\n",
|
||||||
" },\n",
|
" return config_list, llm_config\n",
|
||||||
"]\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"# Set temperature, timeout and other LLM configurations\n",
|
"config_list, llm_config = get_config_list()\n",
|
||||||
"llm_config = {\n",
|
"\n",
|
||||||
" \"config_list\": config_list,\n",
|
"assert len(config_list) > 0\n",
|
||||||
" \"temperature\": 0,\n",
|
"print(\"models to use: \", [config_list[i][\"model\"] for i in range(len(config_list))])"
|
||||||
"}"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -300,6 +304,8 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
|
"import autogen\n",
|
||||||
|
"\n",
|
||||||
"# create an AssistantAgent instance named \"assistant\"\n",
|
"# create an AssistantAgent instance named \"assistant\"\n",
|
||||||
"assistant = autogen.AssistantAgent(\n",
|
"assistant = autogen.AssistantAgent(\n",
|
||||||
" name=\"assistant\",\n",
|
" name=\"assistant\",\n",
|
||||||
|
|
Loading…
Reference in New Issue