Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text_service #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GoogleCloud"
uuid = "55e21f81-8b0a-565e-b5ad-6816892a5ee7"
version = "0.11.1"
version = "0.11.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
9 changes: 7 additions & 2 deletions src/GoogleCloud.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export
JSONCredentials, MetadataCredentials, GoogleSession, authorize,
set_session!, get_session
export
iam, storage, compute, container, pubsub, logging, datastore
iam, storage, compute, container, pubsub, logging, datastore, text_service
export
BISON_TEXT_MODEL_NAME, GEKKO_EMBEDDING_MODEL_NAME
export
KeyStore, commit!, fetch!, sync!, clearcache!, clearpending!, destroy!, connect!, watch, unwatch

Expand All @@ -33,6 +35,9 @@ import .api:
_container.container,
_pubsub.pubsub,
_logging.logging,
_datastore.datastore
_datastore.datastore,
_text_service.text_service

using .api._text_service: BISON_TEXT_MODEL_NAME, GEKKO_EMBEDDING_MODEL_NAME

end
1 change: 1 addition & 0 deletions src/api/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,6 @@ include("container.jl")
include("pubsub.jl")
include("logging.jl")
include("datastore.jl")
include("text_service.jl")

end
24 changes: 24 additions & 0 deletions src/api/text_service.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module _text_service

export text_service, BISON_TEXT_MODEL_NAME, GEKKO_EMBEDDING_MODEL_NAME

using ..api
using ...root

const BISON_TEXT_MODEL_NAME = "text-bison"
const GEKKO_EMBEDDING_MODEL_NAME = "textembedding-gecko"


text_service = APIRoot(
"https://{region}-aiplatform.googleapis.com/v1/projects/{project_id}",
Dict{String,String}(
"cloud-platform" => "Full access",
"cloud-platform.read-only" => "Read only"
),
PALM=APIResource(
"locations/{region}/publishers/google/models/{model_name}:predict",
predict=APIMethod(:POST, "", "Perform an online prediction.")
)
)

end