Skip to content

Challenge 5: Adding search client service shows error #17

@Sandido

Description

@Sandido

Hi there,
I tried adding the Search Client as a service like the ChatCompletion service, but I see this error in the logs:

kernel_build() code has this:
search_client = SearchIndexClient(endpoint=os.getenv('AI_SEARCH_URL'), credential=os.getenv('AI_SEARCH_KEY'))
kernel.add_service(search_client)

and this error in my logs whenever I write a message:
ERROR:chat:Error initializing chat completion service or plugins: 'SearchIndexClient' object has no attribute 'service_id'
Error of 'SearchIndexClient' object has no attribute 'service_id'

What am I doing wrong?
The Test embedding service was added just fine right above it:
text_embedding_service = AzureTextEmbedding(
endpoint=os.getenv('AZURE_OPENAI_ENDPOINT'),
api_key=os.getenv('AZURE_OPENAI_API_KEY'),
deployment_name=os.getenv('AZURE_OPENAI_EMBED_DEPLOYMENT_NAME'), # Make sure this is in your .env file
api_version=os.getenv('AZURE_OPENAI_API_VERSION')
)
kernel.add_service(text_embedding_service)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions