Optimized program with code
This commit is contained in:
@@ -27,6 +27,7 @@ class CypherFromQuestion(dspy.Signature):
|
||||
class GenerateCypherConfig(PrecompiledConfig):
|
||||
model: str = "openrouter/openai/gpt-4o" # OPENROUTER ONLY
|
||||
max_tokens: int = 1024
|
||||
cache: bool = False
|
||||
|
||||
|
||||
class GenerateCypher(PrecompiledProgram):
|
||||
@@ -38,6 +39,7 @@ class GenerateCypher(PrecompiledProgram):
|
||||
model=config.model,
|
||||
max_tokens=config.max_tokens,
|
||||
api_base="https://openrouter.ai/api/v1",
|
||||
cache=config.cache,
|
||||
)
|
||||
self.generate_cypher = dspy.ChainOfThought(CypherFromQuestion)
|
||||
self.generate_cypher.set_lm(self.lm)
|
||||
@@ -69,6 +71,6 @@ if __name__ == "__main__":
|
||||
generate_cypher.push_to_hub(
|
||||
"farouk1/text-to-cypher",
|
||||
with_code=True,
|
||||
tag="v0.0.9",
|
||||
commit_message="Update README.md",
|
||||
tag="v1.0.1",
|
||||
commit_message="Don't cache results",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user