From 1429c1c9c622010e7b6c4ce3149a950ca10d0493 Mon Sep 17 00:00:00 2001 From: Guillaume Koch <39165367+gkoch78@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:49:32 -0800 Subject: [PATCH] update doc --- docs/data/openai-llm-model.yaml | 20 ++++++++++++++ .../source/reference/llm/llm_config_object.md | 27 ++++--------------- 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 docs/data/openai-llm-model.yaml diff --git a/docs/data/openai-llm-model.yaml b/docs/data/openai-llm-model.yaml new file mode 100644 index 00000000..be5cc54e --- /dev/null +++ b/docs/data/openai-llm-model.yaml @@ -0,0 +1,20 @@ +kind: LLMConfig +version: 0.1 +metadata: + name: an-openai-deployed-model + labels: + provider: OpenAI +spec: + description: "Model used to do ABC" + provider: + name: CML-OpenAI + openAISpec: + model: gpt-4-1106-preview + timeout: 60 + apiKey: sk-my-api-key +# Alternatively, get the api key from an environment variable +# apiKey: +# fromEnvVar: OPENAI_API_KEY + parameters: + n: 3 + temperature: 0.5 diff --git a/docs/source/reference/llm/llm_config_object.md b/docs/source/reference/llm/llm_config_object.md index 23ee06ca..6d712a8e 100644 --- a/docs/source/reference/llm/llm_config_object.md +++ b/docs/source/reference/llm/llm_config_object.md @@ -15,29 +15,12 @@ The following code illustrates the way an LLM could be loaded from a YAML file. ```{eval-rst} .. testcode:: - from council.llm import AzureLLM, LLMConfigObject + from council.llm import OpenAILLM, LLMConfigObject - llm_config = LLMConfigObject.from_yaml("filename.yaml") - llm = AzureLLM.from_config(llm_config) + llm_config = LLMConfigObject.from_yaml("data/openai-llm-model.yaml") + llm = OpenAILLM.from_config(llm_config) ``` -```yaml -kind: LLMConfig -version: 0.1 -metadata: - name: an-openai-deployed-model - labels: - provider: OpenAI -spec: - description: "Model used to do ABC" - provider: - name: CML-OpenAI - openAISpec: - model: gpt-4-1106-preview - timeout: 60 - apiKey: - fromEnvVar: OPENAI_API_KEY - parameters: - n: 3 - temperature: 0.5 +```{literalinclude} ../../../data/openai-llm-model.yaml +:language: yaml ``` \ No newline at end of file