guix.scm 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;;; guile-openai --- An OpenAI API client for Guile
  2. ;;; Copyright © 2023 Andrew Whatson <whatson@tailcall.au>
  3. ;;;
  4. ;;; This file is part of guile-openai.
  5. ;;;
  6. ;;; guile-openai is free software: you can redistribute it and/or modify
  7. ;;; it under the terms of the GNU Affero General Public License as
  8. ;;; published by the Free Software Foundation, either version 3 of the
  9. ;;; License, or (at your option) any later version.
  10. ;;;
  11. ;;; guile-openai is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. ;;; Affero General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU Affero General Public
  17. ;;; License along with guile-openai. If not, see
  18. ;;; <https://www.gnu.org/licenses/>.
  19. (use-modules (guix packages)
  20. (guix build-system gnu)
  21. (guix build utils)
  22. (guix gexp)
  23. (guix git-download)
  24. ((guix licenses) #:prefix license:)
  25. (gnu packages autotools)
  26. (gnu packages guile)
  27. (gnu packages guile-xyz)
  28. (gnu packages imagemagick)
  29. (gnu packages pkg-config)
  30. (gnu packages tls)
  31. (ice-9 popen)
  32. (ice-9 textual-ports))
  33. (define %source-dir
  34. (dirname (current-filename)))
  35. (define %git-commit
  36. (with-directory-excursion %source-dir
  37. (get-line (open-input-pipe "git rev-parse HEAD"))))
  38. (define guile-openai
  39. (package
  40. (name "guile-openai")
  41. (version (git-version "0.2" "HEAD" %git-commit))
  42. (source (local-file %source-dir
  43. #:recursive? #t
  44. #:select? (git-predicate %source-dir)))
  45. (build-system gnu-build-system)
  46. (arguments (list #:strip-binaries? #f))
  47. (native-inputs (list automake autoconf pkg-config))
  48. (inputs (list guile-3.0-latest imagemagick))
  49. (propagated-inputs (list guile-colorized
  50. guile-gnutls
  51. guile-json-4
  52. guile-picture-language))
  53. (home-page "https://notabug.org/flatwhatson/guile-openai")
  54. (synopsis "Guile implementation of the OpenAI API")
  55. (description
  56. "Guile OpenAI is an implementation of the OpenAI API in Guile Scheme,
  57. providing a convenient interface for interactive programming with their
  58. AI models.")
  59. (license license:agpl3+)))
  60. guile-openai