# genai-apis
```python
# 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='')
```
Raw data
{
"_id": null,
"home_page": "https://github.com/deep-diver/genai-apis",
"name": "genai-apis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "genai",
"author": "chansung park",
"author_email": "deep.diver.csp@gmail.com",
"download_url": null,
"platform": null,
"description": "# genai-apis\n\n```python\n# openai, gemini, gemini-vertex, anthropic, anthropic-vertex, anthropic-bedrock\n# !pip install genai-apis[openai]\n\nkwargs = {\n \"api_key\": \"...\"\n \"GCP_PROJECT_ID\": \"...\",\n \"GCP_LOCATION\": \"...\",\n \"AWS_LOCATION\": \"...\"\n}\n\nextra_kwargs = {\n ...\n stream=False\n}\n\nservice = \"openai\"\nmodel = \"gpt-4-turbo-2024-04-09\"\nprompt = \"Hello!!\"\n\n# openai, \n# gemini, gemini-vertex, \n# anthropic, anthropic-bedrock, anthropic-vertex\napi_client = APIFactory.get_api_client(service, **kwargs)\nresult = await api_client.generate_text(model, prompt, **extra_kwargs)\nprint(result)\n\n# for stream\nasync for chunk in result:\n print(chunk, end='')\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "GenAI APIs provides a unified API callers to Gemini API, OpenAI API, and Anthropic API.",
"version": "0.0.10",
"project_urls": {
"Homepage": "https://github.com/deep-diver/genai-apis"
},
"split_keywords": [
"genai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9c86eb1f05eb00e3c46a7dc9aae9747a1cbe5cf6cc6e6613c0c2966d88e02128",
"md5": "326a5b91d31403c96106485cdf85cac6",
"sha256": "9fa2a3742196e445e59186693f12c440953699524ff735eda948e9fb414c9bd9"
},
"downloads": -1,
"filename": "genai_apis-0.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "326a5b91d31403c96106485cdf85cac6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 9089,
"upload_time": "2024-07-03T00:13:17",
"upload_time_iso_8601": "2024-07-03T00:13:17.446690Z",
"url": "https://files.pythonhosted.org/packages/9c/86/eb1f05eb00e3c46a7dc9aae9747a1cbe5cf6cc6e6613c0c2966d88e02128/genai_apis-0.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-03 00:13:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deep-diver",
"github_project": "genai-apis",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "genai-apis"
}