在哪里可以找到projects.openaiClient的定义?

以下示例代码来自OpenAI API Kotlin客户端项目。

您可以在https://github.com/aallam/openai-kotlin/tree/main/sample/native查看它

我在Android Studio中打开了示例代码,但找不到作者定义implementation(projects.openaiClient)的地方,我已经搜索了整个项目,你能告诉我吗?

build.gradle.kts

plugins {    kotlin("multiplatform")}kotlin {    val hostOs = System.getProperty("os.name")    val isMingwX64 = hostOs.startsWith("Windows")    val nativeTarget = when {        hostOs == "Mac OS X" -> macosX64("native")        hostOs == "Linux" -> linuxX64("native")        isMingwX64 -> mingwX64("native")        else -> throw GradleException("Host OS is not supported in Kotlin/Native.")    }    nativeTarget.apply {        binaries {            executable {                entryPoint = "main"            }        }    }    sourceSets {        val nativeMain by getting {            dependencies {                //implementation("com.aallam.openai:openai-client:<version>")                implementation(projects.openaiClient)   // projects.openaiClient在哪里                implementation(libs.ktor.client.curl)   // libs.ktor.client.curl在哪里            }        }    }}

回答:

openai-client子项目位于这里。在settings.gradle.kts中添加了包含设置。

在示例代码中,作者使用了一种称为类型安全项目访问器的东西:

带有连字符案例(some-lib)或蛇形案例(some_lib)的项目名称将在访问器中转换为驼峰案例:projects.someLib。

这意味着可以使用projects.openaiClient来添加依赖项。

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注