packages feed

genai-lib-2.0.1: genai-lib.cabal

cabal-version: 2.2

name: genai-lib
version: 2.0.1
synopsis: A library for interacting with various generative AI LLMs
description: A library for performing completions and chats with various
  generative AI LLMs (Large Language Models). Works today with Ollama and
  OpenAI with more to come in the future.
author: Dino Morelli
maintainer: dino@ui3.info
copyright: 2024 Dino Morelli
category: Unclassified
license: ISC
license-file: LICENSE
build-type: Simple
extra-source-files:
  .gitignore
  README.md
  stack.yaml
  stack.yaml.lock
extra-doc-files:
  CHANGELOG.md

source-repository head
  type: git
  location: https://codeberg.org/dinofp/genai-lib

common lang
  default-language: Haskell2010
  default-extensions:
    BangPatterns
    DeriveFoldable
    DeriveFunctor
    DeriveGeneric
    DeriveLift
    DeriveTraversable
    EmptyCase
    FlexibleContexts
    FlexibleInstances
    GeneralizedNewtypeDeriving
    ImportQualifiedPost
    InstanceSigs
    KindSignatures
    LambdaCase
    MultiParamTypeClasses
    MultiWayIf
    NamedFieldPuns
    NumericUnderscores
    OverloadedStrings
    ScopedTypeVariables
    StandaloneDeriving
    TupleSections
  ghc-options:
    -fwarn-tabs
    -Wall
    -Wcompat
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns
    -Wpartial-fields
    -Wredundant-constraints

library
  import: lang
  exposed-modules:
    GenAILib
    GenAILib.HTTP
    GenAILib.JSON
    GenAILib.Ollama
    GenAILib.OpenAI
  hs-source-dirs:
    src/lib
  build-depends:
      aeson >= 2.1.2.1 && < 2.3
    , base >= 4.18.1.0 && < 5
    , bytestring >= 0.11.5.2 && < 0.12
    , containers >= 0.6.7 && < 0.7
    , http-client >= 0.7.16 && < 0.8
    , http-client-tls >= 0.3.6.3 && < 0.4
    , scientific >= 0.3.7.0 && < 0.4
    , servant >= 0.20.1 && < 0.21
    , servant-client >= 0.20 && < 0.21
    , servant-client-core >= 0.20 && < 0.21
    , string-conv >= 0.2.0 && < 0.3
    , text >= 2.0.2 && < 3
    , time >= 1.12.2 && < 1.13

executable ex-genai-ollama
  import: lang
  main-is: ex-genai-ollama.hs
  hs-source-dirs:
    src/example
  build-depends:
      base >= 4.18.1.0 && < 5
    , genai-lib
    , text >= 2.0.2 && < 3

executable ex-genai-openai
  import: lang
  main-is: ex-genai-openai.hs
  hs-source-dirs:
    src/example
  build-depends:
      base >= 4.18.1.0 && < 5
    , genai-lib
    , text >= 2.0.2 && < 3