interfAIce
1.0.1
ตรวจสอบโพสต์บล็อกของฉันที่แนะนำ interfAIce
ในไฟล์ 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
ให้กับคลาสแอปพลิเคชัน spring boot ของคุณหรือคลาสการกำหนดค่าใด ๆ @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)
}
}
interfAIce จัดเตรียมเวอร์ชันสแน็ปช็อตที่เผยแพร่โดยอัตโนมัติเมื่อการเปลี่ยนแปลงถูกพุชไปยังสาขาหลัก เวอร์ชันสแน็ปช็อตปัจจุบันเป็นเวอร์ชันรองถัดไปของเวอร์ชันรีลีสปัจจุบันซึ่งมีคำต่อท้าย -SNAPSHOT ตัวอย่างเช่น หากรุ่นปัจจุบันคือ 1.2.3 เวอร์ชันสแน็ปช็อตจะเป็น 1.3.0-SNAPSHOT
หากต้องการใช้เวอร์ชันสแนปช็อต ให้เพิ่มพื้นที่เก็บข้อมูล Maven Snapshot ลงในการกำหนดค่าบิวด์ของคุณ
repositories {
maven {
url = uri( " https://s01.oss.sonatype.org/content/repositories/snapshots/ " )
}
}
ยินดีบริจาค! โปรดดูหลักเกณฑ์การมีส่วนร่วมของเราสำหรับข้อมูลเพิ่มเติม
โครงการนี้ได้รับอนุญาตภายใต้ลิขสิทธิ์ Apache 2.0