-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
What happened?
Describe the bug
Traceback (most recent call last):
File "/Users/chenghaolu/workspace/cloud-lab-python/rag_demo_v1.py", line 112, in
vector_search = AzureAISearchTool.create_vector_search(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chenghaolu/workspace/cloud-lab-python/.venv/lib/python3.12/site-packages/autogen_ext/tools/azure/_ai_search.py", line 997, in create_vector_search
return cls(
^^^^
TypeError: Can't instantiate abstract class AzureAISearchTool without an implementation for abstract method '_get_embedding'
To Reproduce
create a index in azure aiseach
upload document
run this code
vector_search = AzureAISearchTool.create_vector_search(
name="vector_search",
endpoint="",
index_name="demo",
credential=AzureKeyCredential(""),
vector_fields=["embedding"],
select_fields=["title", "content", "url"],
top=5,
)
rag_assistant = AssistantAgent(
name="rag_assistant", model_client=model_client, tools=[vector_search]
)
asyncio.run(rag_assistant.run(task="how to run apiserver locally?", cancellation_token=None))Expected behavior
Method should be implemented
Screenshots
None
Additional context
None
Which packages was the bug in?
Python Extensions (autogen-ext)
AutoGen library version.
Python 0.5.1
Other library version.
No response
Model used
No response
Model provider
Azure OpenAI
Other model provider
No response
Python version
3.12
.NET version
None
Operating system
MacOS