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

feat(generative_ai): Add code completion example #11809

Merged
merged 11 commits into from
Jun 3, 2024
Prev Previous commit
Next Next commit
feat(generative_ai): implement reviewers suggestions
* improve example prompts
  • Loading branch information
msampathkumar committed May 31, 2024
commit f859e37dcab6ea9740ad70fd739624cb9d3d0404
2 changes: 1 addition & 1 deletion generative_ai/chat_completion/non_streaming_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def example(project_id: str, location: str = "us-central1") -> str:

response = client.chat.completions.create(
model="google/gemini-1.5-flash-001",
messages=[{"role": "user", "content": "Who are you?"}],
messages=[{"role": "user", "content": "Why is the sky blue?"}],
)

print(response)
Expand Down
2 changes: 1 addition & 1 deletion generative_ai/chat_completion/streaming_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def example(project_id: str, location: str = "us-central1") -> str:

responses = client.chat.completions.create(
model="google/gemini-1.5-flash-001",
messages=[{"role": "user", "content": "Who are you?"}],
messages=[{"role": "user", "content": "What's 1+1? Answer in one word."}],
stream=True,
)
for chunk in responses:
Expand Down
Loading