Closed rvermeire closed 11 months ago
Hi @rvermeir thanks for checking and creating an issue, we just released a new version with the new openai package, could you test with that?
Hi Eduard, I think there is a breaking change. I get an unrelated error when importing. So no possibility to test this now.
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion, AzureChatCompletion
cannot import name 'UrlConstraints' from 'pydantic' (/home/trusted-service-user/cluster-env/trident_env/lib/python3.10/site-packages/pydantic/__init__.cpython-310-x86_64-linux-gnu.so)
this is interesting, you are using 0.4.1b right, that is the latest and should not lead not this kind of error, if installed correctly. Could you also check which version of pydantic you have installed?
Although I do not see a "b" in the package name, I think we are talking about the same version.
Collecting semantic-kernel
Downloading semantic_kernel-0.4.1.dev0-py3-none-any.whl (209 kB)
Collecting pydantic>2 (from semantic-kernel)
Downloading pydantic-2.5.2-py3-none-any.whl (381 kB)
@rvermeire Are you installing SK via pip or Poetry? If you're installing via pip, I'd recommend moving over to Poetry per the following guidance. If you're not using a virtual env, there could be some weird things happening with dependencies.
@moonbox3 would that work from a Fabric notebook?
@rvermeire Apologies as I overlooked you were using a Fabric notebook. If managing packages via pip you should still be able to create a virtual environment so that there are no dependency issues.
The package versions you showed above are latest.
I do not know what changed, but it imports correctly now. Maybe something on the fabric side...Thanks for your support.
Describe the bug OpenAI service fails to complete chat in a Fabric Notebook. AzureChatCompletion does work for the exact same example
Error: (<ErrorCodes.ServiceError: 6>, 'OpenAI service failed to complete the chat', InvalidRequestError(message="Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>", param='engine', code=None, http_status=None, request_id=None))
To Reproduce
Expected behavior OpenAIChatCompletion should work like AzureOpenAIChatCompletion
Screenshots
Platform
Additional context I first had this issue when following this blog post. https://blog.fabric.microsoft.com/en-us/blog/chat-your-data-in-microsoft-fabric-with-semantic-kernel?ft=All I just changed from AzureOpenAIChatCompletion to OpenAIChatCompletion because I don't have access to GPT-4 on Azure.