Skip to main content

genai-apis

# openai, gemini, gemini-vertex, anthropic, anthropic-vertex, anthropic-bedrock
# !pip install genai-apis[openai]

kwargs = {
  "api_key": "..."
  "GCP_PROJECT_ID": "...",
  "GCP_LOCATION": "...",
  "AWS_LOCATION": "..."
}

extra_kwargs = {
  ...
  stream=False
}

service = "openai"
model = "gpt-4-turbo-2024-04-09"
prompt = "Hello!!"

# openai, 
# gemini, gemini-vertex, 
# anthropic, anthropic-bedrock, anthropic-vertex
api_client = APIFactory.get_api_client(service, **kwargs)
result = await api_client.generate_text(model, prompt, **extra_kwargs)
print(result)

# for stream
async for chunk in result:
    print(chunk, end='')

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genai_apis-0.0.10-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file genai_apis-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: genai_apis-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for genai_apis-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9fa2a3742196e445e59186693f12c440953699524ff735eda948e9fb414c9bd9
MD5 326a5b91d31403c96106485cdf85cac6
BLAKE2b-256 9c86eb1f05eb00e3c46a7dc9aae9747a1cbe5cf6cc6e6613c0c2966d88e02128

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.10 This release

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page