(text, max_tokens=4096)
| 43 | |
| 44 | tokenizer = tiktoken.get_encoding("cl100k_base") |
| 45 | def truncate_text(text, max_tokens=4096): |
| 46 | tokens = tokenizer.encode(text) |
| 47 | if len(tokens) > max_tokens: |
| 48 | tokens = tokens[:max_tokens] |
| 49 | truncated_text = tokenizer.decode(tokens) |
| 50 | return truncated_text |
| 51 | |
| 52 | def get_reasoning_chain(global_config,entities_set): |
| 53 | maybe_edges=list(combinations(entities_set,2)) |
nothing calls this directly
no outgoing calls
no test coverage detected