인터페이스
DownloadCallback |
모델 다운로드에 사용되는 콜백 함수입니다. |
Part |
요청에 전송되고 요청에서 수신되는 데이터를 나타내는 인터페이스입니다. |
클래스
Candidate |
모델의 응답 일부입니다. |
Content |
모델에 전송되고 모델에서 수신되는 콘텐츠를 나타냅니다. |
Content.Builder |
|
DownloadConfig |
시스템 모델 다운로드에 사용할 구성 매개변수입니다. |
GenerateContentResponse |
모델의 응답을 나타냅니다. |
GenerationConfig |
콘텐츠 생성에 사용할 구성 매개변수입니다. |
GenerationConfig.Builder |
|
GenerativeModel |
지정된 시스템 모델의 진행자입니다. |
TextPart |
요청에 전송되고 요청에서 수신되는 텍스트 또는 문자열 기반 데이터를 나타냅니다. |
예외
ConnectionException |
연결 중에 오류가 발생했습니다. |
DownloadException |
다운로드 중 오류가 발생했습니다. |
GenerativeAIException |
|
InferenceException |
추론 중에 오류가 발생했습니다. |
PreparationException |
준비 중 오류가 발생했습니다. |
TokenizationException |
토큰화 중에 오류가 발생했습니다. |
UnknownException |
알 수 없는 오류입니다. |
주석
Candidate.FinishReason |
|
Content.Role |
|
GenerativeAIException.ErrorCode |
|
최상위 함수 요약
Content |
content(@Content.Role role: Int, init: Content.Builder.() -> Unit) DSL과 같은 방식으로 전송되고 수신되는 콘텐츠를 생성하는 함수입니다. |
GenerationConfig |
generationConfig(init: GenerationConfig.Builder.() -> Unit) DSL과 같은 방식으로 |
확장 함수 요약
최상위 함수
콘텐츠
fun content(@Content.Role role: Int = Role.USER, init: Content.Builder.() -> Unit): Content
DSL과 같은 방식으로 전송되고 수신되는 콘텐츠를 생성하는 함수입니다.
텍스트, 이미지, 바이너리 부분 모음을 포함합니다.
사용 예:
content(Role.MODEL) {
text("Example string")
)
generationConfig
fun generationConfig(init: GenerationConfig.Builder.() -> Unit): GenerationConfig
DSL과 같은 방식으로 GenerationConfig
를 구성하는 도우미 메서드입니다.
사용 예:
generationConfig {
context = context // required
workerExecutor = workerThread // Set the [ExecutorService] on which background tasks should be run. If no value is specified, a background thread pool will be used.
callbackExecutor = callbackExecutor // Set the [Executor] on which callbacks should be invoked. If no value is specified, callbacks will be invoked on the UI thread.
temperature = 0.75f
topK = 30
candidateCount = 4
maxOutputTokens = 300
stopSequences = listOf("in conclusion", "-----", "do you need")
}