adamrushy / OpenAISwift

This is a wrapper library around the ChatGPT and OpenAI HTTP API
MIT License
1.6k stars 242 forks source link

Archiving error #87

Open manikal opened 1 year ago

manikal commented 1 year ago

Hi,

I've integrated OpenAISwift with SPM to my framework but when I try to archive my framework I get bunch of errors saying that "'ChatRole' is not a member type of class 'OpenAISwift.OpenAISwift'" for all OpenAISwift types (ChatError, Payload...). If I do manual integration using source code it archives fine.

manikal commented 1 year ago

It seems like it's because framework and type names are the same (OpenAISwift.OpenAISwift), renaming either would resolve it.

adamrushy commented 11 months ago

Hey, @manikal can you share which version of Xcode you're using?

manikal commented 11 months ago

Hi @adamrushy,

I'm using 14.3.1.

adamrushy commented 11 months ago

I am not able to reproduce here @manikal, are you able to share the project? My thinking is that have you got some local class that is named the same?

manikal commented 11 months ago

Hi @adamrushy , I was quite unclear when I said "to archive" in my initial post. I was thinking about archiving from the script to make .xcframework for example.

I've created project for you demonstrating this. The project has aggregated target which has Run Script phase with script in it. The script just archives the current framework. So when you open up the project just select this aggregated target called Script run and wait until it fails with errors I've mentioned.

I still believe it's related to the fact that the framework and type names are the same.

Thanks! openAISwiftIssue.zip