Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jun 2, 2024
1 parent 4c21976 commit 79fa14a
Show file tree
Hide file tree
Showing 23 changed files with 67 additions and 44 deletions.
5 changes: 3 additions & 2 deletions blueprints/function_calling_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ def __init__(self):
# You can think of filter pipeline as a middleware that can be used to edit the form data before it is sent to the OpenAI API.
self.type = "filter"

# Assign a unique identifier to the pipeline.
# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "function_calling_blueprint"
# self.id = "function_calling_blueprint"
self.name = "Function Calling Blueprint"

# Initialize valves
Expand Down
5 changes: 3 additions & 2 deletions examples/filters/conversation_turn_limit_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ def __init__(self):
# You can think of filter pipeline as a middleware that can be used to edit the form data before it is sent to the OpenAI API.
self.type = "filter"

# Assign a unique identifier to the pipeline.
# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "conversation_turn_limit_filter_pipeline"
# self.id = "conversation_turn_limit_filter_pipeline"
self.name = "Conversation Turn Limit Filter"

self.valves = self.Valves(
Expand Down
4 changes: 2 additions & 2 deletions examples/filters/detoxify_filter_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def __init__(self):
self.type = "filter"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "detoxify_filter_pipeline"
# self.id = "detoxify_filter_pipeline"
self.name = "Detoxify Filter"

# Initialize
Expand Down
6 changes: 5 additions & 1 deletion examples/filters/function_calling_filter_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def calculator(self, equation: str) -> str:

def __init__(self):
super().__init__()
self.id = "my_tools_pipeline"
# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
# self.id = "my_tools_pipeline"
self.name = "My Tools Pipeline"
self.valves = self.Valves(
**{
Expand Down
4 changes: 2 additions & 2 deletions examples/filters/langfuse_filter_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def __init__(self):
self.type = "filter"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "langfuse_filter_pipeline"
# self.id = "langfuse_filter_pipeline"
self.name = "Langfuse Filter"

# Initialize
Expand Down
4 changes: 2 additions & 2 deletions examples/filters/libretranslate_filter_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def __init__(self):
self.type = "filter"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "libretranslate_filter_pipeline"
# self.id = "libretranslate_filter_pipeline"
self.name = "LibreTranslate Filter"

# Initialize
Expand Down
5 changes: 3 additions & 2 deletions examples/filters/rate_limit_filter_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ def __init__(self):
# You can think of filter pipeline as a middleware that can be used to edit the form data before it is sent to the OpenAI API.
self.type = "filter"

# Assign a unique identifier to the pipeline.
# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "rate_limit_filter_pipeline"
# self.id = "rate_limit_filter_pipeline"
self.name = "Rate Limit Filter"

# Initialize rate limits
Expand Down
5 changes: 2 additions & 3 deletions examples/pipelines/integrations/applescript_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.

self.id = "applescript_pipeline"
# self.id = "applescript_pipeline"
self.name = "AppleScript Pipeline"
pass

Expand Down
5 changes: 4 additions & 1 deletion examples/pipelines/integrations/python_code_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
self.id = "python_code_pipeline"
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
# self.id = "python_code_pipeline"
self.name = "Python Code Pipeline"
pass

Expand Down
5 changes: 3 additions & 2 deletions examples/pipelines/integrations/wikipedia_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class Valves(BaseModel):
pass

def __init__(self):
# Assign a unique identifier to the pipeline.
# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "wiki_pipeline"
# self.id = "wiki_pipeline"
self.name = "Wikipedia Pipeline"

# Initialize rate limits
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/azure_openai_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class Valves(BaseModel):

def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "azure_openai_pipeline"
# self.id = "azure_openai_pipeline"
self.name = "Azure OpenAI Pipeline"
self.valves = self.Valves()
pass
Expand Down
8 changes: 7 additions & 1 deletion examples/pipelines/providers/cohere_manifold_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ class Valves(BaseModel):

def __init__(self):
self.type = "manifold"
self.id = "cohere"

# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
# self.id = "cohere"

self.name = "cohere/"

self.valves = self.Valves(**{"COHERE_API_KEY": os.getenv("COHERE_API_KEY")})
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/litellm_manifold_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def __init__(self):
self.type = "manifold"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "litellm_manifold"
# self.id = "litellm_manifold"

# Optionally, you can set the name of the manifold pipeline.
self.name = "LiteLLM: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def __init__(self):
self.type = "manifold"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "litellm_subprocess_manifold"
# self.id = "litellm_subprocess_manifold"

# Optionally, you can set the name of the manifold pipeline.
self.name = "LiteLLM: "
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/llama_cpp_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "llama_cpp_pipeline"
# self.id = "llama_cpp_pipeline"

self.name = "Llama C++ Pipeline"
self.llm = None
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/mlx_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "mlx_pipeline"
# self.id = "mlx_pipeline"
self.name = "MLX Pipeline"
self.host = os.getenv("MLX_HOST", "localhost")
self.port = os.getenv("MLX_PORT", "8080")
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/ollama_manifold_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def __init__(self):
self.type = "manifold"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "ollama_manifold"
# self.id = "ollama_manifold"

# Optionally, you can set the name of the manifold pipeline.
self.name = "Ollama: "
Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/ollama_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "ollama_pipeline"
# self.id = "ollama_pipeline"
self.name = "Ollama Pipeline"
pass

Expand Down
4 changes: 2 additions & 2 deletions examples/pipelines/providers/openai_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "openai_pipeline"
# self.id = "openai_pipeline"
self.name = "OpenAI Pipeline"
pass

Expand Down
7 changes: 4 additions & 3 deletions examples/scaffolds/example_pipeline_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ class Valves(BaseModel):

def __init__(self):
# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "pipeline_example"
self.name = "Pipeline Example"
# self.id = "pipeline_example"

# The name of the pipeline.
self.name = "Pipeline Example"
pass

async def on_startup(self):
Expand Down
5 changes: 3 additions & 2 deletions examples/scaffolds/filter_pipeline_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ def __init__(self):
self.type = "filter"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "filter_pipeline"
# self.id = "filter_pipeline"

self.name = "Filter"

self.valves = self.Valves(**{"pipelines": ["llama3:latest"]})
Expand Down
7 changes: 6 additions & 1 deletion examples/scaffolds/function_calling_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ def __init__(self, pipeline) -> None:

def __init__(self):
super().__init__()
self.id = "my_tools_pipeline"

# Optionally, you can set the id and name of the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
# self.id = "my_tools_pipeline"
self.name = "My Tools Pipeline"
self.valves = self.Valves(
**{
Expand Down
4 changes: 2 additions & 2 deletions examples/scaffolds/manifold_pipeline_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ def __init__(self):
self.type = "manifold"

# Optionally, you can set the id and name of the pipeline.
# Assign a unique identifier to the pipeline.
# Best practice is to not specify the id so that it can be automatically inferred from the filename, so that users can install multiple versions of the same pipeline.
# The identifier must be unique across all pipelines.
# The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes.
self.id = "manifold_pipeline"
# self.id = "manifold_pipeline"

# Optionally, you can set the name of the manifold pipeline.
self.name = "Manifold: "
Expand Down

0 comments on commit 79fa14a

Please sign in to comment.