Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoch78 committed Jan 31, 2024
1 parent f538413 commit 1429c1c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
20 changes: 20 additions & 0 deletions docs/data/openai-llm-model.yaml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 5 additions & 22 deletions docs/source/reference/llm/llm_config_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit 1429c1c

Please sign in to comment.