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

Conversation

os-esh
Copy link

@os-esh os-esh commented Jul 28, 2023

Feature: Api root for working with Vertex AI

@os-esh
Copy link
Author

os-esh commented Oct 30, 2023

Here example, how to check the service:

using GoogleCloud
const DEFAULT_REGION = "us-central1"
const CREDENTIALS = JSONCredentials("credentials.json")
const GOOGLE_SESSION = GoogleSession(CREDENTIALS, ["cloud-platform"])

set_session!(text_service, GOOGLE_SESSION)

model_params = (
  temperature=0.7,
  maxOutputTokens=200,
  topP=0.7,
  topK=40
)

params = Dict(
  :instances => [
    Dict(:prompt => "Tell about yourself")
  ],
  :parameters => model_params
)

response = text_service(
  :PALM,
  :predict,
  DEFAULT_REGION,
  CREDENTIALS.project_id,
  DEFAULT_REGION,
  GoogleCloud.BISON_TEXT_MODEL_NAME,
  data=params
)

@aviks
Copy link

aviks commented Dec 7, 2023

Hi @quinnj or @mattBrzezinski would either of you be able to take a look at this? Thanks!

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine? Is there any way to add some kind of test? Just to ensure it can load even?

@rssdev10
Copy link

rssdev10 commented Dec 10, 2023

@quinnj for real testing here we need an active API KEY. I think it is possible to add some tests if there is a way to enable real use of API KEY in CI. Otherwise, only mock tests with examples of data to be returned are possible.

E.g. this way we use for tests with external OpenAI API calls - https://github.com/OpenSesame/GptSearchPlugin/blob/main/test/helpers/mocking.jl#L7-L18 .

@quinnj
Copy link
Member

quinnj commented Dec 24, 2023

Yeah, I was thinking just mock tests would be great.

@os-esh os-esh requested a review from quinnj January 11, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants