add contexual embedding algorithm notebook #311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
doc:https://docs.pingcap.com/tidb/v7.5/tiup-component-management
model: claude-3-haiku-20240307(use prompt caching)
guide: https://github.com/anthropics/anthropic-cookbook/blob/main/skills/contextual-embeddings/guide.ipynb
Cost(chunk 1 be processed twice, so the total cost = cost_of_chunk1 * 2 + cost_of_chunk2):
Effect Comparison for chunk 1
contexual embedding
Token usage:
DEBUG:root:Input tokens: 346
DEBUG:root:Output tokens: 45
DEBUG:root:Cache creation input tokens: 2544
DEBUG:root:Cache read input tokens: 0
Llama index metadata
Effect Comparison for chunk 2
contexual embedding
Token usage:
DEBUG:root:Input tokens: 300
DEBUG:root:Output tokens: 50
DEBUG:root:Cache creation input tokens: 0
DEBUG:root:Cache read input tokens: 2544
Llama index metadata