Skip to content

Commit

Permalink
added deferred response api
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuliano committed Oct 4, 2024
1 parent 422ea4e commit fe55044
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 13 deletions.
1 change: 1 addition & 0 deletions deps/pkl/APIServer.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ class APIServerRoutes {
"GET"
}
responseType: APIServerResponseType = "json"
deferredApi: Boolean? = false
}
23 changes: 23 additions & 0 deletions deps/pkl/APIServerDeferredResponse.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@go.Package { name = "github.com/kdeps/schema/gen/api_server_deferred_response" }

module org.kdeps.pkl.APIServerDeferredResponse

import "package://pkg.pkl-lang.org/pkl-go/[email protected]#/go.pkl"

resource: Mapping<UInt32, APIServerDeferred>

class APIServerDeferredResponseBlock {
data: Listing<Any>
}

class APIServerDeferredErrorsBlock {
code: Int
message: String
}

class APIServerDeferred {
success: Boolean = false
resolved: Boolean = false
response: APIServerDeferredResponseBlock?
errors: APIServerDeferredErrorsBlock?
}
1 change: 1 addition & 0 deletions deps/pkl/Exec.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ class ResourceExec {
stderr: String?
stdout: String?
timestamp: UInt32?
timeoutSeconds: Int? = 60
}
7 changes: 3 additions & 4 deletions deps/pkl/Http.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ class ResourceHTTPClient {

method: String(isValidHTTPMethod)
url: Uri
data: String?
data: Listing<String>?
headers: Mapping<String, String>?
response: String?
responseData: String?
responseBody: String?
responseData: Listing<String>?
responseHeaders: Mapping<String, String>?
timestamp: UInt32?
timeoutSeconds: Int? = 60
}
1 change: 0 additions & 1 deletion deps/pkl/Kdeps.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ typealias Path = "user"|"project"|"xdg"

runMode: RunMode = "docker"
dockerGPU: GPU = "cpu"
llmTimeoutSeconds: Int = 30
kdepsDir: String = ".kdeps"
kdepsPath: Path = "user"
1 change: 1 addition & 0 deletions deps/pkl/LLM.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ class ResourceChat {
prompt: String
response: String?
timestamp: UInt32?
timeoutSeconds: Int? = 60
}
2 changes: 2 additions & 0 deletions gen/api_server/APIServerRoutes.pkl.go

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

12 changes: 12 additions & 0 deletions gen/api_server_deferred_response/APIServerDeferred.pkl.go

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

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

37 changes: 37 additions & 0 deletions gen/api_server_deferred_response/APIServerDeferredResponse.pkl.go

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

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

11 changes: 11 additions & 0 deletions gen/api_server_deferred_response/init.pkl.go

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

2 changes: 2 additions & 0 deletions gen/exec/ResourceExec.pkl.go

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

10 changes: 4 additions & 6 deletions gen/http/ResourceHTTPClient.pkl.go

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

2 changes: 0 additions & 2 deletions gen/kdeps/Kdeps.pkl.go

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

2 changes: 2 additions & 0 deletions gen/llm/ResourceChat.pkl.go

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

0 comments on commit fe55044

Please sign in to comment.