- Store secrets in environment variables or dedicated secret management systems
- Never commit secrets to version control
- Implement secret rotation policies
- Use different credentials for different environments
- Encrypt sensitive configuration values
This file contains hidden or 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
| from langchain.tools import BaseTool | |
| from typing import Optional | |
| from pydantic import BaseModel, Field | |
| from langchain_openai.chat_models import ChatOpenAI | |
| from langchain.agents import initialize_agent | |
| import requests | |
| class PrometheusQueryToolConfig(BaseModel): | |
| prometheus_url: str = Field(default="http://localhost:9090") |
This file contains hidden or 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
| # train_grpo.py | |
| import re | |
| import torch | |
| from datasets import load_dataset, Dataset | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import LoraConfig | |
| from trl import GRPOConfig, GRPOTrainer | |
| # Load and prep dataset |