Skip to content

Commit

Permalink
fix: java code compilation and imports not working issue
Browse files Browse the repository at this point in the history
  • Loading branch information
varuntandon-ql committed Sep 25, 2023
1 parent 7db93b9 commit 49734c3
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 142 deletions.
9 changes: 5 additions & 4 deletions gen/go/gateway/v1/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gateway.v1
package com.basemind.client

import gateway.v1.APIGatewayServiceGrpc.getServiceDescriptor
import com.basemind.client.APIGatewayServiceGrpc.getServiceDescriptor
import io.grpc.CallOptions
import io.grpc.CallOptions.DEFAULT
import io.grpc.Channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package gateway.v1;
package com.basemind.client;
37 changes: 37 additions & 0 deletions gen/kt/com/basemind/client/PromptConfigRequestKt.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: gateway/v1/gateway.proto

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.basemind.client;

@kotlin.jvm.JvmName("-initializepromptConfigRequest")
public inline fun promptConfigRequest(block: com.basemind.client.PromptConfigRequestKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptConfigRequest =
com.basemind.client.PromptConfigRequestKt.Dsl._create(com.basemind.client.Gateway.PromptConfigRequest.newBuilder()).apply { block() }._build()
/**
* ```
* A request for a prompt configuration - retrieving the expected prompt variables
* ```
*
* Protobuf type `gateway.v1.PromptConfigRequest`
*/
public object PromptConfigRequestKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.basemind.client.Gateway.PromptConfigRequest.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.basemind.client.Gateway.PromptConfigRequest.Builder): Dsl = Dsl(builder)
}

