interfAIce
1.0.1
تحقق من مشاركة مدونتي التي تقدم الواجهة
في ملف build.gradle.kts
الخاص بمشروعك، أضف ما يلي:
dependencies {
implementation( " io.github.mscheong01:interfAIce-core:1.0.0 " )
}
// This option is currently required for reflection to work
// Later releases will remove this requirement for Kotlin projects
tasks.withType< KotlinCompile > {
this .kotlinOptions {
freeCompilerArgs = listOf ( " -Xjsr305=strict " )
javaParameters = true
}
}
dependencies {
implementation( " io.github.mscheong01:interfAIce-core:1.0.0 " )
}
// This option is currently required for reflection to work
// If all your classes have a no-arg constructor, you can remove this option
tasks.withType< JavaCompile > {
options.compilerArgs.add( " -parameters " )
}
dependencies {
implementation( " io.github.mscheong01:interfAIce-spring-boot-starter:1.0.0 " )
}
@EnableInterfaiceProxies
إلى فئة تطبيق التشغيل الربيعي أو أي من فئات التكوين الخاصة به @EnableInterfaiceProxies(
basePackages = [ " io.github.mscheong01.interfaice.examples " ]
)
@SpringBootApplication
open class ExampleApplication
application.yml
spring :
interfaice :
openai :
api-key : ${OPENAI_API_KEY}
chat :
default-model : gpt-3.5-turbo # optional, defaults to gpt-3.5-turbo
@OpenAiInterface
إلى الواجهة الخاصة بك @OpenAiInterface
interface ExampleInterface {
fun greet ( name : String ): String
}
@RestController
class ExampleController (
private val exampleInterface : ExampleInterface
) {
@GetMapping( " /greet " )
fun greet (@RequestParam name : String ): String {
return exampleInterface.greet(name)
}
}
توفر الواجهة إصدارات سريعة يتم إصدارها تلقائيًا عند دفع التغييرات إلى الفرع الرئيسي. إصدار اللقطة الحالي هو الإصدار الثانوي التالي من إصدار الإصدار الحالي مع لاحقة -SNAPSHOT. على سبيل المثال، إذا كان الإصدار الحالي هو 1.2.3، فسيكون إصدار اللقطة هو 1.3.0-SNAPSHOT.
لاستخدام إصدارات اللقطات، قم بإضافة مستودع اللقطات المخضرم إلى تكوين الإصدار الخاص بك
repositories {
maven {
url = uri( " https://s01.oss.sonatype.org/content/repositories/snapshots/ " )
}
}
المساهمات هي موضع ترحيب! يرجى الاطلاع على إرشادات المساهمة الخاصة بنا لمزيد من المعلومات.
تم ترخيص هذا المشروع بموجب ترخيص Apache 2.0.