Skip to content

Commit

Permalink
Add steering concepts
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloiyu committed Dec 18, 2024
1 parent cf58a9e commit 0e5269c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aleph_alpha_client/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class CompletionRequest:
return the optimized completion in the completion field of the CompletionResponse.
The raw completion, if returned, will contain the un-optimized completion.
steering_concepts_to_apply (Optional[list[str]], default None)
Names of the steering vectors to apply on this task. This steers the output in the
direction given by positive examples, and away from negative examples if provided.
Examples:
>>> prompt = Prompt.from_text("Provide a short description of AI:")
>>> request = CompletionRequest(prompt=prompt, maximum_tokens=20)
Expand Down Expand Up @@ -215,6 +219,7 @@ class CompletionRequest:
control_log_additive: Optional[bool] = True
repetition_penalties_include_completion: bool = True
raw_completion: bool = False
steering_concepts_to_apply: Optional[List[str]] = None

def to_json(self) -> Mapping[str, Any]:
payload = {k: v for k, v in self._asdict().items() if v is not None}
Expand Down

0 comments on commit 0e5269c

Please sign in to comment.