Class: Githuh::LLM::Base
- Inherits:
-
Object
- Object
- Githuh::LLM::Base
- Defined in:
- lib/githuh/llm/base.rb
Constant Summary collapse
- README_CHAR_LIMIT =
Hard cap to keep prompts cheap and within model context.
12_000- REQUEST_TIMEOUT =
30- PROMPT =
<<~PROMPT You are summarizing a GitHub repository for a public directory page. Below is the README. Write a user-friendly description of 5–6 sentences. Focus on: what the project *is*, what problem it *solves*, who would use it, and any notable technical approach or feature. Keep it flowing prose — no bullet points, no headings, no quotes, no markdown syntax. Do NOT include installation instructions, badges, license mentions, or author credits. Return ONLY the description prose — no preamble. README: --- %<readme>s --- PROMPT
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(api_key:) ⇒ Base
constructor
A new instance of Base.
-
#summarize(readme) ⇒ String
A 2-4 sentence description.
Constructor Details
#initialize(api_key:) ⇒ Base
Returns a new instance of Base.
31 32 33 34 |
# File 'lib/githuh/llm/base.rb', line 31 def initialize(api_key:) @api_key = api_key @name = self.class.name.split('::').last.downcase end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
29 30 31 |
# File 'lib/githuh/llm/base.rb', line 29 def api_key @api_key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/githuh/llm/base.rb', line 29 def name @name end |
Instance Method Details
#summarize(readme) ⇒ String
Returns a 2-4 sentence description.
38 39 40 |
# File 'lib/githuh/llm/base.rb', line 38 def summarize(readme) raise NotImplementedError end |