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
주석을 추가하십시오. @EnableInterfaiceProxies(
basePackages = [ " io.github.mscheong01.interfaice.examples " ]
)
@SpringBootApplication
open class ExampleApplication
application.yml
파일에 OpenAi API 키를 지정하세요. 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 스냅샷 저장소를 추가하세요.
repositories {
maven {
url = uri( " https://s01.oss.sonatype.org/content/repositories/snapshots/ " )
}
}
기여를 환영합니다! 자세한 내용은 기여 지침을 참조하세요.
이 프로젝트는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다.