|
| 1 | +# AgentHub Examples |
| 2 | + |
| 3 | +This folder contains examples for OCI Generative AI AgentHub APIs using the OpenAI Python SDK. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Install dependencies: |
| 8 | + |
| 9 | + ```bash |
| 10 | + pip install -e '.[dev]' |
| 11 | + ``` |
| 12 | + |
| 13 | +2. Configure shared values in `examples/agenthub/common.py`: |
| 14 | + - `PROFILE_NAME` |
| 15 | + - `COMPARTMENT_ID` |
| 16 | + - `PROJECT_OCID` |
| 17 | + - `REGION` |
| 18 | + |
| 19 | +3. (Optional) You can override project at runtime: |
| 20 | + |
| 21 | + ```bash |
| 22 | + export OCI_GENAI_PROJECT_ID=<your_project_ocid> |
| 23 | + ``` |
| 24 | + |
| 25 | +4. If running API-key based examples, set: |
| 26 | + |
| 27 | + ```bash |
| 28 | + export OPENAI_API_KEY=<your_oci_genai_api_key> |
| 29 | + ``` |
| 30 | + |
| 31 | +## How to run |
| 32 | + |
| 33 | +From repository root, run any example module with `python -m`. |
| 34 | + |
| 35 | +Quickstarts: |
| 36 | + |
| 37 | +```bash |
| 38 | +python -m examples.agenthub.quickstart_responses_create_oci_iam |
| 39 | +python -m examples.agenthub.quickstart_responses_create_api_key |
| 40 | +``` |
| 41 | + |
| 42 | +Responses API examples: |
| 43 | + |
| 44 | +```bash |
| 45 | +python -m examples.agenthub.responses.create_response |
| 46 | +python -m examples.agenthub.responses.streaming_text_delta |
| 47 | +python -m examples.agenthub.responses.structured_output |
| 48 | +python -m examples.agenthub.responses.use_gpt_model |
| 49 | +python -m examples.agenthub.responses.use_google_gemini_model |
| 50 | +``` |
| 51 | + |
| 52 | +Tools examples: |
| 53 | + |
| 54 | +```bash |
| 55 | +python -m examples.agenthub.tools.function_calling |
| 56 | +python -m examples.agenthub.tools.web_search |
| 57 | +python -m examples.agenthub.tools.code_interpreter |
| 58 | +``` |
| 59 | + |
| 60 | +Other categories follow the same pattern: |
| 61 | + |
| 62 | +```bash |
| 63 | +python -m examples.agenthub.agents.basic_agents_example |
| 64 | +python -m examples.agenthub.multiturn.responses_chaining |
| 65 | +python -m examples.agenthub.memory.long_term_memory |
| 66 | +python -m examples.agenthub.mcp.create_responses_mcp |
| 67 | +python -m examples.agenthub.vector_stores.vector_stores_crud |
| 68 | +python -m examples.agenthub.files.files_crud |
| 69 | +python -m examples.agenthub.function.create_responses_fc |
| 70 | +``` |
| 71 | + |
| 72 | +## Notes |
| 73 | + |
| 74 | +- Most examples use IAM signing through `oci-genai-auth`. |
| 75 | +- AgentHub examples use OpenAI-compatible `/openai/v1` endpoints and require a project OCID. |
0 commit comments