Skip to content

Instantly share code, notes, and snippets.

Java:
String getDescription() {
StringBuilder stringBuilder = new StringBuilder();
if(titel != null && titel.length() > 0){
stringBuilder.append(titel).append(',')
}
if(vorname != null && vorname.length() > 0){
stringBuilder.append(vorname).append(',')
@olafgeibig
olafgeibig / nous-hermes-2-solar.ollama
Created January 3, 2024 09:35
Ollama modelfile for nous-hermes-2-solar-10.7b
FROM ./nous-hermes-2-solar-10.7b.Q5_K_M.gguf
PARAMETER num_ctx 4096
TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
@olafgeibig
olafgeibig / review_tool.py
Last active June 1, 2024 13:46
A review tool for CrewAI that uses a LLM to review a work result if it matches a given task or topic. I posted this here because it demonstrates how to use Joao's way to do multi-argument calls for calling multi-argument tools. The tool is actually not really very useful, since I don't manage that the agents are passing on their full work result…
from langchain.tools import Tool
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import HumanMessage, SystemMessage
class ReviewToolFactory():
@staticmethod
def get_review_tool(llm: BaseChatModel) -> Tool:
"""
Returns a Tool object that can be used for reviewing a result from working on a task and giving constructive