@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.basemind.client.Gateway.PromptConfigRequest = _builder.build()
}
}
@kotlin.jvm.JvmSynthetic
public inline fun com.basemind.client.Gateway.PromptConfigRequest.copy(block: `com.basemind.client`.PromptConfigRequestKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptConfigRequest =
`com.basemind.client`.PromptConfigRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package gateway.v1;
package com.basemind.client;

@kotlin.jvm.JvmName("-initializepromptConfigResponse")
public inline fun promptConfigResponse(block: gateway.v1.PromptConfigResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptConfigResponse =
gateway.v1.PromptConfigResponseKt.Dsl._create(gateway.v1.Gateway.PromptConfigResponse.newBuilder()).apply { block() }._build()
public inline fun promptConfigResponse(block: com.basemind.client.PromptConfigResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptConfigResponse =
com.basemind.client.PromptConfigResponseKt.Dsl._create(com.basemind.client.Gateway.PromptConfigResponse.newBuilder()).apply { block() }._build()
/**
* ```
* A response for a prompt configuration - retrieving the expected prompt variables
Expand All @@ -19,17 +19,17 @@ public object PromptConfigResponseKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: gateway.v1.Gateway.PromptConfigResponse.Builder
private val _builder: com.basemind.client.Gateway.PromptConfigResponse.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: gateway.v1.Gateway.PromptConfigResponse.Builder): Dsl = Dsl(builder)
internal fun _create(builder: com.basemind.client.Gateway.PromptConfigResponse.Builder): Dsl = Dsl(builder)
}

@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): gateway.v1.Gateway.PromptConfigResponse = _builder.build()
internal fun _build(): com.basemind.client.Gateway.PromptConfigResponse = _builder.build()

/**
* An uninstantiable, behaviorless type to represent the field in
Expand Down Expand Up @@ -131,5 +131,5 @@ public object PromptConfigResponseKt {
}}
}
@kotlin.jvm.JvmSynthetic
public inline fun gateway.v1.Gateway.PromptConfigResponse.copy(block: `gateway.v1`.PromptConfigResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptConfigResponse =
`gateway.v1`.PromptConfigResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public inline fun com.basemind.client.Gateway.PromptConfigResponse.copy(block: `com.basemind.client`.PromptConfigResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptConfigResponse =
`com.basemind.client`.PromptConfigResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package gateway.v1;
package com.basemind.client;

@kotlin.jvm.JvmName("-initializepromptRequest")
public inline fun promptRequest(block: gateway.v1.PromptRequestKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptRequest =
gateway.v1.PromptRequestKt.Dsl._create(gateway.v1.Gateway.PromptRequest.newBuilder()).apply { block() }._build()
public inline fun promptRequest(block: com.basemind.client.PromptRequestKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptRequest =
com.basemind.client.PromptRequestKt.Dsl._create(com.basemind.client.Gateway.PromptRequest.newBuilder()).apply { block() }._build()
/**
* ```
* A request for a prompt - sending user input to the server.
Expand All @@ -19,17 +19,17 @@ public object PromptRequestKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: gateway.v1.Gateway.PromptRequest.Builder
private val _builder: com.basemind.client.Gateway.PromptRequest.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: gateway.v1.Gateway.PromptRequest.Builder): Dsl = Dsl(builder)
internal fun _create(builder: com.basemind.client.Gateway.PromptRequest.Builder): Dsl = Dsl(builder)
}

@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): gateway.v1.Gateway.PromptRequest = _builder.build()
internal fun _build(): com.basemind.client.Gateway.PromptRequest = _builder.build()

/**
* An uninstantiable, behaviorless type to represent the field in
Expand Down Expand Up @@ -124,5 +124,5 @@ public object PromptRequestKt {
}
}
@kotlin.jvm.JvmSynthetic
public inline fun gateway.v1.Gateway.PromptRequest.copy(block: `gateway.v1`.PromptRequestKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptRequest =
`gateway.v1`.PromptRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public inline fun com.basemind.client.Gateway.PromptRequest.copy(block: `com.basemind.client`.PromptRequestKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptRequest =
`com.basemind.client`.PromptRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package gateway.v1;
package com.basemind.client;

@kotlin.jvm.JvmName("-initializepromptResponse")
public inline fun promptResponse(block: gateway.v1.PromptResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptResponse =
gateway.v1.PromptResponseKt.Dsl._create(gateway.v1.Gateway.PromptResponse.newBuilder()).apply { block() }._build()
public inline fun promptResponse(block: com.basemind.client.PromptResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptResponse =
com.basemind.client.PromptResponseKt.Dsl._create(com.basemind.client.Gateway.PromptResponse.newBuilder()).apply { block() }._build()
/**
* ```
* A Prompt Response Message
Expand All @@ -19,17 +19,17 @@ public object PromptResponseKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: gateway.v1.Gateway.PromptResponse.Builder
private val _builder: com.basemind.client.Gateway.PromptResponse.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: gateway.v1.Gateway.PromptResponse.Builder): Dsl = Dsl(builder)
internal fun _create(builder: com.basemind.client.Gateway.PromptResponse.Builder): Dsl = Dsl(builder)
}

@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): gateway.v1.Gateway.PromptResponse = _builder.build()
internal fun _build(): com.basemind.client.Gateway.PromptResponse = _builder.build()

/**
* ```
Expand Down Expand Up @@ -83,5 +83,5 @@ public object PromptResponseKt {
}
}
@kotlin.jvm.JvmSynthetic
public inline fun gateway.v1.Gateway.PromptResponse.copy(block: `gateway.v1`.PromptResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.PromptResponse =
`gateway.v1`.PromptResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public inline fun com.basemind.client.Gateway.PromptResponse.copy(block: `com.basemind.client`.PromptResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.PromptResponse =
`com.basemind.client`.PromptResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package gateway.v1;
package com.basemind.client;

@kotlin.jvm.JvmName("-initializestreamingPromptResponse")
public inline fun streamingPromptResponse(block: gateway.v1.StreamingPromptResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.StreamingPromptResponse =
gateway.v1.StreamingPromptResponseKt.Dsl._create(gateway.v1.Gateway.StreamingPromptResponse.newBuilder()).apply { block() }._build()
public inline fun streamingPromptResponse(block: com.basemind.client.StreamingPromptResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.StreamingPromptResponse =
com.basemind.client.StreamingPromptResponseKt.Dsl._create(com.basemind.client.Gateway.StreamingPromptResponse.newBuilder()).apply { block() }._build()
/**
* ```
* An Streaming Prompt Response Message
Expand All @@ -19,17 +19,17 @@ public object StreamingPromptResponseKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: gateway.v1.Gateway.StreamingPromptResponse.Builder
private val _builder: com.basemind.client.Gateway.StreamingPromptResponse.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: gateway.v1.Gateway.StreamingPromptResponse.Builder): Dsl = Dsl(builder)
internal fun _create(builder: com.basemind.client.Gateway.StreamingPromptResponse.Builder): Dsl = Dsl(builder)
}

@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): gateway.v1.Gateway.StreamingPromptResponse = _builder.build()
internal fun _build(): com.basemind.client.Gateway.StreamingPromptResponse = _builder.build()

/**
* ```
Expand Down Expand Up @@ -130,5 +130,5 @@ public object StreamingPromptResponseKt {
}
}
@kotlin.jvm.JvmSynthetic
public inline fun gateway.v1.Gateway.StreamingPromptResponse.copy(block: `gateway.v1`.StreamingPromptResponseKt.Dsl.() -> kotlin.Unit): gateway.v1.Gateway.StreamingPromptResponse =
`gateway.v1`.StreamingPromptResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public inline fun com.basemind.client.Gateway.StreamingPromptResponse.copy(block: `com.basemind.client`.StreamingPromptResponseKt.Dsl.() -> kotlin.Unit): com.basemind.client.Gateway.StreamingPromptResponse =
`com.basemind.client`.StreamingPromptResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build()
37 changes: 0 additions & 37 deletions gen/kt/gateway/v1/PromptConfigRequestKt.kt

This file was deleted.

10 changes: 9 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
[versions]
androidGradlePlugin = "8.1.1"
appcompat = "1.6.1"
coreKtx = "1.12.0"
espressoCore = "3.5.1"
grpcVersion = "1.58.0"
junit = "4.13.2"
junitVersion = "1.1.5"
androidGradlePlugin = "8.1.1"
kotlinVersion = "1.9.0"
protobufVersion = "0.9.4"
grpcKotlinVersion = "1.3.1"

[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
grpc-okhttp = { module = "io.grpc:grpc-okhttp", version.ref = "grpcVersion" }
grpc-protobuf-lite = { module = "io.grpc:grpc-protobuf-lite", version.ref = "grpcVersion" }
grpc-stub = { module = "io.grpc:grpc-stub", version.ref = "grpcVersion" }
grpc-kotlin-stub = { module = "io.grpc:grpc-kotlin-stub", version.ref = "grpcKotlinVersion" }
junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
protobuf = { id = "com.google.protobuf", version.ref = "protobufVersion" }

[bundles]
1 change: 1 addition & 0 deletions proto/gateway/v1/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package gateway.v1;

option go_package = "github.com/basemind-ai/monorepo/gen/gateway";
option java_package = "com.basemind.client";

// The API Gateway service definition.
service APIGatewayService {
Expand Down
6 changes: 5 additions & 1 deletion sdks/android/sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ dependencies {
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation(libs.grpc.okhttp)
implementation(libs.grpc.protobuf.lite)
implementation(libs.grpc.stub)
implementation(libs.grpc.kotlin.stub)
}

// root directories
Expand All @@ -47,7 +51,7 @@ private val androidSdkDir = "$androidCoreDir/sdk"
private val androidSdkMainDir = "$androidSdkDir/src/main/java/com/basemind/client"

// directories in focus
private val genKtGatewayDir = "$rootDir/gen/kt/gateway/v1"
private val genKtGatewayDir = "$rootDir/gen/kt/com/basemind/client"
private val copyDestinationGatewayDir = "$androidSdkMainDir/gateway"
private val copyDestinationPModelsDir = "$androidSdkMainDir/promptModels"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.basemind.client.source

import com.basemind.client.APIGatewayServiceGrpc
import io.grpc.ManagedChannelBuilder

const val PORT = 8980
val channel = ManagedChannelBuilder.forAddress("localhost", PORT).usePlaintext().build()
var stub = APIGatewayServiceGrpc.newBlockingStub(channel)

0 comments on commit 49734c3

Please sign in to comment.