diff --git a/docs/source/getting_started/index.md b/docs/source/getting_started/index.md index 0634f4b1a..1da0b8ae3 100644 --- a/docs/source/getting_started/index.md +++ b/docs/source/getting_started/index.md @@ -163,6 +163,23 @@ from llama_stack_client.lib.agents.event_logger import EventLogger from llama_stack_client.types.agent_create_params import AgentConfig from llama_stack_client.types import Document + +def create_http_client(): + from llama_stack_client import LlamaStackClient + + return LlamaStackClient( + base_url=f"http://localhost:{os.environ['LLAMA_STACK_PORT']}" + ) + + +def create_library_client(template="ollama"): + from llama_stack import LlamaStackAsLibraryClient + + client = LlamaStackAsLibraryClient(template) + client.initialize() + return client + + client = ( create_library_client() ) # or create_http_client() depending on the environment you picked