docs: Add sample code - #91
Conversation
|
Another thing to note: I'm currently using a .env file for config that's supposed to lie in the |
Probably I missed it since I am a python sdk newbie. But why is there a .env already at repo root? In JS and Java, we just put .env in sample code and smoke test packages only as these are the only apps that need the credential? |
|
I don't know of any current .env at the repo root but maybe I missed that. This was just a question where the .env file should lie if we recommend using that for auth in the sample code. |
Java and JS stores the |
ZhongpinWang
left a comment
There was a problem hiding this comment.
In general look good to me. @mwien Anything left in your mind before we can merge it? Should we turn the PR from draft to review ready?
ZhongpinWang
left a comment
There was a problem hiding this comment.
lgtm, further sample code can be added later.
Closes SAP/ai-sdk-python-backlog#5.
Follow-up for adding more samples SAP/ai-sdk-python-backlog#27.
This PR adds example code that showcases usage of the SDK by exposing HTTP endpoints via a FastAPI application. Similar sample code exists for the other two AI SDKs.
This is a draft PR. The architecture/integration of the sample code may be up to discussion and more features should be added.
Currently, examples are included for the following services:
The following additions are planned:
Open things/questions up for discussion:
sample_codepackage be part of the root workspace? This is how it is currently proposed. It would be useful for using it for end-to-end smoke tests.pyrightconfig.jsonto the sample code repo for Pyright to find thebase,coreandgenpackages. Maybe there are better solutions.OrchestrationServiceclient is created for each orchestration request. How should the correct cleanup look like (for example with regard to theclose_http_connectionmethod, which only closes the sync client)?