liboai icon indicating copy to clipboard operation
liboai copied to clipboard

Update examples to reflect liboai.h deprecation

Open aschet opened this issue 1 year ago • 1 comments

Describe the bug

The CMakeLists.txt does no longer install liboai.h. There is a comment that states that liboai.h is no longer needed. However, all examples still have a dependency on it. Either liboai.h should installed again or liboai.h should be removed and the examples updated accordingly.

To Reproduce

  1. Build and install the library
  2. Compile an example against the installed library, this will fail due to a missing liboai.h

Code snippets

No response

OS

all

Library version

v4.0.1

aschet avatar Sep 20 '24 08:09 aschet

liboai.h is required to access all interfaces in the library. If CMake does not include it, this is indeed a bug.

D7EAD avatar Sep 27 '24 22:09 D7EAD

I've checked the latest from main branch on Linux with:

sudo make install

Output:

Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/liboai.a
-- Installing: /usr/local/include/liboai.h
-- Installing: /usr/local/include/components/audio.h
-- Installing: /usr/local/include/components/azure.h
-- Installing: /usr/local/include/components/chat.h
-- Installing: /usr/local/include/components/completions.h
-- Installing: /usr/local/include/components/edits.h
-- Installing: /usr/local/include/components/embeddings.h
-- Installing: /usr/local/include/components/files.h
-- Installing: /usr/local/include/components/fine_tunes.h
-- Installing: /usr/local/include/components/images.h
-- Installing: /usr/local/include/components/models.h
-- Installing: /usr/local/include/components/moderations.h
-- Installing: /usr/local/include/core/authorization.h
-- Installing: /usr/local/include/core/exception.h
-- Installing: /usr/local/include/core/netimpl.h
-- Installing: /usr/local/include/core/network.h
-- Installing: /usr/local/include/core/response.h
-- Installing: /usr/local/lib/cmake/oai/oaiTargets.cmake
-- Installing: /usr/local/lib/cmake/oai/oaiTargets-release.cmake
-- Installing: /usr/local/lib/cmake/oai/oaiConfig.cmake
-- Installing: /usr/local/lib/cmake/oai/oaiConfigVersion.cmake

liboai.h is installed, the samples can be successfully built against this installation. Any other installation scenario that needs to be tested?

cifrzak avatar Dec 22 '24 13:12 cifrzak

Any other installation scenario that needs to be tested?

Thank you, that should be sufficient. I can confirm, this also now works for Win32 configurations.

aschet avatar Dec 23 '24 10:12 aschet