-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add deepseek and openrouter #22 * updating docs * fix dependency version conflict * Update requirements.txt --------- Co-authored-by: David G <[email protected]>
- Loading branch information
1 parent
3e7a1e2
commit 78c57a8
Showing
11 changed files
with
112 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Detect a user attempting to exfiltrate an Amazon EC2 AMI Snapshot. This rule lets you monitor the ModifyImageAttribute CloudTrail API calls to detect when an Amazon EC2 AMI snapshot is made public or shared with an AWS account. This rule also inspects: @requestParameters.launchPermission.add.items.group array to determine if the string all is contained. This is the indicator which means the RDS snapshot is made public. @requestParameters.launchPermission.add.items.userId array to determine if the string * is contained. This is the indicator which means the RDS snapshot was shared with a new or unknown AWS account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import logging | ||
import os | ||
|
||
from .base import BaseAIExtractor | ||
from llama_index.llms.deepseek import DeepSeek | ||
|
||
class DeepseekExtractor(BaseAIExtractor, provider='deepseek'): | ||
def __init__(self, **kwargs) -> None: | ||
kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0))) | ||
kwargs.setdefault('model', 'deepseek-chat') | ||
self.llm = DeepSeek(system_prompt=self.system_prompt, **kwargs) | ||
super().__init__() | ||
|
||
def count_tokens(self, text): | ||
try: | ||
return len(self.llm._tokenizer.encode(text)) | ||
except Exception as e: | ||
logging.warning(e) | ||
return super().count_tokens(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
import logging | ||
import os | ||
from .base import BaseAIExtractor | ||
from llama_index.llms.openrouter import OpenRouter | ||
|
||
|
||
class OpenRouterExtractor(BaseAIExtractor, provider="openrouter"): | ||
def __init__(self, **kwargs) -> None: | ||
kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0))) | ||
self.llm = OpenRouter(system_prompt=self.system_prompt, **kwargs) | ||
super().__init__() | ||
|
||
def count_tokens(self, text): | ||
try: | ||
return len(self.llm._tokenizer.encode(text)) | ||
except Exception as e: | ||
logging.warning(e) | ||
return super().count_tokens(text) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters