Skip to content

Commit

Permalink
remove autogen, some of the links break (#2533)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 authored Sep 30, 2024
1 parent 39265aa commit a7e64a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/docs/guides/tracking/costs.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Costs

:::info
Custom costs are accessible via Python and REST queries. UI uptake is under development and expected to be complete by end of Sept 2024
Custom costs are accessible via Python and REST queries. UI uptake is under development and expected to be complete by middle of October 2024
:::

## Adding a custom cost

You can add a custom cost by using the [`add_cost`](/reference/python-sdk/weave/trace/weave.trace.weave_client#method-add_cost) method.
The three required fields are `llm_id`,`prompt_token_cost` and `completion_token_cost`.
The three required fields are `llm_id`, `prompt_token_cost`, and `completion_token_cost`.
`llm_id` is the name of the LLM (e.g. `gpt-4o`). `prompt_token_cost` and `completion_token_cost` are cost per token for the LLM (if the LLM prices were specified inper million tokens, make sure to convert the value).
You can also set `effective_date` to a datetime, to make the cost effective at a specific date, this defaults to the current date.

```python
Expand Down
4 changes: 2 additions & 2 deletions weave/trace/weave_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,8 @@ def add_cost(
Args:
llm_id: The ID of the LLM. eg "gpt-4o-mini-2024-07-18"
prompt_token_cost: The cost of the prompt tokens. eg .0005
completion_token_cost: The cost of the completion tokens. eg .0015
prompt_token_cost: The cost per prompt token. eg .0005
completion_token_cost: The cost per completion token. eg .0015
effective_date: Defaults to the current date. A datetime.datetime object.
provider_id: The provider of the LLM. Defaults to "default". eg "openai"
prompt_token_cost_unit: The unit of the cost for the prompt tokens. Defaults to "USD". (Currently unused, will be used in the future to specify the currency type for the cost eg "tokens" or "time")
Expand Down

0 comments on commit a7e64a8

Please sign in to comment.