Skip to content

Commit

Permalink
Finish resolving type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anticorrelator committed Jan 23, 2024
1 parent 413c163 commit f3e182d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def instrumented_response(*args: Any, **kwargs: Any) -> Dict[str, Any]:
content,
)

return response
return response # type: ignore

return instrumented_response

return _invocation_wrapper


class BotoInstrumentor(BaseInstrumentor):
class BotoInstrumentor(BaseInstrumentor): # type: ignore
__slots__ = ("_original_client_creator",)

def instrumentation_dependencies(self) -> Collection[str]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def instrument(
in_memory_span_exporter.clear()


def test_invoke_client(in_memory_span_exporter: InMemorySpanExporter):
def test_invoke_client(in_memory_span_exporter: InMemorySpanExporter) -> None:
output = b'{"completion":" Hello!","stop_reason":"stop_sequence","stop":"\\n\\nHuman:"}'
streaming_body = StreamingBody(io.BytesIO(output), len(output))
mock_response = {
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_invoke_client(in_memory_span_exporter: InMemorySpanExporter):
assert len(spans) == 1
span = spans[0]
assert span.status.is_ok
attributes = dict(span.attributes)
attributes = dict(span.attributes or dict())
assert attributes["llm.model_name"] == "anthropic.claude-v2"
assert attributes["llm.prompts"] == "Human: hello there? Assistant:"
assert attributes["message.content"] == " Hello!"

0 comments on commit f3e182d

Please sign in to comment.