com.google.ai.edge.aicore


인터페이스

DownloadCallback

모델 다운로드에 사용되는 콜백 함수입니다.

Part

요청에 전송되고 요청에서 수신되는 데이터를 나타내는 인터페이스입니다.

클래스

Candidate

모델의 응답 일부입니다.

Content

모델에 전송되고 모델에서 수신되는 콘텐츠를 나타냅니다.

Content.Builder
DownloadConfig

시스템 모델 다운로드에 사용할 구성 매개변수입니다.

GenerateContentResponse

모델의 응답을 나타냅니다.

GenerationConfig

콘텐츠 생성에 사용할 구성 매개변수입니다.

GenerationConfig.Builder
GenerativeModel

지정된 시스템 모델의 진행자입니다.

TextPart

요청에 전송되고 요청에서 수신되는 텍스트 또는 문자열 기반 데이터를 나타냅니다.

예외

ConnectionException

연결 중에 오류가 발생했습니다.

DownloadException

다운로드 중 오류가 발생했습니다.

GenerativeAIException

GenerativeModel에서 발생하는 오류의 상위 클래스입니다.

InferenceException

추론 중에 오류가 발생했습니다.

PreparationException

준비 중 오류가 발생했습니다.

TokenizationException

토큰화 중에 오류가 발생했습니다.

UnknownException

알 수 없는 오류입니다.

주석

Candidate.FinishReason

Candidate와 연결된 완료 이유

Content.Role

Content와 연결된 역할

GenerativeAIException.ErrorCode

GenerativeAIException 오류 코드 집합입니다.

최상위 함수 요약

Content
content(@Content.Role role: Int, init: Content.Builder.() -> Unit)

DSL과 같은 방식으로 전송되고 수신되는 콘텐츠를 생성하는 함수입니다.

GenerationConfig

DSL과 같은 방식으로 GenerationConfig를 구성하는 도우미 메서드입니다.

확장 함수 요약

최상위 함수

콘텐츠

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")
}

확장 함수

asTextOrNull

fun Part.asTextOrNull(): String?
반환 값
String?

텍스트를 나타내는 경우 String로, 그렇지 않은 경우에는 null로 표시되는 부분