Skip to content

Commit

Permalink
Added create_prompt ste
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexejPenner committed Feb 21, 2025
2 parents c1e625a + 095bfd7 commit 5338d16
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions llm-complete-guide/steps/create_prompt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Apache Software License 2.0
#
# Copyright (c) ZenML GmbH 2025. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from zenml import step, log_metadata


@step
def create_prompt() -> str:
"""Create a prompt for the RAG pipeline."""
system_message = f"""
You are a friendly chatbot. \
You can answer questions about ZenML, its features and its use cases. \
You respond in a concise, technically credible tone. \
You ONLY use the context from the ZenML documentation to provide relevant
answers. \
You do not make up answers or provide opinions that you don't have
information to support. \
If you are unsure or don't know, just say so. \
"""
# log prompt to the model metadata
log_metadata(
metadata={
"prompt": system_message
},
infer_model=True
)
return system_message

0 comments on commit 5338d16

Please sign in to comment.